/*
 * Stellar MLS brand theme for the CART Requests customer portal.
 *
 * Design tokens are lifted from the official Stellar MLS media kit
 * (https://www.stellarmls.com/mediakit) and the public site
 * (https://www.stellarmls.com): the Poppins web typeface plus the
 * navy / purple / magenta / teal brand palette.
 *
 * This sheet loads AFTER bootstrap.min.css so it re-maps Bootstrap 5.3's
 * CSS custom properties to brand values instead of forking Bootstrap.
 */

/* ---------------------------------------------------------------------------
 * 0. The hidden attribute must win
 *
 * Bootstrap generates its display utilities as !important, so an element with
 * both a display class and the hidden attribute stays visible — the browser's
 * default `[hidden] { display: none }` loses to `.d-flex { display: flex
 * !important }`. That combination is easy to write by accident and produced an
 * empty red alert box on the invoice step, so hidden is made authoritative
 * here for the whole portal.
 *
 * This matters well beyond that one box: request-flow.js hides and shows every
 * wizard panel, review badge, and action button through the hidden property.
 * ------------------------------------------------------------------------- */
[hidden] {
    display: none !important; /* Beats Bootstrap's d-flex / d-block / d-inline utilities */
}

/* ---------------------------------------------------------------------------
 * 1. Brand tokens
 * Raw palette values so every component references one source of truth.
 * ------------------------------------------------------------------------- */
:root {
    --stellar-navy: #211B57; /* Primary brand navy — app bar, headings, footer */
    --stellar-navy-700: #1A1546; /* Darker navy for gradient ends and hover states */
    --stellar-navy-900: #110E2E; /* Deepest navy used for footer background */
    --stellar-purple: #430098; /* Primary action purple — buttons, links, focus */
    --stellar-purple-700: #360078; /* Purple hover/active shade */
    --stellar-purple-100: #EFE7FA; /* Purple tint for soft backgrounds and badges */
    --stellar-magenta: #9E1C64; /* Secondary accent — destructive/attention states */
    --stellar-magenta-700: #7E1650; /* Magenta hover shade */
    --stellar-plum: #611856; /* Tertiary accent used in gradients */
    --stellar-cyan: #00BCDA; /* Bright accent — progress rails, highlights */
    --stellar-teal: #007985; /* Success/positive accent */
    --stellar-teal-100: #F0FAFB; /* Teal tint for success surfaces */
    --stellar-orange: #F38B00; /* Warning / in-progress accent */
    --stellar-orange-100: #FFF4E5; /* Orange tint for warning surfaces */
    --stellar-blue: #0033A0; /* Informational accent from the Stellar palette */
    --stellar-gray-050: #F7F9FB; /* Page background */
    --stellar-gray-100: #F0F3F5; /* Alternate surface / table stripe */
    --stellar-gray-200: #E2E8F0; /* Hairline borders */
    --stellar-gray-300: #C0CCDA; /* Stronger borders and disabled rails */
    --stellar-gray-500: #80808F; /* Muted body text */
    --stellar-gray-700: #62627A; /* Secondary body text */
    --stellar-ink: #2D3748; /* Default body text colour */

    --stellar-font-sans: "Poppins", "Montserrat", "Segoe UI", Arial, sans-serif; /* Media kit: Poppins is the approved web typeface */
    --stellar-radius: 0.75rem; /* Rounded card corners matching stellarmls.com cards */
    --stellar-radius-sm: 0.5rem; /* Tighter radius for inputs and small buttons */
    --stellar-shadow: 0 2px 12px rgba(33, 27, 87, 0.08); /* Resting elevation */
    --stellar-shadow-lg: 0 12px 32px rgba(33, 27, 87, 0.16); /* Hover / hero elevation */
    --stellar-app-bar-height: 72px; /* Fixed brand bar height referenced by layout offsets */
}

/* Re-map Bootstrap theme variables so stock components inherit the brand. */
:root {
    --bs-primary: var(--stellar-purple); /* Bootstrap "primary" becomes Stellar purple */
    --bs-primary-rgb: 67, 0, 152; /* RGB triplet Bootstrap uses for rgba() mixes */
    --bs-secondary: var(--stellar-navy); /* "Secondary" becomes brand navy */
    --bs-secondary-rgb: 33, 27, 87;
    --bs-success: var(--stellar-teal); /* Success uses brand teal, not Bootstrap green */
    --bs-success-rgb: 0, 121, 133;
    --bs-info: var(--stellar-cyan); /* Info uses brand cyan */
    --bs-info-rgb: 0, 188, 218;
    --bs-warning: var(--stellar-orange); /* Warning uses brand orange */
    --bs-warning-rgb: 243, 139, 0;
    --bs-danger: var(--stellar-magenta); /* Danger uses brand magenta */
    --bs-danger-rgb: 158, 28, 100;
    --bs-body-color: var(--stellar-ink); /* Brand body text colour */
    --bs-body-bg: var(--stellar-gray-050); /* Brand page background */
    --bs-body-font-family: var(--stellar-font-sans); /* Poppins everywhere */
    --bs-border-color: var(--stellar-gray-200); /* Hairline border colour */
    --bs-border-radius: var(--stellar-radius-sm); /* Global control radius */
    --bs-link-color: var(--stellar-purple); /* Brand link colour */
    --bs-link-color-rgb: 67, 0, 152;
    --bs-link-hover-color: var(--stellar-purple-700); /* Brand link hover colour */
    --bs-link-hover-color-rgb: 54, 0, 120;
    --bs-heading-color: var(--stellar-navy); /* Headings in brand navy */
}

/* ---------------------------------------------------------------------------
 * 2. Base typography and page shell
 * ------------------------------------------------------------------------- */
html {
    font-size: 15px; /* Slightly tighter base than Bootstrap default for dense case tables */
    position: relative; /* Anchor for the sticky footer */
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px; /* Restore comfortable reading size on tablet and up */
    }
}

body {
    font-family: var(--stellar-font-sans); /* Poppins per media kit */
    color: var(--stellar-ink);
    background-color: var(--stellar-gray-050);
    display: flex; /* Flex column shell keeps the footer at the bottom without fixed offsets */
    flex-direction: column;
    min-height: 100vh;
    margin-bottom: 0; /* Replaces the old fixed 60px footer spacer */
    -webkit-font-smoothing: antialiased; /* Poppins renders thin without smoothing on Windows */
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--stellar-font-sans);
    font-weight: 600; /* Stellar headings are semibold, not black */
    color: var(--stellar-navy);
    letter-spacing: -0.01em; /* Subtle tightening matches stellarmls.com headings */
}

