/**
 * Express Entry Hub - Assessment Form Styles (Gold Series Edition v2)
 * Professional immigration portal with vertical sidebar navigation - Gold Series Design
 * UPDATED: April 19, 2026 - EXACTLY MATCHES ADMIN PANEL DESIGN
 * 
 * @package ExpressEntryHub
 * @since 1.4.0
 * Gold Series Design: Matches admin panel exactly
 */

/* ==========================================================================
   CSS VARIABLES (From Gold Series Admin Panel)
   ========================================================================== */
:root {
    /* PRIMARY GRADIENTS (CT-DERIVED — ConfidenceTalk v1.9.18 semantic model)
       Color tokens are OMITTED here and printed inline by EEH_Color_Theme::get_css()
       on `body.eeh-plugin-page` (higher specificity wins the cascade). These aliases
       resolve through var() to the backend-selected palette at use-time, while the
       CT-value fallbacks keep the questionnaire correct when the theme is absent. */
    --gold-gradient: var(--color-primary-gradient, linear-gradient(135deg, #C2714A 0%, #D4845C 50%, #E09A72 100%));
    --bronze-metallic-gradient: var(--color-primary-gradient, linear-gradient(135deg, #C2714A 0%, #D4845C 50%, #E09A72 100%));
    --metallic-steel-gradient: var(--color-secondary-gradient, linear-gradient(135deg, #2C5F6E 0%, #3A7A8C 50%, #4A8FA0 100%));
    --error-gradient: linear-gradient(145deg, #c53030 0%, #9b2c2c 50%, #742a2a 100%);
    
    /* SPACING SYSTEM (LOCKED - 5px between cards) */
    --card-spacing: 5px; /* Vertical and horizontal spacing between ALL cards */
    --grid-gap: 5px; /* Gap in cards grid */
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    
    /* CARD DIMENSIONS (LOCKED) */
    --card-radius: 16px;
    --card-padding: 20px;
    --card-shadow: 0 15px 22px -8px rgba(44, 62, 80, 0.4);
    --card-hover-shadow: 0 20px 30px -10px rgba(44, 62, 80, 0.5);
    
    /* COLORS (LOCKED) */
    --color-background: #eef2f6;
    --color-surface: #ffffff;
    --color-border-light: #f0f2f5;
    --color-border-medium: #edf2f7;
    --color-border-dark: #e2e8f0;
    
    /* TEXT COLORS (LOCKED) */
    --color-text-primary: #1e293b;
    --color-text-secondary: #64748b;
    --color-text-tertiary: #94a3b8;
    --color-text-on-dark: #ffffff;
    --color-text-on-gold: #1a202c;
    
    /* STATUS COLORS (LOCKED) */
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-error: #ef4444;
    --color-info: #3b82f6;
    
    /* TYPOGRAPHY (LOCKED) */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --font-family-mono: 'SF Mono', Monaco, 'Courier New', monospace;
    --line-height-normal: 1.5;
    --line-height-tight: 1.3;
    --letter-spacing-normal: 0.01em;
    --letter-spacing-wide: 0.02em;
}

/* ==========================================================================
   CONTAINED GOLD-FRAME SHELL (CD v3.1 — questionnaire variant)
   Wraps the whole assessment form inside a centered, round-cornered
   container with the gold line border, matching the header content
   width (1200px) and the admin/dashboard shells. Reuses
   `.eeh-gold-series` from pages.css/frontend.css when present; this
   block is a self-contained fallback so the frame still applies
   without those files.
   ========================================================================== */
.eeh-gold-series.eeh-gold-series-form {
    margin: 0 auto;            /* centered, no inset frame (CT standard) */
    padding: 0;
    max-width: 1200px;         /* matches header content / admin / dashboard (1200px) */
    background: transparent;
    box-sizing: border-box;
    font-family: var(--font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
}

@media (max-width: 768px) {
    .eeh-gold-series.eeh-gold-series-form {
        margin: 0 auto;
        padding: 0;
    }
}

/* ==========================================================================
   MAIN LAYOUT - MATCHES ADMIN PANEL
   ========================================================================== */

/* The sidebar/content row. These values used to be INLINE on the elements
   (`style="display:flex; min-height:600px"` on the row, `width:30%` on the
   sidebar, `width:70%` on the content). Inline styles outrank stylesheets, so
   every responsive override below them was dead: the ≤992px off-canvas drawer
   (`position:fixed; left:-100%`) could never hide the sidebar and the mobile
   stack never applied. Hoisted to classes so the breakpoints actually win. */
.eeh-assessment-layout {
    display: flex;
    min-height: 600px;
}

.eeh-assessment-container {
    max-width: 100%;
    width: 100%;
    margin: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    border: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 80vh;
}

@media (min-width: 993px) {
    .eeh-assessment-container {
        flex-direction: column;
        min-height: 70vh;
    }
}

/* ==========================================================================
   ADMIN BAR - EXACT MATCH TO ADMIN PANEL
   ========================================================================== */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 44px; /* Reduced from 56px to match tab height exactly */
    background: var(--bronze-metallic-gradient);
    color: var(--color-text-on-dark);
    padding: 0 var(--spacing-lg);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 15px 25px -8px rgba(139, 69, 19, 0.4);
    position: relative;
    z-index: 10;
    margin-top: 15px;
    margin-bottom: 2px;
    margin-left: 8px; /* Align with tab left edge (8px from left) */
    width: calc(100% - 24px); /* Stretch to maintain right edge alignment */
    box-sizing: border-box;
}

.top-bar-left {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex: 0 0 auto;
    min-width: 180px; /* Give enough space for company name */
}

.top-bar-left .company-name {
    color: inherit; /* Inherit natural color from parent (matches Gold Series button text) */
    font-size: 13px; /* Good size that you like */
    font-weight: 600; /* Good weight that you like */
    white-space: nowrap;
    letter-spacing: 0.8px; /* Good spacing that you like */
    text-transform: uppercase; /* Good uppercase that you like */
    opacity: 1;
    /* No shadow effects - clean, simple text */
    text-shadow: none;
    /* Center vertically */
    display: flex;
    align-items: center;
    height: 100%;
}

.top-bar-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.top-bar-center .premium-badge {
    background: var(--gold-gradient);
    color: var(--color-text-on-dark);
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 11px; /* Reduced from 12px for longer text */
    letter-spacing: 0.5px;
    box-shadow: 0 2px 5px rgba(184, 134, 11, 0.4);
    white-space: nowrap;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    flex: 0 0 auto;
    justify-content: flex-end;
}

.top-bar-right .tagline {
    color: #FFFFFF; /* White for maximum readability */
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); /* Dark shadow for contrast */
    opacity: 1;
    background: rgba(255, 255, 255, 0.1); /* Subtle container background */
    padding: 6px 12px; /* Padding for visual weight */
    border-radius: 20px; /* Rounded container */
    border: 1px solid rgba(255, 255, 255, 0.2); /* Subtle border */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* Container shadow */
}

/* Home affordances in the form's own top bar.
   The questionnaire renders in focus mode (no site header/footer), so this bar
   is the visitor's only chrome. Both the logo+brand on the left and the Home
   button on the right lead back to the site home page, so a visitor who wants
   to abandon a 20-tab form is never trapped on it. */
.top-bar-home-link {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 100%;
    color: inherit;
    text-decoration: none;
    border-radius: 8px;
    padding: 0 6px;
    margin-left: -6px;
    transition: background 0.15s ease, opacity 0.15s ease;
}

.top-bar-home-link:hover,
.top-bar-home-link:focus-visible {
    background: rgba(255, 255, 255, 0.14);
    text-decoration: none;
    outline: none;
}

.top-bar-home-link:focus-visible {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
}

/* The logo is an <img> inside the link; keep its existing rounding. */
.top-bar-home-link .logo {
    display: block;
    border-radius: 8px;
}

.top-bar-exit-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #FFFFFF;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.32);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: background 0.15s ease, transform 0.15s ease;
}

.top-bar-exit-link:hover,
.top-bar-exit-link:focus-visible {
    background: rgba(255, 255, 255, 0.28);
    border-color: rgba(255, 255, 255, 0.5);
    color: #FFFFFF;
    text-decoration: none;
    transform: translateY(-1px);
    outline: none;
}

.top-bar-exit-link:focus-visible {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.6);
}

/* Remove old header styles */
.eeh-assessment-header {
    display: none;
}

/* ==========================================================================
   MOBILE HAMBURGER MENU
   ========================================================================== */
.mobile-sidebar-toggle {
    display: none;
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    background: var(--bronze-metallic-gradient);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 5px 10px -3px rgba(139, 69, 19, 0.4);
    border: 1px solid rgba(205, 133, 63, 0.5);
}

.mobile-sidebar-toggle span {
    display: block;
    width: 24px;
    height: 3px;
    background: white;
    margin: 4px 0;
    border-radius: 2px;
}

@media (max-width: 992px) {
    .mobile-sidebar-toggle {
        display: block;
    }
}

/* ==========================================================================
   VERTICAL SIDEBAR - MATCHES ADMIN PANEL SIDEBAR
   ========================================================================== */
.eeh-assessment-sidebar {
    width: 100%;
    background: transparent; /* Allow page background to show through */
    border-right: 1px solid rgba(255, 255, 255, 0.15);
    overflow-y: auto;
}

@media (min-width: 993px) {
    .eeh-assessment-sidebar {
        width: 30%;
        min-width: 320px;
        max-width: 400px;
        flex: 0 0 auto;
    }
    .eeh-assessment-content {
        width: 70%;
        flex: 1 1 auto;
        min-width: 0;
    }
}

@media (max-width: 992px) {
    .eeh-assessment-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 350px;
        height: 100vh;
        z-index: 999;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.25);
        background: var(--bronze-metallic-gradient);
    }
    
    .eeh-assessment-sidebar.active {
        left: 0;
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.7);
        z-index: 998;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
}

/* ==========================================================================
   NAVIGATION TABS - EXACT MATCH TO ADMIN PANEL NAVIGATION
   ========================================================================== */
.vertical-steps {
    padding: var(--spacing-lg) 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Use admin panel nav-item styling */
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px var(--spacing-lg);
    margin: 0 var(--spacing-sm);
    border: none;
    background: var(--bronze-metallic-gradient);
    color: var(--color-text-on-dark);
    text-decoration: none;
    cursor: pointer;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 8px rgba(139, 69, 19, 0.2);
    /* NO TRANSITIONS - STATIC DESIGN */
    white-space: nowrap; /* Prevent text wrapping */
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-item:hover {
    background: var(--bronze-metallic-gradient);
    color: var(--color-text-on-dark);
}

.nav-item.current,
.nav-item.active {
    background: var(--metallic-steel-gradient);
    color: var(--color-text-on-dark);
}

.nav-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.nav-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0; /* Important for ellipsis to work in flex container */
}

/* Remove old step-item styling - now using .nav-item instead */
/* .step-item { display: none !important; } */

/* ==========================================================================
   CONTENT AREA - MATCHES ADMIN PANEL CONTENT AREA
   ========================================================================== */
.eeh-assessment-content {
    width: 100%;
    padding: var(--spacing-lg);
    overflow-y: auto;
    background: transparent; /* Allow page background to show through */
}

@media (min-width: 993px) {
    .eeh-assessment-content {
        width: 70%;
    }
}

/* ==========================================================================
   TAB CONTENT - MATCHES ADMIN PANEL CARD STYLING
   ========================================================================== */
.tab {
    display: none;
}

.tab.active {
    display: block;
}

.tab-content {
    background: var(--metallic-steel-gradient); /* ALL CARDS USE METALLIC STEEL GRADIENT */
    color: var(--color-text-on-dark);
    border-radius: var(--card-radius);
    padding: var(--card-padding);
    box-shadow: var(--card-shadow); /* Card shadow like admin panel cards */
    margin-bottom: var(--card-spacing); /* 5px vertical spacing */
    /* NO TRANSITIONS - STATIC DESIGN */
}

.tab-header {
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.tab-header h3 {
    color: var(--color-text-on-dark);
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.tab-header p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
}

/* ==========================================================================
   FORM FIELDS - MATCHES ADMIN PANEL FORM CONTROLS
   ========================================================================== */
.section-fields {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--grid-gap); /* 5px spacing between fields */
    margin: var(--spacing-md) 0;
    align-items: start; /* Prevent vertical stretching - keeps all fields aligned at top */
    grid-auto-flow: dense; /* Fill gaps naturally when fields are conditionally hidden */
}

.form-field {
    margin-bottom: var(--spacing-lg);
    min-height: 80px; /* Consistent minimum height for balanced grid alignment */
}

.form-field label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
    color: var(--color-text-on-dark);
    font-size: 14px;
    min-height: 42px; /* Fixed label height to ensure all input fields align at same vertical position */
    line-height: 1.3;
}

.form-field .required {
    color: var(--color-error);
    margin-left: 0.25rem;
}

.required-note {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.75);
    margin-top: 0.5rem;
    font-style: italic;
}

