/* Source Racks Portal — frontend styles
   Accessibility-focused: WCAG AA contrast, readable sizes/weights. */

.srp-dashboard,
.srp-registration {
    max-width: 1100px;
    margin: 0 auto;
    font-family: inherit;
    color: #1f2937;            /* near-black default text */
    font-size: 16px;
    line-height: 1.6;
}

/* All text inside the portal defaults to high-contrast dark */
.srp-dashboard *,
.srp-registration * {
    color: inherit;
}

.srp-dashboard-header {
    margin-bottom: 1.75rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #d1d5db;
}

.srp-dashboard-header h2 {
    margin: 0 0 .35rem;
    font-size: 1.6rem;
    font-weight: 700;
    color: #111827;
}

/* Muted text — still WCAG AA on white (#4b5563 = 7.0:1) */
.srp-muted {
    color: #4b5563;
    font-size: .95rem;
}

/* Summary stat cards */
.srp-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 1rem;
    margin-bottom: 2.25rem;
}

.srp-stat {
    background: #ffffff;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    padding: 1.1rem 1.25rem;
}

.srp-stat-highlight {
    background: #eff6ff;
    border-color: #2563eb;
}

.srp-stat-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: .35rem;
    color: #111827;
}

.srp-stat-label {
    font-size: .9rem;
    font-weight: 600;
    color: #374151;            /* 8.9:1 on white */
    text-transform: uppercase;
    letter-spacing: .03em;
}

/* Submit a New Referral section */
.srp-submit-lead {
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    background: #ffffff;
    border: 2px solid #d1d5db;
    border-radius: 8px;
}

.srp-submit-lead .srp-section-header { margin-bottom: 1rem; }

/* Section header */
.srp-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.srp-section-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    color: #111827;
}

/* Empty state */
.srp-empty {
    padding: 2rem;
    background: #f3f4f6;
    border: 2px dashed #9ca3af;
    border-radius: 8px;
    text-align: center;
    color: #374151;
    font-size: 1rem;
}

/* Table */
.srp-table-wrap {
    overflow-x: auto;
    border: 2px solid #d1d5db;
    border-radius: 8px;
}

.srp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1rem;
    color: #1f2937;
}

.srp-table th,
.srp-table td {
    text-align: left;
    padding: .9rem 1rem;
    border-bottom: 1px solid #d1d5db;
}

.srp-table th {
    background: #f3f4f6;
    font-weight: 700;
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #1f2937;            /* dark, high contrast headers */
}

.srp-table td {
    color: #1f2937;
}

.srp-table tr:last-child td { border-bottom: none; }

/* Customer sub-text in table rows — readable, not faint */
.srp-table .srp-muted {
    color: #4b5563;
    font-size: .92rem;
}