.stellar-eyebrow {
    text-transform: uppercase; /* Small label above page titles, as used on stellarmls.com */
    letter-spacing: 0.12em;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--stellar-gray-500);
    margin-bottom: 0.25rem;
}

.stellar-main {
    flex: 1 0 auto; /* Push the footer down when page content is short */
    padding-bottom: 3rem;
}

/* Accessible focus ring in brand purple, replacing the Bootstrap blue default. */
.btn:focus-visible,
.btn:active:focus-visible,
.btn-link.nav-link:focus-visible,
.form-control:focus,
.form-select:focus,
.form-check-input:focus,
a:focus-visible {
    box-shadow: 0 0 0 0.2rem rgba(67, 0, 152, 0.28); /* Purple focus halo */
    border-color: var(--stellar-purple);
    outline: none;
}

/* ---------------------------------------------------------------------------
 * 3. Brand app bar (header)
 * White bar carrying the full-colour Stellar MLS logo plus the "CART Requests"
 * product title on the left and the signed-in user menu on the right.
 * Because the bar is white, everything inside it is inked in navy/grey rather
 * than reversed out in white, and the markup pairs it with Bootstrap's
 * navbar-light plus the RGB (not reversed) logo variant.
 * ------------------------------------------------------------------------- */
.stellar-appbar {
    background: #fff; /* White bar; the navy gradient now appears only on page heroes */
    border-bottom: 1px solid var(--stellar-gray-200); /* Hairline defines the bar against the grey page background */
    box-shadow: 0 1px 6px rgba(33, 27, 87, 0.06); /* Much softer than the navy bar needed — just enough to lift it */
    padding-block: 0; /* Height is driven by .stellar-appbar-inner */
}

.stellar-appbar-inner {
    min-height: var(--stellar-app-bar-height); /* Consistent bar height across pages */
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Brand lockup: logo + separator + product title, kept as one non-wrapping unit. */
.stellar-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none; /* Whole lockup is a link back to the landing page */
    color: var(--stellar-navy); /* Product title inked in brand navy against the white bar */
    padding-block: 0.5rem;
}

.stellar-brand:hover,
.stellar-brand:focus {
    color: var(--stellar-navy); /* Logo lockup must not change colour on hover per brand restrictions */
}

.stellar-brand-logo {
    height: 34px; /* Media kit clear-space rule: leave breathing room, never crop the mark */
    width: auto;
    display: block;
}

.stellar-brand-divider {
    width: 1px;
    height: 32px;
    background: var(--stellar-gray-300); /* Thin rule separating the logo from our product name */
    flex: 0 0 auto;
}

.stellar-brand-title {
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.1;
    white-space: nowrap; /* "CART Requests" product title stays on one line; subtitle wraps below */
}

.stellar-brand-subtitle {
    display: block;
    font-size: 0.68rem;
    font-weight: 400;
    letter-spacing: 0.06em; /* Slightly tighter so "Compliance Audit Review Team" fits the app bar */
    text-transform: uppercase;
    color: var(--stellar-gray-500); /* Quiet descriptor under the product name */
    white-space: normal; /* Allow the official CART department name to wrap under the title */
    max-width: 18rem; /* Keeps the long department expansion from stretching the app bar */
}

@media (max-width: 575.98px) {
    .stellar-brand-divider,
    .stellar-brand-subtitle {
        display: none; /* Collapse the lockup to logo + title on small screens */
    }

    .stellar-brand-logo {
        height: 26px;
    }
}

/* Primary navigation links inside the app bar. */
.stellar-appbar .nav-link {
    color: var(--stellar-gray-700); /* Readable but subordinate to the brand lockup */
    font-weight: 500;
    font-size: 0.94rem;
    border-radius: var(--stellar-radius-sm);
    padding-inline: 0.85rem;
}

.stellar-appbar .nav-link:hover,
.stellar-appbar .nav-link:focus {
    color: var(--stellar-purple);
    background: var(--stellar-purple-100); /* Purple tint replaces the glass hover that needed a dark bar */
}

.stellar-appbar .nav-link.active {
    color: var(--stellar-purple);
    background: var(--stellar-purple-100); /* Current section indicator */
    font-weight: 600; /* Extra weight because tint alone is subtler on white than on navy */
}

/* --- Language selector (English / Español) sitting left of the user chip --- */
.stellar-lang-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--stellar-gray-700); /* Subordinate to the brand lockup and the user chip */
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: 999px; /* Pill, matching the user chip */
    border: 1px solid transparent; /* Reserved so the hover border does not shift layout */
    padding: 0.3rem 0.7rem;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.stellar-lang-toggle:hover,
.stellar-lang-toggle:focus,
.stellar-lang-toggle[aria-expanded="true"] {
    color: var(--stellar-purple);
    background: var(--stellar-gray-050);
    border-color: var(--stellar-gray-200); /* Border appears on interaction only */
}

/* Two-letter code (EN / ES) so the active language is readable without opening the menu. */
.stellar-lang-code {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.stellar-lang-panel {
    border: 1px solid var(--stellar-gray-200);
    border-radius: var(--stellar-radius);
    box-shadow: var(--stellar-shadow-lg);
    padding: 0 0 0.35rem; /* Section heading supplies its own top padding */
    min-width: 12rem;
}

/* Each option is a submit button inside its own form, so reset button chrome back to a menu item. */
.stellar-lang-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    background: none;
    border: 0;
    text-align: left;
    border-radius: var(--stellar-radius-sm);
    font-size: 0.92rem;
}

.stellar-lang-option.active {
    background: var(--stellar-purple-100); /* Tint marks the active language */
    color: var(--stellar-purple);
    font-weight: 600;
}

/* Fixed-width gutter so both labels align whether or not they carry the check mark. */
.stellar-lang-check {
    width: 1rem;
    flex: 0 0 auto;
    text-align: center;
}

.stellar-lang-option:not(.active) .stellar-lang-check {
    opacity: 0; /* Reserve the space without drawing a competing dash */
}

@media (max-width: 767.98px) {
    .stellar-lang-menu {
        margin-inline-start: 0; /* Sit flush in the collapsed navbar stack */
    }
}

/* Signed-in user chip in the upper right of the app bar. */
.stellar-user-menu .stellar-user-toggle {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--stellar-gray-050); /* Faint grey chip so the user reads as a control on the white bar */
    border: 1px solid var(--stellar-gray-200);
    border-radius: 999px; /* Pill shape */
    padding: 0.3rem 0.85rem 0.3rem 0.35rem;
    color: var(--stellar-navy);
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.stellar-user-menu .stellar-user-toggle:hover,
.stellar-user-menu .stellar-user-toggle:focus,
.stellar-user-menu .stellar-user-toggle[aria-expanded="true"] {
    background: var(--stellar-gray-100); /* Deepen rather than brighten on hover/open */
    border-color: var(--stellar-gray-300);
}