/* Use admin panel form-control styling */
.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="tel"],
.form-field input[type="number"],
.form-field input[type="date"],
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: var(--color-text-on-dark);
    font-size: 14px;
    box-sizing: border-box;
    font-family: var(--font-family);
    /* NO TRANSITIONS - STATIC DESIGN */
}

.form-field input[type="text"]:focus,
.form-field input[type="email"]:focus,
.form-field input[type="tel"]:focus,
.form-field input[type="number"]:focus,
.form-field input[type="date"]:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
}

.form-field input[type="date"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.1) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.7)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4' width='18' height='18' rx='2' ry='2'></rect><line x1='16' y1='2' x2='16' y2='6'></line><line x1='8' y1='2' x2='8' y2='6'></line><line x1='3' y1='10' x2='21' y2='10'></line></svg>") no-repeat right 1rem center;
    background-size: 20px;
    padding-right: 3rem;
}

.form-field select {
    background: rgba(255, 255, 255, 0.1) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.7)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>") no-repeat right 1rem center;
    background-size: 20px;
    padding-right: 3rem;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.form-field textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.5;
}

/* Form Field Help Text */
.field-help {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.75);
    font-style: italic;
}

/* Form Validation */
.form-field.error input,
.form-field.error select,
.form-field.error textarea {
    border-color: var(--color-error);
    background: rgba(239, 68, 68, 0.1);
}