/* Status badges — all combinations meet WCAG AA */
.srp-status {
    display: inline-block;
    padding: .25rem .7rem;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.srp-status-submitted     { background: #e5e7eb; color: #1f2937; }
.srp-status-in_discussion { background: #fde68a; color: #713f12; }
.srp-status-won           { background: #a7f3d0; color: #064e3b; }
.srp-status-lost          { background: #fecaca; color: #7f1d1d; }

/* Form */
.srp-form { max-width: 480px; }

.srp-field { margin-bottom: 1.15rem; }

.srp-field label {
    display: block;
    margin-bottom: .4rem;
    font-weight: 600;
    font-size: 1rem;
    color: #1f2937;
}

.srp-field input[type="text"],
.srp-field input[type="email"],
.srp-field input[type="tel"],
.srp-field input[type="password"] {
    width: 100%;
    padding: .6rem .75rem;
    border: 2px solid #6b7280;
    border-radius: 6px;
    font-size: 1rem;
    color: #1f2937;
    box-sizing: border-box;
}

.srp-field input::placeholder { color: #6b7280; }

.srp-field input:focus {
    outline: 3px solid #2563eb;
    outline-offset: 1px;
    border-color: #2563eb;
}

.srp-field small {
    display: block;
    margin-top: .3rem;
    color: #4b5563;
    font-size: .9rem;
}

.srp-required { color: #b91c1c; font-weight: 700; }

.srp-recaptcha-field { margin: 1.25rem 0; }

.srp-button {
    display: inline-block;
    background: #1d4ed8;
    color: #ffffff;
    border: none;
    padding: .7rem 1.4rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.srp-button:hover { background: #1e40af; color: #ffffff; }

.srp-button:focus {
    outline: 3px solid #1d4ed8;
    outline-offset: 2px;
}

.srp-button-secondary {
    background: #ffffff;
    color: #1d4ed8;
    border: 2px solid #1d4ed8;
}

.srp-button-secondary:hover { background: #eff6ff; color: #1e40af; }

/* Notices */
.srp-notice {
    padding: 1.1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 2px solid;
    font-size: 1rem;
}

.srp-notice h3 { margin: 0 0 .5rem; font-size: 1.15rem; font-weight: 700; }
.srp-notice p { margin: 0 0 .5rem; }
.srp-notice p:last-child { margin-bottom: 0; }
.srp-notice ul { margin: 0; padding-left: 1.35rem; }
.srp-notice li { margin-bottom: .25rem; }

.srp-notice-info    { background: #eff6ff; border-color: #2563eb; color: #1e3a8a; }
.srp-notice-success { background: #ecfdf5; border-color: #059669; color: #064e3b; }
.srp-notice-warning { background: #fffbeb; border-color: #d97706; color: #713f12; }
.srp-notice-error   { background: #fef2f2; border-color: #dc2626; color: #7f1d1d; }

/* Mobile table — card layout */
@media (max-width: 700px) {
    .srp-table thead { display: none; }
    .srp-table tr {
        display: block;
        padding: .85rem;
        border-bottom: 2px solid #d1d5db;
    }
    .srp-table td {
        display: block;
        padding: .4rem 0;
        border: none;
    }
    .srp-table td[data-label]::before {
        content: attr(data-label) ": ";
        font-weight: 700;
        color: #1f2937;
    }
}

/* ============================================================
   THEME OVERRIDE LAYER
   Themes style table/td/th and text elements aggressively and
   can out-specify the rules above. These targeted overrides
   force the portal's accessible colors/sizes to win regardless
   of theme. Scoped to .srp-* so nothing else on the site is affected.
   ============================================================ */

.srp-dashboard .srp-table,
.srp-dashboard .srp-table tr,
.srp-dashboard .srp-table td,
.srp-dashboard .srp-table th {
    color: #1f2937 !important;
    font-size: 1rem !important;
}

.srp-dashboard .srp-table th {
    color: #1f2937 !important;
    font-size: .85rem !important;
    font-weight: 700 !important;
    background: #f3f4f6 !important;
}

.srp-dashboard .srp-table td {
    background: transparent !important;
}

/* Customer sub-name and any muted text in rows */
.srp-dashboard .srp-table .srp-muted,
.srp-dashboard .srp-muted {
    color: #4b5563 !important;
    font-size: .92rem !important;
}

/* Header / welcome area */
.srp-dashboard .srp-dashboard-header h2 {
    color: #111827 !important;
    font-weight: 700 !important;
}

.srp-dashboard .srp-dashboard-header .srp-muted {
    color: #4b5563 !important;
    font-size: .95rem !important;
}

/* Status badge text must always win over theme link/td colors */
.srp-dashboard .srp-status-submitted     { color: #1f2937 !important; }
.srp-dashboard .srp-status-in_discussion { color: #713f12 !important; }
.srp-dashboard .srp-status-won           { color: #064e3b !important; }
.srp-dashboard .srp-status-lost          { color: #7f1d1d !important; }

/* Section headings */
.srp-dashboard .srp-section-header h3 {
    color: #111827 !important;
    font-weight: 700 !important;
}

/* Stat cards (already fine, but lock them in) */
.srp-dashboard .srp-stat-value { color: #111827 !important; }
.srp-dashboard .srp-stat-label { color: #374151 !important; }