.stellar-user-menu .stellar-user-toggle::after {
    margin-left: 0.15rem; /* Tighten the Bootstrap dropdown caret against the name */
}

/* Circular initials avatar standing in for a member photo (none available from Ping). */
.stellar-avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--stellar-magenta) 0%, var(--stellar-purple) 100%); /* Brand gradient avatar */
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.stellar-user-name {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.15;
    max-width: 15rem; /* Long member names truncate instead of pushing the bar wider */
}

.stellar-user-name strong {
    font-size: 0.88rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 15rem;
}

.stellar-user-name span {
    font-size: 0.7rem;
    color: var(--stellar-gray-500); /* Secondary identifier (MLS ID) under the name */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 15rem;
}

@media (max-width: 767.98px) {
    .stellar-user-name {
        display: none; /* Avatar-only chip on phones to preserve bar space */
    }
}

.stellar-user-menu .dropdown-menu {
    border: 1px solid var(--stellar-gray-200);
    border-radius: var(--stellar-radius);
    box-shadow: var(--stellar-shadow-lg);
    padding: 0.4rem;
    min-width: 16rem;
}

.stellar-user-menu .dropdown-header {
    color: var(--stellar-navy);
    font-weight: 600;
}

.stellar-user-menu .dropdown-item {
    border-radius: var(--stellar-radius-sm);
    font-size: 0.9rem;
}

.stellar-user-menu .dropdown-item:active {
    background-color: var(--stellar-purple); /* Brand purple active state */
}

/* --- Account panel: full member/claim readout inside the user dropdown --- */
.stellar-user-panel {
    min-width: 22rem; /* Wide enough for GUID record keys without wrapping mid-value */
    max-width: min(24rem, calc(100vw - 1.5rem)); /* Never overflow a phone viewport */
    max-height: min(34rem, calc(100vh - var(--stellar-app-bar-height) - 1.5rem)); /* Scroll rather than run off-screen */
    overflow-y: auto;
    padding: 0; /* Sections manage their own padding */
}

/* Navy header block repeating the avatar, name, and email. */
.stellar-user-panel-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    background: linear-gradient(100deg, var(--stellar-navy) 0%, var(--stellar-purple-700) 100%); /* Matches the app bar wash */
    color: #fff;
    border-top-left-radius: calc(var(--stellar-radius) - 0.15rem);
    border-top-right-radius: calc(var(--stellar-radius) - 0.15rem);
    position: sticky; /* Keeps identity visible while scrolling the claim list */
    top: 0;
    z-index: 2;
}

.stellar-avatar-lg {
    width: 42px; /* Larger avatar for the panel header than the app-bar chip */
    height: 42px;
    font-size: 0.95rem;
    border: 2px solid rgba(255, 255, 255, 0.35); /* Ring separates the gradient avatar from the gradient header */
}

.stellar-user-panel-identity {
    display: flex;
    flex-direction: column;
    min-width: 0; /* Allows the email to ellipsis instead of widening the panel */
    line-height: 1.25;
}

.stellar-user-panel-identity strong {
    font-size: 0.95rem;
    font-weight: 600;
}

.stellar-user-panel-identity span {
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.75);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Uppercase group label above each block of claims. */
.stellar-user-panel-section {
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--stellar-gray-500);
    background: var(--stellar-gray-100);
    padding: 0.35rem 1rem;
    border-block: 1px solid var(--stellar-gray-200);
}

/* Two-column label/value grid for the claim readout. */
.stellar-claim-list {
    display: grid;
    grid-template-columns: 9.5rem 1fr; /* Fixed label column keeps values left-aligned down the panel */
    gap: 0;
    margin: 0;
    padding: 0.4rem 1rem 0.6rem;
}

.stellar-claim-list dt {
    font-size: 0.74rem;
    font-weight: 500;
    color: var(--stellar-gray-500);
    padding: 0.2rem 0.5rem 0.2rem 0;
}

.stellar-claim-list dd {
    font-size: 0.78rem;
    color: var(--stellar-ink);
    margin: 0;
    padding: 0.2rem 0;
    overflow-wrap: anywhere; /* GUIDs and long emails wrap instead of widening the panel */
}

.stellar-user-panel-roles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.55rem 1rem 0.7rem; /* Matches the claim-list padding for a consistent left edge */
}

.stellar-user-panel .dropdown-item {
    margin-inline: 0.4rem; /* Re-introduce the inset the panel's zero padding removed */
}

/* ---------------------------------------------------------------------------
 * 4. Buttons
 * ------------------------------------------------------------------------- */
.btn {
    font-weight: 500;
    border-radius: var(--stellar-radius-sm);
    padding-inline: 1.1rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.btn-primary {
    --bs-btn-bg: var(--stellar-purple); /* Brand purple fill */
    --bs-btn-border-color: var(--stellar-purple);
    --bs-btn-hover-bg: var(--stellar-purple-700);
    --bs-btn-hover-border-color: var(--stellar-purple-700);
    --bs-btn-active-bg: var(--stellar-purple-700);
    --bs-btn-active-border-color: var(--stellar-purple-700);
    --bs-btn-disabled-bg: var(--stellar-gray-300);
    --bs-btn-disabled-border-color: var(--stellar-gray-300);
}

.btn-outline-primary {
    --bs-btn-color: var(--stellar-purple); /* Purple outline variant for secondary actions */
    --bs-btn-border-color: var(--stellar-purple);
    --bs-btn-hover-bg: var(--stellar-purple);
    --bs-btn-hover-border-color: var(--stellar-purple);
    --bs-btn-active-bg: var(--stellar-purple-700);
    --bs-btn-active-border-color: var(--stellar-purple-700);
}

.btn-secondary {
    --bs-btn-bg: var(--stellar-navy); /* Navy fill for neutral-but-strong actions */
    --bs-btn-border-color: var(--stellar-navy);
    --bs-btn-hover-bg: var(--stellar-navy-700);
    --bs-btn-hover-border-color: var(--stellar-navy-700);
}

.btn-outline-secondary {
    --bs-btn-color: var(--stellar-gray-700); /* Quiet cancel/back styling */
    --bs-btn-border-color: var(--stellar-gray-300);
    --bs-btn-hover-bg: var(--stellar-gray-100);
    --bs-btn-hover-border-color: var(--stellar-gray-300);
    --bs-btn-hover-color: var(--stellar-navy);
}

.btn-primary:hover:not(:disabled),
.btn-magenta:hover:not(:disabled) {
    transform: translateY(-1px); /* Micro-lift echoing the card hover on stellarmls.com */
    box-shadow: 0 6px 18px rgba(67, 0, 152, 0.28);
}

/* Magenta call-to-action used for the hero "Start a New CART Request" button. */
.btn-magenta {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--stellar-magenta);
    --bs-btn-border-color: var(--stellar-magenta);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--stellar-magenta-700);
    --bs-btn-hover-border-color: var(--stellar-magenta-700);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--stellar-magenta-700);
    --bs-btn-active-border-color: var(--stellar-magenta-700);
}