.form-field .error-message {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--color-error);
    font-weight: 500;
}

/* ==========================================================================
   BUTTONS - MATCHES ADMIN PANEL BUTTONS
   ========================================================================== */
.btn-next-tab,
.btn-prev-tab,
.btn-submit {
    background: var(--bronze-metallic-gradient);
    color: var(--color-text-on-dark);
    border: none;
    border-radius: 30px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(139, 69, 19, 0.3);
    border: 1px solid rgba(205, 133, 63, 0.5);
    /* NO TRANSITIONS - STATIC DESIGN */
}

.btn-next-tab:hover,
.btn-prev-tab:hover,
.btn-submit:hover {
    background: var(--bronze-metallic-gradient);
    color: var(--color-text-on-dark);
    box-shadow: 0 6px 12px rgba(139, 69, 19, 0.4);
}

.btn-next-tab:active,
.btn-prev-tab:active,
.btn-submit:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(139, 69, 19, 0.3);
}

.btn-prev-tab {
    background: var(--metallic-steel-gradient);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-submit {
    background: var(--gold-gradient);
    color: var(--color-text-on-gold);
    font-weight: 700;
    border: 1px solid rgba(184, 134, 11, 0.5);
}

/* ==========================================================================
   SECTION NAVIGATION
   ========================================================================== */
.section-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-md);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.section-navigation .progress-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
}

