/* ============================================================
   RHBAA Celebration Entry Form — Screen Styles
   ============================================================ */

* { box-sizing: border-box; }

body {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    color: #000;
    background: #e8e8e8;
    margin: 0;
    padding: 0;
}

/* Page wrapper */
.page-wrapper {
    max-width: 960px;
    margin: 20px auto;
    background: #fff;
    padding: 20px 24px;
    box-shadow: 0 0 10px rgba(0,0,0,0.15);
}

/* ---- FORM INPUT PAGE ---- */
h1.page-title {
    text-align: center;
    font-size: 22px;
    margin: 0 0 4px 0;
    letter-spacing: 1px;
}
.page-subtitle {
    text-align: center;
    font-size: 11px;
    font-weight: bold;
    margin-bottom: 2px;
}
.page-deadline {
    text-align: center;
    font-size: 13px;
    font-weight: bold;
    color: #cc0000;
    margin-bottom: 16px;
}

/* Header bar with logo + org info */
.form-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    border-bottom: 2px solid #000;
    padding-bottom: 12px;
}
.form-header .logo-area {
    flex: 0 0 110px;
    text-align: center;
}
.form-header .logo-area img {
    width: 100px;
    height: auto;
}
.form-header .org-area {
    flex: 0 0 260px;
    padding-left: 10px;
}
.form-header .org-area .org-name {
    font-weight: bold;
    font-size: 15px;
}
.form-header .org-area .org-detail {
    font-size: 11px;
}
.form-header .title-area {
    flex: 1;
    text-align: center;
}

/* ---- Official form rendering (confirmation/print/admin) ---- */
.form-official {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    color: #000;
}

/* Header table */
.form-header-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 8px;
}
.form-header-table td {
    vertical-align: middle;
}
.logo-cell {
    width: 120px;
    text-align: center;
}
.form-logo {
    width: 100px;
    height: auto;
}
.org-info-cell {
    padding-left: 10px;
    font-size: 11px;
}
.org-info-cell div:first-child {
    font-weight: bold;
    font-size: 15px;
}
.title-cell {
    text-align: center;
}
.form-main-title {
    font-size: 22px;
    font-weight: bold;
    letter-spacing: 1px;
}
.form-subtitle {
    font-size: 10px;
    font-weight: bold;
}
.form-deadline {
    font-size: 12px;
    font-weight: bold;
    color: #cc0000;
}

/* Main entry table */
.form-main-table {
    width: 100%;
    border-collapse: collapse;
    border: 2px solid #000;
    margin-bottom: 0;
}
.form-main-table th {
    border: 1px solid #000;
    padding: 4px 6px;
    font-size: 10px;
    font-weight: bold;
    background: #f0f0f0;
    text-align: center;
    vertical-align: middle;
}
.form-main-table td {
    border: 1px solid #000;
    padding: 6px 8px;
    vertical-align: top;
}
.cell-class-num {
    width: 60px;
    text-align: center;
    font-weight: bold;
    font-size: 16px;
}
.cell-horse {
    width: 170px;
}
.cell-fee {
    width: 90px;
    text-align: center;
}

/* Registration row table */
.form-reg-table {
    width: 100%;
    border-collapse: collapse;
    border: 2px solid #000;
    border-top: none;
    margin-bottom: 10px;
}
.form-reg-table td {
    border: 1px solid #000;
    padding: 6px 8px;
    vertical-align: top;
    text-align: center;
}
.cell-entry-num {
    width: 60px;
    font-weight: bold;
}
.cell-insp-fee {
    width: 90px;
}

/* Cell labels */
.cell-label {
    font-size: 9px;
    color: #555;
    margin-bottom: 2px;
}
.cell-label.small {
    font-size: 8px;
}

/* Field values in rendered form */
.field-value {
    font-weight: bold;
    min-height: 18px;
    word-wrap: break-word;
}
.field-address {
    font-size: 10px;
}

/* Fee display */
.fee-label {
    font-size: 9px;
    color: #555;
    margin-bottom: 2px;
}
.fee-amount {
    font-weight: bold;
    font-size: 14px;
}

/* Class info bar */
.class-info-bar {
    border: 1px solid #000;
    padding: 6px 10px;
    margin-bottom: 10px;
    background: #fffde0;
    font-size: 11px;
}