.btn-lg {
    padding: 0.8rem 1.9rem; /* Generous hit area for the front-and-centre empty-state CTA */
    font-size: 1.02rem;
}

/* ---------------------------------------------------------------------------
 * 5. Cards, panels and tables
 * ------------------------------------------------------------------------- */
.card {
    border: 1px solid var(--stellar-gray-200);
    border-radius: var(--stellar-radius);
    box-shadow: var(--stellar-shadow);
    background: #fff;
}

.card-header {
    background: #fff; /* Flat white header with a hairline rule, not Bootstrap grey */
    border-bottom: 1px solid var(--stellar-gray-200);
    font-weight: 600;
    color: var(--stellar-navy);
    padding: 1rem 1.25rem;
    border-top-left-radius: var(--stellar-radius) !important;
    border-top-right-radius: var(--stellar-radius) !important;
}

.card-body {
    padding: 1.25rem;
}

/* Section header used inside the request flow cards. */
.stellar-section-title {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--stellar-navy);
    margin-bottom: 0.25rem;
}

.stellar-section-title i {
    color: var(--stellar-purple); /* Purple glyph anchors each section heading */
}

.table {
    --bs-table-border-color: var(--stellar-gray-200);
    margin-bottom: 0;
}

.stellar-table-card {
    overflow: hidden; /* Clip the table's square corners to the card radius */
}

.stellar-table-card .table {
    border-collapse: separate; /* Required so sticky-ish header borders render cleanly */
}

.table > thead {
    background: var(--stellar-gray-100); /* Light brand grey header band */
}

.table > thead th {
    color: var(--stellar-navy);
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase; /* Compact uppercase column labels */
    border-bottom: 1px solid var(--stellar-gray-200);
    padding: 0.75rem 1rem;
    white-space: nowrap;
}

.table > tbody td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    border-color: var(--stellar-gray-200);
}

.table-hover > tbody > tr:hover > * {
    --bs-table-accent-bg: var(--stellar-purple-100); /* Purple tint row hover */
    background-color: var(--stellar-purple-100);
}

.stellar-case-number {
    font-weight: 600;
    color: var(--stellar-purple);
    font-variant-numeric: tabular-nums; /* Align case numbers in the column */
}

/* ---------------------------------------------------------------------------
 * 6. Status pills
 * Neutral base plus semantic modifiers chosen by CaseStatus/SubStatus.
 * ------------------------------------------------------------------------- */
.stellar-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.28rem 0.7rem;
    border-radius: 999px; /* Pill */
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    border: 1px solid transparent;
}

.stellar-status::before {
    content: ""; /* Leading status dot */
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: currentColor;
    flex: 0 0 auto;
}

.stellar-status-new {
    color: var(--stellar-purple); /* Newly submitted */
    background: var(--stellar-purple-100);
    border-color: rgba(67, 0, 152, 0.18);
}

.stellar-status-progress {
    color: #9A5700; /* Darkened orange for AA text contrast on the tint */
    background: var(--stellar-orange-100);
    border-color: rgba(243, 139, 0, 0.28);
}

.stellar-status-approved {
    color: var(--stellar-teal); /* Approved / refund processed */
    background: var(--stellar-teal-100);
    border-color: rgba(0, 121, 133, 0.24);
}

.stellar-status-denied {
    color: var(--stellar-magenta); /* Denied / rejected outcomes */
    background: #FBEEF4;
    border-color: rgba(158, 28, 100, 0.22);
}

.stellar-status-closed {
    color: var(--stellar-gray-700); /* Closed without a positive/negative signal */
    background: var(--stellar-gray-100);
    border-color: var(--stellar-gray-300);
}

/* ---------------------------------------------------------------------------
 * 7. Landing page hero and empty state
 * ------------------------------------------------------------------------- */
.stellar-page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* Full-width welcome band shown above the case list. */
.stellar-hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--stellar-radius);
    background: linear-gradient(115deg, var(--stellar-navy) 0%, var(--stellar-plum) 62%, var(--stellar-magenta) 100%); /* Brand gradient from the media kit palette */
    color: #fff;
    padding: 2rem 2.25rem;
    margin-bottom: 1.75rem;
    box-shadow: var(--stellar-shadow-lg);
}

.stellar-hero::after {
    content: ""; /* Soft cyan glow in the corner, echoing stellarmls.com hero art */
    position: absolute;
    right: -80px;
    top: -120px;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 188, 218, 0.38) 0%, rgba(0, 188, 218, 0) 70%);
    pointer-events: none; /* Decoration must not eat clicks on the CTA */
}

.stellar-hero h1,
.stellar-hero h2 {
    color: #fff; /* Override the navy heading default inside the dark hero */
}

.stellar-hero p {
    color: rgba(255, 255, 255, 0.82);
    margin-bottom: 0;
    max-width: 46rem;
}

.stellar-hero-actions {
    position: relative; /* Sit above the ::after glow */
    z-index: 1;
}

/* Shorter hero used as the header of each request-flow step, so the flow reads as the same site. */
.stellar-hero-compact {
    padding: 1.4rem 1.75rem;
    margin-bottom: 1rem;
}

.stellar-hero-compact p {
    font-size: 0.92rem; /* Step description is supporting text, not a headline */
}

/* "Step X of N" caption pinned to the right of the flow hero heading. */
.stellar-hero-step-count {
    position: relative; /* Above the ::after glow */
    z-index: 1;
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.82);
    background: rgba(255, 255, 255, 0.14); /* Glass pill matching the app-bar user chip */
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
    white-space: nowrap;
}

/* Centred empty state shown when the member has zero CART cases. */
.stellar-empty {
    text-align: center;
    background: #fff;
    border: 1px solid var(--stellar-gray-200);
    border-radius: var(--stellar-radius);
    box-shadow: var(--stellar-shadow);
    padding: 3.5rem 2rem;
}