/* ==========================================================================
   MOBILE RESPONSIVE - MATCHES ADMIN PANEL MOBILE
   ========================================================================== */
@media (max-width: 992px) {
    .eeh-assessment-container {
        flex-direction: column;
        min-height: 100vh;
        border-radius: 0;
        margin: 0;
        max-width: 100%;
    }

    /* Stack the row and let the sidebar become the off-canvas drawer declared
       below. `min-height: 600px` is a desktop affordance and only creates dead
       space once the layout stacks, so it is dropped here. */
    .eeh-assessment-layout {
        display: block;
        min-height: 0;
    }
    
    .top-bar {
        margin-left: 0;
        width: 100%;
        border-radius: 0;
        padding: 0 var(--spacing-md);
    }
    
    .eeh-assessment-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    }
    
    .eeh-assessment-content {
        width: 100%;
        padding: var(--spacing-md);
    }
    
    .section-fields {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .nav-item {
        margin: 2px var(--spacing-sm);
        padding: 12px var(--spacing-md);
        font-size: 13px; /* Slightly smaller font for mobile */
    }
    
    .tab-content {
        padding: var(--spacing-md);
    }
}

@media (max-width: 768px) {
    .top-bar {
        flex-direction: column;
        height: auto;
        min-height: 44px;
        padding: var(--spacing-sm);
        gap: var(--spacing-sm);
    }
    
    .top-bar-left,
    .top-bar-center,
    .top-bar-right {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
    
    .top-bar-left {
        min-width: auto;
    }
    
    .top-bar-left .company-name {
        justify-content: center;
        font-size: 12px;
        letter-spacing: 0.6px;
    }
    
    .top-bar-right .tagline {
        font-size: 12px;
        padding: 4px 8px;
        white-space: normal;
        line-height: 1.3;
    }

    /* Keep the Home exit reachable on mobile: the right group wraps instead of
       squeezing the counter and the button onto one cramped line. */
    .top-bar-right {
        flex-wrap: wrap;
        gap: var(--spacing-sm);
    }

    .top-bar-exit-link {
        font-size: 12px;
        padding: 5px 12px;
    }

    .top-bar-home-link .company-name {
        font-size: 11px;
    }
    
    .top-bar-center .premium-badge {
        font-size: 10px;
        padding: 4px 8px;
        white-space: normal;
        line-height: 1.3;
        text-align: center;
    }
    
    .section-navigation {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .btn-next-tab,
    .btn-prev-tab,
    .btn-submit {
        width: 100%;
        padding: 14px;
    }
}

@media (max-width: 480px) {
    .tab-header h3 {
        font-size: 18px;
    }
    
    .tab-header p {
        font-size: 13px;
    }
    
    .form-field label {
        font-size: 13px;
    }
    
    .form-field input[type="text"],
    .form-field input[type="email"],
    .form-field input[type="tel"],
    .form-field input[type="number"],
    .form-field input[type="date"],
    .form-field select,
    .form-field textarea {
        font-size: 13px;
        padding: 8px 10px;
    }
}

/* ==========================================================================
   ACCESSIBILITY
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Focus styles for accessibility */
.form-field input[type="text"]:focus-visible,
.form-field input[type="email"]:focus-visible,
.form-field input[type="tel"]:focus-visible,
.form-field input[type="number"]:focus-visible,
.form-field input[type="date"]:focus-visible,
.form-field select:focus-visible,
.form-field textarea:focus-visible {
    outline: 2px solid var(--color-info);
    outline-offset: 2px;
}

.btn-next-tab:focus-visible,
.btn-prev-tab:focus-visible,
.btn-submit:focus-visible {
    outline: 2px solid var(--color-info);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .top-bar {
        border: 2px solid #000000;
    }
    
    .tab-content {
        border: 2px solid #000000;
    }
    
    .form-field input[type="text"],
    .form-field input[type="email"],
    .form-field input[type="tel"],
    .form-field input[type="number"],
    .form-field input[type="date"],
    .form-field select,
    .form-field textarea {
        border: 2px solid #000000;
    }
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */
@media print {
    .eeh-assessment-container {
        box-shadow: none;
        border: 1px solid #000000;
        background: #ffffff;
    }
    
    .top-bar {
        background: #000000 !important;
        color: #ffffff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .tab-content {
        background: #ffffff !important;
        color: #000000 !important;
        border: 1px solid #000000;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .nav-item {
        background: #f0f0f0 !important;
        color: #000000 !important;
        border: 1px solid #000000;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .btn-next-tab,
    .btn-prev-tab,
    .btn-submit {
        display: none;
    }
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }

.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }

.p-1 { padding: var(--spacing-sm); }
.p-2 { padding: var(--spacing-md); }
.p-3 { padding: var(--spacing-lg); }

.hidden {
    display: none !important;
}

.hidden-tab {
    display: none !important;
}

.hidden-field {
    display: none !important;
}

.visible {
    display: block !important;
}

/* ==========================================================================
   LOADING STATES
   ========================================================================== */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--color-text-on-dark);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   COMPLETION STATES
   ========================================================================== */
.completed .nav-item {
    background: rgba(16, 185, 129, 0.2) !important;
    border: 1px solid rgba(16, 185, 129, 0.5);
}

.completed .nav-icon::after {
    content: '✓';
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--color-success);
    color: white;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   IELTS ACADEMIC WARNING STYLES
   ========================================================================== */
.academic-warning {
    position: relative;
}

.academic-warning::after {
    content: '⚠️ Academic IELTS not counted for CRS';
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 50%, #b45309 100%);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.4);
    border: 1px solid rgba(245, 158, 11, 0.5);
}

.academic-border {
    border: 2px solid #f59e0b !important;
    background: rgba(245, 158, 11, 0.05) !important;
}

/* ==========================================================================
   DESTINATION CHOOSER (Tab 1)
   Card grid backed by a visually-hidden native <select name="target_country">.
   The select remains the source of truth (server contract + the country
   supplement tabs' conditionals), so this is pure progressive enhancement.
   Colours resolve through the theme tokens above — never hardcoded — so an
   admin palette change recolours the chooser instantly.
   ========================================================================== */

/* --------------------------------------------------------------------------
   ★ TABS CARRIED BY AN INLINE "html" FIELD MUST SPAN THE GRID.
   `.section-fields` is `repeat(3, 1fr)`. A tab whose whole body is one `html`
   field (currently Tab 1) placed that field in a SINGLE ~370px column while
   the other two thirds of the card sat empty — the "not balanced" report.

   `:has()` is the correct selector here because the class lives on a child of
   the field, not the field itself. Browsers without `:has()` fall back to the
   `.eeh-destinations-intro` rule below, which spans via the child instead, so
   the fix degrades instead of disappearing.
   -------------------------------------------------------------------------- */
.form-field:has(> .eeh-destinations-intro) {
    grid-column: 1 / -1;
    margin-bottom: 0;
    min-height: 0;
}

.eeh-destinations-intro {
    /* Fallback span for browsers without :has() — spans 1 column there, so the
       `:has()` rule above is what makes the layout correct; this keeps the
       block from being narrower than its own content meanwhile. */
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
    gap: var(--spacing-lg) var(--spacing-lg);
    align-items: start;
    text-align: left;
}

/* ---------- LEFT: the explanation ---------- */
.eeh-dest-intro-lead {
    min-width: 0;
}

/* Constrain the measure so lines do not run the full ~1160px card width.
   Long, edge-to-edge lines are the main reason a paragraph "reads as too much
   space" even when the word count is modest. */
.eeh-dest-intro-lead p {
    max-width: 62ch;
}

.eeh-dest-intro-eyebrow {
    display: inline-block;
    margin-bottom: 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    padding: 3px 10px;
}

/* The intro sits inside `.section-fields`, NOT `.tab-header`, so it inherits
   NONE of the heading styling and previously fell back to the browser default
   BLACK on the dark metallic gradient — effectively unreadable. It is styled
   explicitly here via the theme tokens. */
.eeh-destinations-intro h3 {
    margin: 0 0 var(--spacing-sm);
    font-size: 20px;
    font-weight: 700;
    line-height: var(--line-height-tight, 1.3);
    color: var(--color-text-on-dark, #ffffff);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.eeh-destinations-intro h4 {
    margin: 0 0 var(--spacing-sm);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.8);
}

.eeh-destinations-intro p {
    /* Loose enough to read comfortably, tight enough to stop the block
       sprawling: default 16px/normal was the "takes too much space" culprit. */
    margin: 0 0 10px;
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
}

.eeh-destinations-intro p:last-child {
    margin-bottom: 0;
}

.eeh-destinations-intro strong {
    color: var(--color-text-on-dark, #ffffff);
    font-weight: 700;
}

/* The "nothing is assumed" reassurance reads as a promise, so it is set apart
   rather than buried at the end of a paragraph. */
.eeh-dest-intro-reassure {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: var(--spacing-sm) !important;
    padding: 9px 12px;
    border-radius: 8px;
    border: 1px solid rgba(74, 222, 128, 0.3);
    border-left: 3px solid rgba(74, 222, 128, 0.75);
    background: rgba(74, 222, 128, 0.1);
    color: rgba(255, 255, 255, 0.94);
    font-size: 13px;
    line-height: 1.5;
}

.eeh-dest-intro-reassure > span {
    flex: 0 0 auto;
    color: #4ade80;
    font-weight: 700;
}

/* ---------- RIGHT: the concrete facts ---------- */
.eeh-dest-intro-facts {
    min-width: 0;
    padding: var(--spacing-md);
    border-radius: var(--card-radius);
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.06);
}

.eeh-dest-fact-list {
    margin: 0;
    padding: 0;
}

.eeh-dest-fact-list dt {
    display: flex;
    align-items: baseline;
    gap: 7px;
    font-size: 13px;
    font-weight: 700;
    color: var(--color-text-on-dark, #ffffff);
    line-height: 1.35;
}

.eeh-dest-fact-list dd {
    margin: 3px 0 12px;
    padding-left: 23px;
    font-size: 12.5px;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.82);
}

.eeh-dest-fact-list dd:last-child {
    margin-bottom: 0;
}

.eeh-dest-intro-note {
    margin-top: var(--spacing-md) !important;
    padding-top: var(--spacing-sm);
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    font-size: 12px !important;
    line-height: 1.55 !important;
    color: rgba(255, 255, 255, 0.7) !important;
}

/* Stack the spread on narrower viewports rather than crushing two columns. */
@media (max-width: 900px) {
    .eeh-destinations-intro {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--spacing-md);
    }

    .eeh-dest-intro-lead p {
        max-width: none;
    }
}

.eeh-destination-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--grid-gap);
    width: 100%;
}