/* Legal text */
.legal-text {
    font-size: 7.5px;
    line-height: 1.35;
    margin-bottom: 10px;
    border: 1px solid #999;
    padding: 4px 6px;
    text-align: justify;
}
@media screen {
    .legal-text {
        background: #f8f8f5;
        border-color: #ccc;
        border-radius: 3px;
        padding: 8px 10px;
        font-size: 8px;
        color: #555;
    }
}

/* Bottom three-column table */
.form-bottom-table {
    width: 100%;
    border-collapse: collapse;
    border: 2px solid #000;
}
.form-bottom-table th {
    border: 1px solid #000;
    padding: 4px 6px;
    font-size: 10px;
    font-weight: bold;
    background: #f0f0f0;
    text-align: center;
}
.form-bottom-table .sub-note {
    font-size: 8px;
    font-weight: normal;
}
.bottom-cell {
    border: 1px solid #000;
    padding: 8px 10px;
    vertical-align: top;
    width: 33%;
}
.signature-line {
    border-bottom: 1px solid #000;
    min-height: 22px;
    margin-bottom: 6px;
}
.visit-office-banner {
    background: #cc0000;
    color: #fff;
    font-weight: bold;
    font-size: 12px;
    text-align: center;
    padding: 6px;
    margin: 8px 0 4px 0;
}
@media screen {
    .visit-office-banner {
        background: linear-gradient(90deg, #b00000 0%, #cc0000 50%, #b00000 100%);
        border-radius: 3px;
        letter-spacing: 0.5px;
        box-shadow: 0 2px 4px rgba(180,0,0,0.2);
    }
}
.payment-methods {
    margin: 4px 0;
    font-size: 11px;
}
.payment-methods.grayed-out {
    padding: 6px;
    background: #e8e8e8;
    color: #999;
    border: 1px solid #ccc;
}
.on-file-check {
    margin: 4px 0;
    font-size: 11px;
}
.small-note {
    font-size: 8px;
}

/* Submission metadata */
.submission-meta {
    margin-top: 10px;
    padding: 6px;
    background: #f5f5f5;
    font-size: 10px;
    color: #666;
    border: 1px solid #ddd;
}

/* ---- Site Footer ---- */
.site-footer {
    text-align: center;
    padding: 20px 10px 30px;
    position: relative;
    z-index: 1;
}
.site-footer a {
    color: #fff;
    text-decoration: none;
    font-size: 11px;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 6px rgba(0,0,0,0.7), 0 0 20px rgba(0,0,0,0.4);
}
.site-footer a:hover {
    color: #fff;
    text-decoration: none;
    text-shadow: 0 1px 8px rgba(0,0,0,0.9), 0 0 30px rgba(0,0,0,0.5);
}
.site-footer a:visited {
    color: #fff;
}

/* ---- INPUT FORM STYLES ---- */

/* Screen-only color accents (not printed) */
@media screen {
    .form-header {
        background: linear-gradient(135deg, #fdfcfb 0%, #f5f0e8 100%);
        border-radius: 6px 6px 0 0;
        padding-bottom: 12px;
    }
    .form-row-1 {
        background: #fafaf5;
    }
    .form-row-2 {
        background: #f4f6f8;
    }
    .form-col-making {
        background: linear-gradient(180deg, #f8faf8 0%, #eef5ee 100%);
    }
    .form-col-paying {
        background: linear-gradient(180deg, #f8f8fa 0%, #eeeef5 100%);
    }
    .form-col-winnings {
        background: linear-gradient(180deg, #faf8f5 0%, #f5eee8 100%);
    }
    .form-section-header {
        background: linear-gradient(90deg, #1a1a2e 0%, #2a2a4e 100%) !important;
        color: #fff !important;
    }
    .legal-text {
        background: #fefefe;
        border-color: #d0d0d0;
    }
    .page-wrapper {
        border-radius: 8px;
        overflow: hidden;
    }
}

.form-section {
    border: 2px solid #000;
    margin-bottom: 0;
}
.form-section + .form-section {
    border-top: none;
}
.form-section-header {
    background: #f0f0f0;
    padding: 4px 6px;
    font-weight: bold;
    font-size: 10px;
    border-bottom: 1px solid #000;
    text-align: center;
    letter-spacing: 0.3px;
}

/* Grid layout for form fields */
.field-grid {
    display: grid;
    gap: 0;
}
/* Match official form proportions */
.field-grid-6 {
    grid-template-columns: minmax(140px, 280px) 180px 1fr 1fr 1fr 80px;
}
.field-grid-6.class-selected {
    grid-template-columns: 70px 180px 1fr 1fr 1fr 80px;
}
.field-grid-6r {
    grid-template-columns: 50px 1fr 1fr 1fr 1fr 80px;
}
.field-grid-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.form-cell {
    border: 1px solid #000;
    padding: 3px 6px;
}
.form-cell label {
    display: block;
    font-size: 8.5px;
    color: #333;
    font-weight: bold;
    margin-bottom: 1px;
    line-height: 1.3;
}
.form-cell label .required {
    color: #c00;
}

/* Inputs */
.form-cell input[type="text"],
.form-cell textarea,
.form-cell select {
    width: 100%;
    border: 1px solid #999;
    padding: 3px 5px;
    font-size: 12px;
    font-family: Arial, sans-serif;
    background: #fffff5;
}
@media screen {
    .form-cell input[type="text"],
    .form-cell textarea {
        border-color: #bbb;
        border-radius: 3px;
        transition: border-color 0.2s, box-shadow 0.2s;
    }
    .form-cell input[type="text"]:focus,
    .form-cell textarea:focus {
        border-color: #2e7d32;
        box-shadow: 0 0 0 2px rgba(46,125,50,0.12);
        outline: none;
    }
}
.form-cell textarea {
    resize: vertical;
    min-height: 40px;
}
.form-cell select {
    background: #fffff5;
}
.form-cell select:disabled,
.form-cell select[readonly] {
    background: #e9e9e9;
    color: #333;
}

/* Class select specific */
#classSelect {
    font-size: 13px;
    padding: 6px 8px;
    line-height: 1.4;
}
#classSelect option {
    padding: 4px 8px;
    font-size: 13px;
}
#classSelect optgroup {
    font-weight: bold;
    font-size: 12px;
    padding: 4px 0;
    color: #333;
}
/* When class is selected, show just the number */
#classSelectCell.has-selection #classSelect {
    font-size: 14px;
    font-weight: bold;
}

.form-cell input[type="checkbox"] {
    transform: scale(1.3);
    margin-right: 6px;
}

/* Fee display in form */
.fee-display {
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    padding: 8px 4px;
    background: #f9f9f0;
    border: 1px solid #999;
    margin-top: 4px;
}
@media screen {
    .fee-display {
        background: linear-gradient(135deg, #f5f5e0 0%, #eee8d0 100%);
        border-color: #ccc099;
        border-radius: 3px;
        color: #2e7d32;
    }
}

/* Total bar */
.total-bar {
    background: #fffde0;
    border: 2px solid #000;
    padding: 10px 14px;
    font-size: 15px;
    font-weight: bold;
    text-align: right;
    margin-bottom: 6px;
}
.total-bar .total-amount {
    font-size: 18px;
    color: #006600;
}
@media screen {
    .total-bar {
        background: linear-gradient(90deg, #f5f0d0 0%, #fffde0 50%, #f5f0d0 100%);
        border-color: #b0a060;
        border-radius: 4px;
    }
    .total-bar .total-amount {
        font-size: 20px;
        text-shadow: 0 1px 0 rgba(0,100,0,0.15);
    }
}

/* Submit area */
.submit-area {
    text-align: center;
    margin: 20px 0;
}
.submit-area button {
    background: #006600;
    color: #fff;
    border: none;
    padding: 12px 40px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    letter-spacing: 1px;
}
.submit-area button:hover {
    background: #008800;
}
@media screen {
    .submit-area button {
        background: linear-gradient(180deg, #228822 0%, #006600 100%);
        border-radius: 6px;
        box-shadow: 0 3px 8px rgba(0,80,0,0.3);
        transition: transform 0.15s, box-shadow 0.15s;
    }
    .submit-area button:hover {
        transform: translateY(-1px);
        box-shadow: 0 5px 14px rgba(0,80,0,0.35);
        background: linear-gradient(180deg, #2a9a2a 0%, #008800 100%);
    }
}

/* Print/action buttons on confirmation page */
.action-buttons {
    text-align: center;
    margin: 20px 0;
}
.action-buttons button,
.action-buttons a {
    display: inline-block;
    padding: 10px 28px;
    margin: 0 8px;
    font-size: 14px;
    font-weight: bold;
    text-decoration: none;
    cursor: pointer;
    border: 2px solid #333;
}
.btn-print {
    background: #006;
    color: #fff;
    border-color: #006;
}
.btn-print:hover {
    background: #008;
}
.btn-new {
    background: #060;
    color: #fff;
    border-color: #060;
}
.btn-new:hover {
    background: #080;
}

/* Error / success messages */
.msg-error {
    background: #fdd;
    border: 2px solid #c00;
    padding: 10px 14px;
    margin-bottom: 16px;
    color: #900;
    font-weight: bold;
}
.msg-success {
    background: #dfd;
    border: 2px solid #060;
    padding: 10px 14px;
    margin-bottom: 16px;
    color: #040;
    font-weight: bold;
}

/* ---- ADMIN PAGE ---- */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #000;
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}
.admin-table th {
    background: #333;
    color: #fff;
    padding: 6px 8px;
    text-align: left;
    font-size: 10px;
}
.admin-table td {
    border-bottom: 1px solid #ddd;
    padding: 5px 8px;
}
.admin-table tr:hover {
    background: #f0f0ff;
}
.admin-table a {
    color: #006;
    text-decoration: none;
}
.admin-table a:hover {
    text-decoration: underline;
}

.admin-nav {
    margin-bottom: 12px;
    font-size: 12px;
}
.admin-nav a {
    color: #006;
    margin-right: 12px;
}

/* Settings form */
.settings-form {
    max-width: 500px;
    margin: 20px 0;
}
.settings-form label {
    display: block;
    font-weight: bold;
    font-size: 11px;
    margin-top: 10px;
    margin-bottom: 2px;
}
.settings-form input[type="text"],
.settings-form input[type="password"],
.settings-form input[type="number"],
.settings-form input[type="email"] {
    width: 100%;
    padding: 6px 8px;
    font-size: 12px;
    border: 1px solid #999;
}
.settings-form button {
    margin-top: 14px;
    padding: 8px 24px;
    font-size: 13px;
    background: #006;
    color: #fff;
    border: none;
    cursor: pointer;
}
.settings-form button:hover {
    background: #008;
}

/* ============================================================
   RESPONSIVE / MOBILE
   ============================================================ */

/* Tablet */
@media (max-width: 960px) {
    .page-wrapper {
        margin: 10px;
        padding: 14px;
    }
    .field-grid-6,
    .field-grid-6.class-selected,
    .field-grid-6r {
        grid-template-columns: 1fr 1fr;
    }
    .field-grid-3 {
        grid-template-columns: 1fr;
    }
    .form-header {
        flex-wrap: wrap;
    }
    .form-header .title-area {
        flex-basis: 100%;
        margin-top: 10px;
    }
    /* Confirmation / rendered form tables */
    .form-main-table,
    .form-reg-table,
    .form-bottom-table {
        font-size: 11px;
    }
}

/* Mobile */
@media (max-width: 600px) {
    body {
        background: #fff;
    }
    .page-wrapper {
        margin: 0;
        padding: 10px;
        box-shadow: none;
        border-radius: 0;
    }

    /* Header stacks vertically */
    .form-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 6px;
        padding-bottom: 10px;
    }
    .form-header .logo-area {
        flex: none;
    }
    .form-header .logo-area img {
        width: 70px;
    }
    .form-header .org-area {
        flex: none;
        padding-left: 0;
        text-align: center;
    }
    .form-header .org-area .org-name {
        font-size: 13px;
    }
    .form-header .org-area .org-detail {
        font-size: 10px;
    }
    .form-header .title-area {
        flex: none;
        margin-top: 4px;
    }
    h1.page-title {
        font-size: 16px;
        letter-spacing: 0;
    }
    .page-subtitle {
        font-size: 9px;
    }
    .page-deadline {
        font-size: 11px;
    }

    /* All grids become single column */
    .field-grid-6,
    .field-grid-6r,
    .field-grid-3 {
        grid-template-columns: 1fr;
    }

    /* Form cells — more padding + colored borders for visual flow on mobile */
    .form-cell {
        padding: 10px 12px;
        border-color: #d0d0d0;
        border-left: 3px solid #1a1a2e;
    }
    .form-cell label {
        font-size: 11px;
        margin-bottom: 4px;
        color: #1a1a2e;
    }

    /* Color-coded left borders per section on mobile */
    .form-row-1 .form-cell { border-left-color: #2e7d32; }
    .form-row-2 .form-cell { border-left-color: #1565c0; }
    .form-col-making   { border-left-color: #2e7d32 !important; }
    .form-col-paying    { border-left-color: #5c6bc0 !important; }
    .form-col-winnings  { border-left-color: #e65100 !important; }

    /* Entry # cell stands out as staff-only */
    .form-row-2 .form-cell:first-child {
        border-left-color: #999 !important;
        background: #eee !important;
    }

    /* Section headers pop on mobile */
    .form-section-header {
        padding: 8px 12px;
        font-size: 12px;
    }

    /* Bigger touch targets for inputs */
    .form-cell input[type="text"],
    .form-cell textarea,
    .form-cell select {
        font-size: 16px;
        padding: 10px 10px;
        border-radius: 4px;
    }
    .form-cell textarea {
        min-height: 60px;
    }
    .form-cell select {
        -webkit-appearance: none;
        appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M0 0l6 8 6-8z' fill='%23555'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 10px center;
        padding-right: 30px;
    }

    /* Checkbox bigger for touch */
    .form-cell input[type="checkbox"] {
        transform: scale(1.5);
        margin-right: 8px;
    }

    /* Fee display */
    .fee-display {
        font-size: 18px;
        padding: 10px;
        min-height: 40px;
        line-height: 40px;
    }

    /* Total bar */
    .total-bar {
        text-align: center;
        padding: 12px;
        font-size: 16px;
    }
    .total-bar .total-amount {
        font-size: 22px;
        display: block;
        margin-top: 4px;
    }

    /* Legal text */
    .legal-text {
        font-size: 8px;
        padding: 8px;
    }

    /* Section headers */
    .form-section-header {
        font-size: 12px;
        padding: 8px;
    }

    /* Submit button full width */
    .submit-area button {
        width: 100%;
        padding: 16px;
        font-size: 18px;
        border-radius: 6px;
    }

    /* Action buttons stack on mobile */
    .action-buttons {
        display: flex;
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }
    .action-buttons button,
    .action-buttons a {
        margin: 0;
        padding: 14px 16px;
        font-size: 15px;
        text-align: center;
        border-radius: 6px;
        display: block;
    }

    /* Messages */
    .msg-error, .msg-success {
        font-size: 13px;
        padding: 12px;
    }

    /* ---- Rendered form (confirmation/print view) on mobile ---- */

    /* Header table becomes stacked */
    .form-header-table td {
        display: block;
        width: 100% !important;
        text-align: center;
    }
    .logo-cell {
        width: 100% !important;
        padding-bottom: 6px;
    }
    .form-logo {
        width: 70px;
    }
    .org-info-cell {
        padding-left: 0;
        text-align: center;
        padding-bottom: 6px;
    }
    .form-main-title {
        font-size: 15px;
    }
    .form-subtitle {
        font-size: 9px;
    }
    .form-deadline {
        font-size: 10px;
    }

    /* Main table becomes stacked cards */
    .form-main-table,
    .form-reg-table,
    .form-bottom-table {
        display: block;
        border: 2px solid #000;
    }
    .form-main-table thead,
    .form-reg-table thead,
    .form-bottom-table thead {
        display: none;
    }
    .form-main-table tbody,
    .form-main-table tr,
    .form-main-table td,
    .form-reg-table tbody,
    .form-reg-table tr,
    .form-reg-table td,
    .form-bottom-table tbody,
    .form-bottom-table tr,
    .form-bottom-table td,
    .form-bottom-table th {
        display: block;
        width: 100%;
    }
    .form-main-table td,
    .form-reg-table td {
        border: none;
        border-bottom: 1px solid #ddd;
        padding: 8px 10px;
    }
    .form-main-table td:last-child,
    .form-reg-table td:last-child {
        border-bottom: none;
    }
    .cell-class-num {
        width: auto !important;
        font-size: 18px;
        background: #f0f0f0;
    }
    .cell-class-num::before {
        content: "Class # ";
        font-size: 11px;
        font-weight: normal;
        color: #555;
    }
    .cell-horse { width: auto !important; }
    .cell-fee { width: auto !important; }
    .cell-entry-num { width: auto !important; }
    .cell-insp-fee { width: auto !important; }

    /* Bottom table sections */
    .form-bottom-table th {
        background: #f0f0f0;
        color: #000;
        border-bottom: 1px solid #000;
        text-align: center;
        padding: 8px;
        font-size: 12px;
    }
    .bottom-cell {
        width: 100% !important;
        border: none;
        border-bottom: 2px solid #000;
        padding: 10px;
    }
    .bottom-cell:last-child {
        border-bottom: none;
    }

    /* Class info bar */
    .class-info-bar {
        font-size: 11px;
        text-align: center;
        line-height: 1.6;
    }

    /* Submission metadata */
    .submission-meta {
        font-size: 9px;
        text-align: center;
    }
}