.stellar-empty-icon {
    width: 84px;
    height: 84px;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--stellar-purple-100) 0%, var(--stellar-teal-100) 100%); /* Soft brand tint halo */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: var(--stellar-purple);
}

.stellar-empty h2 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.stellar-empty p {
    color: var(--stellar-gray-700);
    max-width: 34rem;
    margin: 0 auto 1.75rem;
}

/* Small metric tiles summarising case counts. */
.stellar-stat {
    background: #fff;
    border: 1px solid var(--stellar-gray-200);
    border-radius: var(--stellar-radius);
    padding: 1rem 1.15rem;
    box-shadow: var(--stellar-shadow);
    height: 100%;
}

.stellar-stat-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    color: var(--stellar-gray-500);
}

.stellar-stat-value {
    font-size: 1.65rem;
    font-weight: 600;
    color: var(--stellar-navy);
    line-height: 1.1;
}

/* ---------------------------------------------------------------------------
 * 8. Request flow (wizard) chrome
 * Horizontal stepper rendered by Areas/Member/Pages/Request/_FlowStepper.cshtml.
 * ------------------------------------------------------------------------- */
.stellar-flow-shell {
    background: #fff;
    border: 1px solid var(--stellar-gray-200);
    border-radius: var(--stellar-radius);
    box-shadow: var(--stellar-shadow);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}

.stellar-stepper {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0;
    counter-reset: stellar-step; /* Numbers come from markup, not counters, but reset keeps nesting safe */
}

.stellar-step {
    flex: 1 1 0; /* Steps share the rail evenly so the flow scales as pages are added */
    position: relative;
    text-align: center;
    min-width: 0;
}

/* Connector rail drawn between step markers. */
.stellar-step:not(:first-child)::before {
    content: "";
    position: absolute;
    top: 1.1rem;
    left: 0;
    width: 50%;
    height: 2px;
    background: var(--stellar-gray-300); /* Incomplete rail */
}

.stellar-step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 1.1rem;
    left: 50%;
    width: 50%;
    height: 2px;
    background: var(--stellar-gray-300);
}

/* A done step fills the rail on both sides in brand cyan. */
.stellar-step.is-complete:not(:first-child)::before,
.stellar-step.is-complete:not(:last-child)::after,
.stellar-step.is-current:not(:first-child)::before {
    background: var(--stellar-cyan);
}

.stellar-step-marker {
    position: relative;
    z-index: 1; /* Sit above the connector rails */
    width: 2.2rem;
    height: 2.2rem;
    margin: 0 auto 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    background: #fff;
    color: var(--stellar-gray-500);
    border: 2px solid var(--stellar-gray-300); /* Default: not reached yet */
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.stellar-step.is-complete .stellar-step-marker {
    background: var(--stellar-teal); /* Completed step */
    border-color: var(--stellar-teal);
    color: #fff;
}

.stellar-step.is-current .stellar-step-marker {
    background: var(--stellar-purple); /* Step the member is on */
    border-color: var(--stellar-purple);
    color: #fff;
    box-shadow: 0 0 0 0.32rem rgba(67, 0, 152, 0.14); /* Focus halo marks the active step */
}

.stellar-step-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--stellar-gray-500);
    padding-inline: 0.25rem;
    overflow-wrap: break-word;
}

.stellar-step.is-current .stellar-step-label {
    color: var(--stellar-navy);
    font-weight: 600;
}

.stellar-step.is-complete .stellar-step-label {
    color: var(--stellar-teal);
}

/* Steps already completed are clickable so members can jump back and edit.
 * A <button> rather than an anchor now that step navigation happens client-side with no URL to link to;
 * the appearance is reset to match the plain markers around it. */
.stellar-step .stellar-step-link {
    text-decoration: none;
    display: block;
    width: 100%;
    padding: 0;
    background: none;
    border: 0;
    border-radius: var(--stellar-radius-sm);
    cursor: pointer;
    font: inherit;
    color: inherit;
}

.stellar-step .stellar-step-link:hover:not(:disabled) .stellar-step-label {
    text-decoration: underline;
}

/* Steps not yet reached, and the current step, are disabled — nothing to navigate to. The cursor is
 * reset to default rather than not-allowed, because a step you have simply not got to yet is not an
 * error state. */
.stellar-step .stellar-step-link:disabled {
    cursor: default;
}

@media (max-width: 575.98px) {
    .stellar-step-label {
        font-size: 0.68rem; /* Keep four-plus step labels legible on phones */
    }
}

/* Sticky action bar at the bottom of each flow page. */
.stellar-flow-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: #fff;
    border: 1px solid var(--stellar-gray-200);
    border-radius: var(--stellar-radius);
    box-shadow: var(--stellar-shadow);
    margin-top: 1.5rem;
}

/* ---------------------------------------------------------------------------
 * 9. Forms
 * ------------------------------------------------------------------------- */
.form-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--stellar-gray-700);
    margin-bottom: 0.3rem;
}

.form-control,
.form-select {
    border-color: var(--stellar-gray-300);
    border-radius: var(--stellar-radius-sm);
    padding: 0.55rem 0.75rem;
    font-size: 0.94rem;
}

.form-control[readonly],
.form-control:disabled {
    background-color: var(--stellar-gray-100); /* Read-only SSO/OData fields read as locked */
    color: var(--stellar-gray-700);
    border-style: dashed; /* Dashed border signals "sourced elsewhere, not editable here" */
}

/*
   High-visibility checkboxes/radios. Bootstrap's default is a 1em box with a
   pale hairline border that disappears on white cards, so members missed the
   attestation gates. The box grows to 1.35em with a dark 2px border, and the
   row padding / input pull-back grow together so the box stays aligned with
   its label (Bootstrap pairs padding-left with an equal negative margin-left).
*/
.form-check {
    padding-left: 2em; /* Room for the larger box; must match the input's negative margin below */
    min-height: 1.6rem; /* Keeps single-line rows tall enough for the enlarged box */
}

.form-check .form-check-input {
    margin-left: -2em; /* Pulls the box back into the padding gutter reserved above */
}

.form-check-input {
    width: 1.35em; /* Larger hit target and visual footprint than Bootstrap's 1em */
    height: 1.35em; /* Square box to match the width */
    margin-top: 0.1em; /* Re-centres the taller box against the first line of label text */
    border: 2px solid var(--stellar-gray-700); /* Dark border so the unchecked box reads clearly on white */
    cursor: pointer; /* Signals the box is interactive */
}

.form-check-input:hover:not(:disabled) {
    border-color: var(--stellar-purple); /* Purple hover cue before the member clicks */
}