.eeh-destination-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: var(--spacing-md);
    border-radius: var(--card-radius);
    border: 2px solid var(--color-border-dark);
    background: var(--color-surface);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.eeh-destination-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-hover-shadow);
}

.eeh-destination-card:focus-visible {
    outline: 3px solid var(--color-primary, #C2714A);
    outline-offset: 2px;
}

.eeh-destination-card.is-selected {
    border-color: var(--color-primary, #C2714A);
    box-shadow: var(--card-shadow);
}

.eeh-destination-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 24px;
    flex: 0 0 auto;
}

.eeh-destination-flag img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.eeh-destination-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-text-primary, #2c3e50);
    line-height: 1.2;
}

.eeh-destination-scoring {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-secondary, #64748b);
    line-height: 1.3;
}

.eeh-destination-scope {
    margin-top: 2px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 10px;
    background: rgba(100, 116, 139, 0.12);
    color: var(--color-text-secondary, #64748b);
}

.eeh-destination-scope.is-free {
    background: rgba(34, 197, 94, 0.15);
    color: #15803d;
}

.eeh-destination-scope.is-paid {
    background: rgba(194, 113, 74, 0.18);
    color: var(--color-primary-dark, #8a4b2a);
}

.eeh-destination-scope.is-none {
    background: rgba(100, 116, 139, 0.12);
    color: var(--color-text-secondary, #64748b);
}

/* Announcement line doubles as the visible confirmation of the choice. */
.eeh-destination-announce {
    margin-top: var(--spacing-sm);
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-secondary, #64748b);
    min-height: 16px;
}

.eeh-destination-announce:not(:empty)::before {
    content: '✓ ';
    color: #15803d;
}

/* The native select is visually hidden but still focusable/submittable; the
   cards carry the UI. When JS is unavailable the cards can't drive it, so we
   reveal the select instead of leaving a dead control. */
.eeh-destination-native {
    position: absolute !important;
}

@media (max-width: 640px) {
    .eeh-destination-grid {
        grid-template-columns: 1fr 1fr;
    }

    .eeh-destination-card {
        padding: var(--spacing-sm);
    }

    .eeh-destination-name {
        font-size: 13px;
    }

    .eeh-destination-scoring {
        font-size: 10px;
    }
}

@media (max-width: 400px) {
    .eeh-destination-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   END OF FILE
   ========================================================================== */