.form-check-label {
    cursor: pointer; /* Label toggles the box too, so show it as clickable */
}

.form-check-input:checked {
    background-color: var(--stellar-purple); /* Brand purple checkbox/radio fill */
    border-color: var(--stellar-purple);
}

/* Badge marking fields that come from Stellar SSO / MLS records. */
.stellar-source-badge {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--stellar-teal);
    background: var(--stellar-teal-100);
    border-radius: 999px;
    padding: 0.1rem 0.5rem;
    margin-left: 0.35rem;
    vertical-align: middle;
}

/* MLS snapshot cards — read-only profile data shown as text, not faux inputs. */
.stellar-snapshot-card {
    border-color: var(--stellar-gray-200); /* Soft edge so the block reads as reference material */
}

.stellar-snapshot-card > .card-header {
    background: var(--stellar-gray-100); /* Gray header distinguishes snapshot from editable white cards */
    border-bottom-color: var(--stellar-gray-200);
}

.stellar-snapshot-card > .card-body {
    background: var(--stellar-gray-050); /* Slightly tinted body — clearly not an input surface */
}

.stellar-snapshot-card .stellar-source-badge {
    margin-left: 0; /* Badge sits in the header row, not beside each label */
}

/* Editable card — white surface with a purple accent so it reads as the place to type. */
.stellar-editable-card {
    border-color: var(--stellar-purple-100);
    box-shadow: 0 0 0 1px var(--stellar-purple-100); /* Subtle ring without looking like an error state */
}

.stellar-editable-card > .card-header {
    background: #fff;
    border-bottom-color: var(--stellar-purple-100);
}

.stellar-editable-card > .card-body {
    background: #fff;
}

/* Snapshot lists reuse the review grid but drop the top rule on the first row inside tinted cards. */
.stellar-snapshot-list dt,
.stellar-snapshot-list dd {
    border-top-color: var(--stellar-gray-200);
}

/* Definition-list layout used on the review step and MLS snapshot cards. */
.stellar-review-list {
    display: grid;
    grid-template-columns: minmax(11rem, 34%) 1fr; /* Label column then value column */
    gap: 0.1rem 1rem;
    margin: 0;
}

.stellar-review-list dt {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--stellar-gray-500);
    padding: 0.45rem 0;
    border-top: 1px solid var(--stellar-gray-200);
}

.stellar-review-list dd {
    font-size: 0.92rem;
    color: var(--stellar-ink);
    margin: 0;
    padding: 0.45rem 0;
    border-top: 1px solid var(--stellar-gray-200);
    overflow-wrap: anywhere; /* Long explanations and emails must not overflow the card */
}

.stellar-review-list dt:first-of-type,
.stellar-review-list dd:first-of-type {
    border-top: 0; /* No rule above the first pair */
}

@media (max-width: 575.98px) {
    .stellar-review-list {
        grid-template-columns: 1fr; /* Stack label over value on phones */
    }

    .stellar-review-list dd {
        border-top: 0;
        padding-top: 0;
    }
}

/* Preserves the member's paragraph breaks when echoing free-text narratives on the review step. */
.text-pre-wrap {
    white-space: pre-wrap;
    overflow-wrap: anywhere; /* Prevent a single long token from widening the card */
}

/* ---------------------------------------------------------------------------
 * 9b. Invoice picker (New CART Request, step 3)
 *
 * One card per Stax Bill invoice, each holding a line-item table. Every invoice is listed including
 * unpaid ones so members see their whole billing picture, so the styling has to make "not paid, not
 * selectable" obvious without hiding the row.
 * ------------------------------------------------------------------------- */
.stellar-invoice-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.stellar-invoice-card {
    border: 1px solid var(--stellar-gray-200);
    border-left: 4px solid var(--stellar-teal); /* Paid: eligible for a refund request */
    border-radius: var(--stellar-radius);
    padding: 0.9rem 1rem;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.stellar-invoice-card:hover {
    box-shadow: var(--stellar-shadow);
}

/* Unpaid invoices stay visible but read as blocked rather than merely different. */
.stellar-invoice-card.is-unpaid {
    border-left-color: var(--stellar-magenta);
    background: var(--stellar-gray-100);
}

/* Selected invoice or line item — the radio is inside the card, so :has does the highlighting. */
.stellar-invoice-card:has(input.stellar-charge-checkbox:checked) {
    border-color: var(--stellar-purple);
    box-shadow: 0 0 0 0.18rem rgba(67, 0, 152, 0.12);
}

.stellar-invoice-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

/* Invoice number, posted date, paid date, and total in one compact row. */
.stellar-invoice-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.75rem;
    margin: 0.6rem 0 0.75rem;
}

.stellar-invoice-meta dt {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--stellar-gray-500);
}

.stellar-invoice-meta dd {
    margin: 0;
    font-size: 0.9rem;
    color: var(--stellar-ink);
}

.stellar-invoice-lines {
    font-size: 0.87rem;
}

.stellar-invoice-lines thead th {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--stellar-gray-500);
    border-bottom: 1px solid var(--stellar-gray-200);
}

/* Narrow radio column so the product code and description get the available width. */
.stellar-invoice-pick-col {
    width: 2.25rem;
}

.stellar-invoice-lines tbody tr:has(input.stellar-charge-checkbox:checked) {
    background: rgba(67, 0, 152, 0.05); /* Mark the chosen line within the invoice */
}

/* ---------------------------------------------------------------------------
 * 9c. Staged attachment list (New CART Request, step 3)
 *
 * Rendered by request-flow.js from a DataTransfer object rather than by the server, because the files
 * never leave the browser until submit. Each row needs a visible remove control.
 * ------------------------------------------------------------------------- */
.stellar-attachment-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.stellar-attachment-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    background: var(--stellar-gray-100);
    border: 1px solid var(--stellar-gray-200);
    border-radius: var(--stellar-radius-sm);
}

.stellar-attachment-name {
    flex: 1 1 auto;
    font-size: 0.9rem;
    overflow-wrap: anywhere; /* Long file names must not push the remove button off the row */
}

.stellar-attachment-size {
    font-size: 0.78rem;
    color: var(--stellar-gray-500);
    white-space: nowrap; /* Keep "1.4 MB" on one line */
}

.stellar-attachment-remove {
    flex: 0 0 auto;
    width: 1.75rem;
    height: 1.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: none;
    border: 1px solid transparent;
    border-radius: 50%;
    color: var(--stellar-gray-500);
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.stellar-attachment-remove:hover,
.stellar-attachment-remove:focus-visible {
    color: var(--stellar-magenta); /* Removal is destructive, so it warms up on hover */
    background: #FBEEF4;
    border-color: rgba(158, 28, 100, 0.22);
}

.stellar-attachment-empty {
    font-size: 0.85rem;
    color: var(--stellar-gray-500);
    font-style: italic;
}

/* ---------------------------------------------------------------------------
 * 10. Alerts and footer
 * ------------------------------------------------------------------------- */
.alert {
    border-radius: var(--stellar-radius);
    border-width: 1px;
    font-size: 0.92rem;
}

.alert-info {
    --bs-alert-bg: var(--stellar-teal-100); /* Brand cyan/teal informational tint */
    --bs-alert-border-color: rgba(0, 188, 218, 0.35);
    --bs-alert-color: #0A5C66;
}

.alert-danger {
    --bs-alert-bg: #FBEEF4; /* Magenta tint for validation failures */
    --bs-alert-border-color: rgba(158, 28, 100, 0.3);
    --bs-alert-color: var(--stellar-magenta-700);
}

.alert-success {
    --bs-alert-bg: var(--stellar-teal-100);
    --bs-alert-border-color: rgba(0, 121, 133, 0.3);
    --bs-alert-color: #0A5C66;
}

.alert-warning {
    --bs-alert-bg: var(--stellar-orange-100);
    --bs-alert-border-color: rgba(243, 139, 0, 0.35);
    --bs-alert-color: #8A4F00;
}

/* Empty validation summaries still render a div; hide it so no blank red bar appears. */
.alert:empty,
.validation-summary-valid {
    display: none;
}

/* ===========================================================================
   Validation errors — inverted, high-contrast treatment

   Small red text next to a field was too easy to miss, especially for the
   attestation checkboxes that sit at the bottom of a long step. The message is
   therefore inverted into a filled magenta chip, and the offending control is
   given a heavy magenta border and tint so the eye lands on it.

   These rules target the framework's own classes — .input-validation-error on
   the control and .field-validation-error on the message span — which are
   applied identically by the server-side validation tag helpers and by
   jquery.validate.unobtrusive on the client. Styling those instead of
   Bootstrap's .is-invalid means every form in the portal inherits the
   treatment with no markup changes and no custom validation adapter.
   =========================================================================== */

/*
   The message becomes a solid magenta chip with white text.

   color and font-size carry !important for one specific reason: the existing
   spans also carry Bootstrap's .text-danger and .small utilities, and Bootstrap
   generates its text utilities as !important, so a plain declaration here would
   lose and leave unreadable magenta-on-magenta text.
*/
.field-validation-error {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.45rem;
    margin-top: 0.45rem;
    padding: 0.45rem 0.7rem;
    background: var(--stellar-magenta);
    color: #fff !important; /* Beats .text-danger */
    font-size: 0.85rem !important; /* Beats .small */
    font-weight: 600;
    line-height: 1.35;
    border-radius: var(--stellar-radius-sm);
    box-shadow: 0 1px 5px rgba(158, 28, 100, 0.35); /* Lifts the chip off the white card */
}

/* Warning glyph injected via content so no markup has to change. Bootstrap Icons
   is already loaded in _Layout, and \f33a is bi-exclamation-triangle-fill. */
.field-validation-error::before {
    font-family: bootstrap-icons !important;
    content: "\f33a";
    font-weight: 400;
    flex: 0 0 auto; /* Glyph keeps its width when the message wraps */
    line-height: 1.35;
}

/*
   Inside a checkbox/radio row the chip must drop below the label rather than
   trailing the end of a long sentence, so it becomes a flex block sized to its
   own content. width: fit-content keeps it from stretching the full row width.
*/
.form-check > .field-validation-error,
.stellar-attestation-gate > .field-validation-error {
    display: flex;
    width: fit-content;
    margin-top: 0.55rem;
}

/* Keep the floated checkbox above any in-flow overlap from the tinted error panel. */
.stellar-attestation-gate .form-check-input {
    position: relative;
    z-index: 1;
}

/* Text inputs, selects, and textareas: heavy border plus a faint magenta wash. */
.form-control.input-validation-error,
.form-select.input-validation-error,
textarea.input-validation-error {
    border: 2px solid var(--stellar-magenta);
    background-color: #FDF6FA; /* Lighter than the alert tint so text stays readable */
}

/* Keep the error colour while focused: the default purple halo would otherwise
   suggest the field had been put right merely by clicking into it. */
.form-control.input-validation-error:focus,
.form-select.input-validation-error:focus,
.form-check-input.input-validation-error:focus,
textarea.input-validation-error:focus {
    border-color: var(--stellar-magenta);
    box-shadow: 0 0 0 0.2rem rgba(158, 28, 100, 0.3);
}

.form-check-input.input-validation-error {
    border: 2px solid var(--stellar-magenta);
    background-color: #FDF6FA;
}

/*
   A checkbox is roughly 1rem square, so inverting the box itself is not enough
   to catch the eye. :has() lets the row flag itself instead, turning the whole
   attestation line into a tinted panel with a magenta spine.

   The padding is rebuilt rather than added to: .form-check has padding-left
   of 2em (enlarged from Bootstrap's 1.5em) and pulls the input back out with
   margin-left -2em, so the left padding has to stay 2em plus the new inset or
   the checkbox drifts outside the panel.
*/
.form-check:has(.input-validation-error),
.form-check:has(.field-validation-error),
.stellar-attestation-gate:has(.input-validation-error) .form-check,
.stellar-attestation-gate:has(.field-validation-error) .form-check {
    padding: 0.65rem 0.75rem 0.65rem calc(2em + 0.75rem); /* 2em matches the enlarged .form-check gutter so the box stays inside the panel */
    background: #FDF6FA;
    border-left: 4px solid var(--stellar-magenta);
    border-radius: var(--stellar-radius-sm);
}

/* Reinforce the label so the requirement reads as unmet, not merely decorated. */
.form-check:has(.input-validation-error) .form-check-label,
.form-check:has(.field-validation-error) .form-check-label,
.stellar-attestation-gate:has(.input-validation-error) .form-check-label,
.stellar-attestation-gate:has(.field-validation-error) .form-check-label {
    color: var(--stellar-magenta-700);
    font-weight: 600;
}

/* Field labels next to an invalid control, where the markup puts them in the
   same wrapper (the standard row layout used across the request flow). */
.mb-3:has(> .input-validation-error) > .form-label,
[class*="col-"]:has(> .input-validation-error) > .form-label {
    color: var(--stellar-magenta-700);
    font-weight: 600;
}

/* Summary list at the top of the form, when one is rendered. */
.validation-summary-errors ul {
    margin-bottom: 0;
    padding-left: 1.15rem;
}

.validation-summary-errors li {
    font-weight: 600; /* Each unmet requirement should read as an action item */
}

/* ---------------------------------------------------------------------------
 * Customer portal footer — mirrors rules.stellarmls.com Rules & Regulations footer
 * (centered contact block, social circles, disclaimer bar).
 * ------------------------------------------------------------------------- */
.stellar-footer {
    flex: 0 0 auto; /* Stays at the bottom of the flex body shell */
    background: var(--stellar-navy); /* #211B57 — primary navy band behind contact block */
    color: var(--stellar-gray-300); /* Soft gray body copy on navy */
    font-size: 1rem;
    padding: 0; /* Inner sections own their padding so disclaimer can sit flush */
    margin-top: auto; /* Pushes footer to the bottom of the flex page shell */
}

.stellar-footer .footer-content {
    display: flex; /* Stack contact + social vertically */
    flex-direction: column;
    align-items: center; /* Center the whole contact composition */
    justify-content: center;
    padding: 2rem 2.3125rem 0; /* Matches live rules footer top/side padding */
}

.stellar-footer .footer-details {
    display: flex; /* Logo, heading, and contact lines as one centered column */
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 37.5rem; /* Keeps long contact lines from stretching too wide */
}

.stellar-footer .image-sec {
    width: 70px; /* Symbol mark size from the live Rules footer */
    height: 70px;
    margin: 0 0 1.5rem; /* Space below logo before GET IN TOUCH */
    object-fit: contain; /* Preserve mark aspect without cropping */
}

.stellar-footer .heading {
    color: #fff; /* White heading on navy for hierarchy */
    font-size: 1.25rem; /* 20px — matches live Rules footer */
    font-weight: 600;
    letter-spacing: 2px; /* Wide tracking used on the public Rules site */
    line-height: 1.5;
    margin: 0 0 1.5rem; /* Gap before the first contact line */
    text-align: center;
}

.stellar-footer .footer-details p {
    color: var(--stellar-gray-300); /* Body lines read as secondary on navy */
    font-size: 1rem;
    line-height: 1.5;
    margin: 0 0 0.5rem; /* Tight stack between contact paragraphs */
    text-align: center;
}

.stellar-footer .footer-details a {
    color: var(--stellar-gray-300); /* Underlined contact links stay light gray */
    text-decoration: underline;
}

.stellar-footer .footer-details a:hover {
    color: #fff; /* Brighten on hover for affordance */
}

.stellar-footer .social-sec {
    display: flex; /* Horizontal row of circular social buttons */
    gap: 1rem; /* 16px between icon circles */
    justify-content: center;
    margin: 1.5rem 0 2rem; /* Breathing room above disclaimer bar */
}

.stellar-footer .social-sec a {
    display: flex; /* Centers the SVG inside the circle */
    align-items: center;
    justify-content: center;
    width: 44px; /* Circle diameter from live Rules footer */
    height: 44px;
    border-radius: 50%; /* Pill-circle social buttons */
    background: var(--stellar-gray-300); /* Light gray circle behind navy icon */
    text-decoration: none;
}

.stellar-footer .social-sec a:hover {
    background: #fff; /* Slight lift on hover without changing brand icon fill */
}

.stellar-footer .disclaimer-sec {
    background: #1B164A; /* Slightly deeper navy band under the contact block */
}

.stellar-footer .disclaimer-content {
    display: flex; /* Legal links left, copyright right on wide screens */
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 2.3125rem; /* Matches live Rules footer disclaimer padding */
    color: var(--stellar-gray-300);
    font-size: 0.875rem; /* 14px legal/disclaimer type */
    line-height: 1.5;
}

.stellar-footer .disclaimer-links {
    display: flex; /* Wrapable row of policy links */
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem; /* Vertical + horizontal spacing when wrapped */
}

.stellar-footer .disclaimer-links a {
    color: var(--stellar-gray-300); /* Quiet legal links on deep navy */
    text-decoration: none;
    padding: 0.25rem 0; /* Comfortable tap target without looking like buttons */
}

.stellar-footer .disclaimer-links a:hover {
    color: #fff; /* Brighten on hover */
    text-decoration: underline;
}

.stellar-footer .copyright {
    margin: 0; /* Avoid Bootstrap paragraph spacing blowing the disclaimer row */
    color: var(--stellar-gray-300);
    font-size: 0.875rem;
}

/* ---------------------------------------------------------------------------
 * 10b. Prerequisites step — three requirement cards (Before You Begin)
 * Matches the Stellar three-column requirement layout: numbered purple circle,
 * bold centred title, optional italic note on card 1.
 * ------------------------------------------------------------------------- */
.stellar-requirements-grid {
    margin-top: 0.25rem; /* Breathing room below the hero band */
}

.stellar-requirement-card {
    background: #fff; /* White cards on the gray page surface */
    border-radius: var(--stellar-radius); /* Rounded corners per mock */
    box-shadow: var(--stellar-shadow); /* Soft elevation */
    padding: 2rem 1.5rem; /* Generous inner padding */
    text-align: center; /* Centred copy like the reference */
    display: flex;
    flex-direction: column;
    align-items: center; /* Centre the number badge and text block */
}

.stellar-requirement-number {
    width: 3rem;
    height: 3rem;
    border-radius: 50%; /* Purple numbered circle */
    background: var(--stellar-purple);
    color: #fff;
    font-weight: 700;
    font-size: 1.35rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    flex-shrink: 0;
}

.stellar-requirement-title {
    font-weight: 700; /* Bold primary line on each card */
    color: var(--stellar-ink);
    margin-bottom: 0;
    line-height: 1.55;
    font-size: 0.95rem;
}

.stellar-requirement-title em strong {
    font-style: italic; /* Card 3: emphasised "must" */
    font-weight: 700;
}

.stellar-requirement-note {
    font-size: 0.875rem;
    font-style: italic; /* Secondary grey note on card 1 only */
    color: var(--stellar-gray-500);
    margin-top: 0.85rem;
    margin-bottom: 0;
    line-height: 1.5;
}

@media (max-width: 767.98px) {
    .stellar-requirement-card {
        padding: 1.5rem 1.25rem; /* Tighter padding when cards stack */
    }
}

/* ---------------------------------------------------------------------------
 * 11. Reduced-motion support
 * ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .btn,
    .stellar-step-marker,
    .stellar-user-menu .stellar-user-toggle {
        transition: none; /* Honour OS-level motion reduction */
    }

    .btn-primary:hover:not(:disabled),
    .btn-magenta:hover:not(:disabled) {
        transform: none;
    }
}
