/* style.css - COMPLETELY REWRITTEN FOR NANO UI FIDELITY */

/* --- CSS Variables for Color Palette --- */
:root {
    --deep-onyx: #0C0C0C;
    --accent-gold: #D3A628;
    --secondary-brown: #3B2F2F;
    --tech-highlight-teal: #00C2A8;
    --ivory-sand: #F5E2E9;
    
    /* RGB values for rgba() for convenience */
    --deep-onyx-rgb: 12, 12, 12;
    --accent-gold-rgb: 211, 166, 40;
    --tech-highlight-teal-rgb: 0, 194, 168;
    --ivory-sand-rgb: 245, 226, 233;
    
    /* GOLD GRADIENT FOR BORDERS (from Image 1 ideal) */
    --gold-gradient-css: linear-gradient(
        90deg,
        rgba(211, 166, 40, 1) 0%,
        rgba(235, 190, 70, 1) 30%,
        rgba(255, 220, 120, 1) 50%, /* Lighter center for glow effect */
        rgba(235, 190, 70, 1) 70%,
        rgba(211, 166, 40, 1) 100%
    );
    --gold-border-thickness: 3px;
    --card-border-radius: 25px;
    --header-border-radius: 15px;
}

/* --- Base Styles --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    /* Cool dark background - using blue-grey to prevent gold tint */
    background: #0a0a0f;
    background-attachment: fixed;
    color: var(--ivory-sand);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding-top: 40px;
    box-sizing: border-box;
    overflow-x: hidden;
}

.container {
    width: 90%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    gap: 20px; /* REDUCED GAP: Vertical space between main card and feature cards */
    align-items: center;
}

/* --- Header --- */
.header {
    width: 100%;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    box-sizing: border-box;
    border-radius: var(--header-border-radius);
    /* PURE SILVER GLASSMORPHISM - Cool grey with subtle silver tint */
    background: 
        linear-gradient(135deg, rgba(200, 210, 220, 0.08) 0%, rgba(20, 25, 30, 0.3) 100%);
    backdrop-filter: blur(20px) saturate(0%) brightness(1.15) contrast(1.1);
    -webkit-backdrop-filter: blur(20px) saturate(0%) brightness(1.15) contrast(1.1);
    overflow: hidden;
    isolation: isolate; /* Creates stacking context for backdrop-filter */
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(160, 170, 180, 0.25),
        inset 0 0 25px rgba(200, 210, 220, 0.15);
}

/* Gold gradient border for header */
.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    border-radius: var(--header-border-radius);
    padding: var(--gold-border-thickness);
    background: var(--gold-gradient-css);
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    box-shadow: 0 0 10px rgba(var(--accent-gold-rgb), 0.4);
    pointer-events: none;
}

.logo {
    font-weight: 700;
    font-size: 1.8em;
    color: var(--accent-gold);
    position: relative;
    padding-bottom: 5px;
}

.logo::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background-color: var(--tech-highlight-teal);
    box-shadow: 0 0 8px var(--tech-highlight-teal);
    opacity: 0.7;
}

.main-nav {
    display: flex;
    align-items: center;
}

.main-nav .nav-link {
    color: var(--ivory-sand);
    text-decoration: none;
    margin-left: 25px;
    font-weight: 400;
    font-size: 0.95em;
    transition: color 0.3s ease;
}

.main-nav .nav-link:hover {
    color: var(--accent-gold);
}

.powered-by {
    color: rgba(var(--ivory-sand-rgb), 0.7);
    font-weight: 400;
    font-size: 0.9em;
    letter-spacing: 0.5px;
}

/* --- Unified Main Card --- */
.unified-card {
    width: 100%;
    display: flex;
    position: relative;
    min-height: 480px;
    align-items: stretch;
    border-radius: var(--card-border-radius);
    overflow: hidden;
    flex-direction: row;
    /* PURE SILVER GLASSMORPHISM - Cool grey with subtle silver tint */
    background: 
        linear-gradient(135deg, rgba(200, 210, 220, 0.1) 0%, rgba(20, 25, 30, 0.25) 100%);
    backdrop-filter: blur(25px) saturate(0%) brightness(1.15) contrast(1.1);
    -webkit-backdrop-filter: blur(25px) saturate(0%) brightness(1.15) contrast(1.1);
    isolation: isolate; /* Creates stacking context for backdrop-filter */
    box-shadow: 
        0 12px 48px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(160, 170, 180, 0.3),
        inset 0 0 35px rgba(200, 210, 220, 0.18);
}

/* Gold gradient border for unified card */
.unified-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    border-radius: var(--card-border-radius);
    padding: var(--gold-border-thickness);
    background: var(--gold-gradient-css);
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    box-shadow: 0 0 15px rgba(var(--accent-gold-rgb), 0.6);
    pointer-events: none;
}

.card-section {
    padding: 40px; /* This is the internal spacing for content */
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow-y: hidden;
    box-sizing: border-box;
    /* Transparent background to show parent's glassmorphism effect */
    background: transparent;
    position: relative;
    z-index: 1;
}

.left-section {
    justify-content: space-between;
}

.right-section {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    /* Use min-height as base, will be overridden by media queries */
    min-height: 400px;
    overflow: hidden; /* Clean up any overlapping elements */
}

/* Transitioning Content Wrapper - anchors the absolute children */
.survey-stage-wrapper {
    position: relative;
    width: 100%;
    /* Use min-height to reserve space but allow growth */
    min-height: 500px;
    margin-bottom: 20px;
}

/* All Flow States - Question and Results views */
.flow-state {
    position: absolute; /* KEY: Decouples from flow and locks position */
    top: 0;
    left: 0;
    width: 100%;
    /* Use min-height instead of fixed height to allow content to flow naturally */
    min-height: 100%;
    /* Opacity for fading */
    opacity: 0;
    visibility: hidden;
    pointer-events: none; /* Prevents interaction when hidden */
    transition: opacity 0.4s ease-in-out, visibility 0.4s ease-in-out;
    z-index: 1;
    /* Allow content to be visible */
    overflow: visible;
}

.flow-state.active {
    z-index: 2; /* Active state should be on top */
    opacity: 1;
    visibility: visible;
    pointer-events: auto; /* Re-enable interaction when active */
}

.headline {
    font-size: 2.8em;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 15px;
    color: var(--ivory-sand);
}

.gold-highlight {
    color: var(--accent-gold);
}

.sub-headline {
    font-size: 1.05em;
    font-weight: 400;
    margin-bottom: 30px;
    color: var(--ivory-sand);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cta-text {
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--ivory-sand);
}

.waitlist-form {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    align-items: center;
}

.email-input {
    flex-grow: 1;
    padding: 15px 20px;
    border: 1px solid rgba(var(--accent-gold-rgb), 0.5);
    border-radius: 10px;
    background: rgba(var(--deep-onyx-rgb), 0.6);
    color: var(--ivory-sand);
    font-size: 1em;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    font-family: 'Inter', sans-serif;
    min-width: 150px;
}

.email-input::placeholder {
    color: rgba(var(--ivory-sand-rgb), 0.6);
}

.email-input:focus {
    outline: none;
    border-color: var(--tech-highlight-teal);
    box-shadow: 0 0 10px rgba(var(--tech-highlight-teal-rgb), 0.5);
}

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--accent-gold);
    font-family: 'Inter', sans-serif;
}

.primary-btn {
    background-color: var(--tech-highlight-teal);
    color: var(--deep-onyx);
    box-shadow: 0 0 15px rgba(var(--tech-highlight-teal-rgb), 0.4);
}

.primary-btn:hover {
    background-color: #00B29A;
    box-shadow: 0 0 20px rgba(var(--tech-highlight-teal-rgb), 0.6);
}

.primary-btn:disabled {
    background-color: rgba(var(--tech-highlight-teal-rgb), 0.5);
    cursor: not-allowed;
    box-shadow: none;
}

.value-prop-text {
    font-size: 1.15em;
    line-height: 1.6;
    color: var(--ivory-sand);
    margin-top: auto;
    margin-bottom: 0;
}

/* --- Survey Section --- */
.survey-prompt {
    font-size: 1.4em;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--accent-gold);
    line-height: 1.3;
    text-align: left;
    letter-spacing: 0.3px;
}

.section-label {
    font-size: 1.6em;
    font-weight: 700;
    margin-bottom: 20px;
    margin-top: 0;
    color: var(--ivory-sand);
}

.survey-content {
    display: flex;
    flex-direction: column;
}

.survey-question {
    font-size: 1em;
    margin-bottom: 20px;
    line-height: 1.4;
    color: var(--ivory-sand);
}

.survey-question-text {
    font-size: 1.05em;
    margin-bottom: 25px;
    line-height: 1.5;
    color: var(--ivory-sand);
    font-weight: 400;
}

.question-label {
    font-size: 1.1em;
    margin-bottom: 25px;
    line-height: 1.4;
    color: var(--ivory-sand);
    display: block;
    font-weight: 600;
}

.survey-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
    flex-grow: 1;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.radio-option {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 0.95em;
    color: var(--ivory-sand);
    position: relative;
    padding-left: 30px;
    line-height: 1.3;
}

.radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.custom-radio {
    position: absolute;
    left: 0;
    top: 2px;
    height: 20px;
    width: 20px;
    background-color: rgba(var(--ivory-sand-rgb), 0.2);
    border-radius: 50%;
    border: 2px solid var(--ivory-sand);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.radio-option input[type="radio"]:checked + .custom-radio {
    background-color: var(--tech-highlight-teal);
    border-color: var(--tech-highlight-teal);
    box-shadow: 0 0 8px rgba(var(--tech-highlight-teal-rgb), 0.5);
}

.radio-option input[type="radio"]:checked + .custom-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--deep-onyx);
}

.survey-form {
    display: flex;
    flex-direction: column;
    /* Remove min-height that's pushing content down */
    height: auto;
    overflow: visible;
}

.right-section .submit-btn {
    margin-top: 0; /* No gap - button directly below content */
    width: fit-content;
    min-width: 150px;
    max-width: 250px;
    align-self: flex-end;
    box-sizing: border-box;
}

/* Button state: Next Question (countdown mode) */
.submit-btn.next-state {
    /* Visual distinction for countdown state */
    cursor: pointer;
    transition: all 0.2s ease;
}

.submit-btn.next-state:hover {
    /* Slight visual feedback on hover during countdown */
    opacity: 0.9;
    transform: scale(1.02);
}

/* --- Messages --- */
.message {
    margin-top: 15px;
    padding: 12px 20px;
    border-radius: 10px;
    text-align: center;
    font-weight: 500;
    font-size: 0.95em;
    display: none;
}

.message.success {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.5);
    display: block;
}

.message.error {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.5);
    display: block;
}

.message.info {
    background: rgba(var(--tech-highlight-teal-rgb), 0.2);
    color: var(--tech-highlight-teal);
    border: 1px solid rgba(var(--tech-highlight-teal-rgb), 0.5);
    display: block;
}

.loading {
    text-align: center;
    color: rgba(var(--ivory-sand-rgb), 0.7);
    font-style: italic;
    padding: 20px;
    font-size: 1em;
}

/* --- Live Results Display - Compact Design --- */
.results-subtitle {
    font-size: 0.88em;
    color: rgba(var(--ivory-sand-rgb), 0.8);
    margin-bottom: 20px;
}

.results-display {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 22px;
    flex-grow: 1;
}

.result-item {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 10px;
    font-size: 0.92em;
    color: var(--ivory-sand);
}

.option-label {
    grid-column: 1 / 2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.percentage {
    grid-column: 2 / 3;
    font-weight: 600;
    min-width: 40px;
    text-align: right;
    color: var(--tech-highlight-teal);
    font-size: 0.98em;
}

.bar-container {
    grid-column: 1 / -1;
    width: 100%;
    height: 7px;
    background-color: rgba(var(--deep-onyx-rgb), 0.5);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 5px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--tech-highlight-teal), rgba(var(--tech-highlight-teal-rgb), 0.8));
    border-radius: 4px;
    transition: width 0.5s ease-out;
    box-shadow: 0 0 7px rgba(var(--tech-highlight-teal-rgb), 0.45);
}

/* --- Feature Cards --- */
.feature-cards {
    width: 100%; /* Ensure it spans full width of container */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Adjusted for square cards */
    gap: 25px; /* Gap between individual feature cards */
    box-sizing: border-box; /* Include padding in width */
    margin-top: 35px;
    margin-bottom: 35px;
    justify-items: center; /* Center cards in grid cells */
}

.feature-card {
    position: relative;
    padding: 35px 25px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    aspect-ratio: 1 / 1;
    max-width: 320px;
    min-height: 280px;
    box-sizing: border-box;
    border-radius: var(--card-border-radius);
    overflow: hidden;
    /* PURE SILVER GLASSMORPHISM - Cool grey with subtle silver tint */
    background: 
        linear-gradient(135deg, rgba(200, 210, 220, 0.08) 0%, rgba(20, 25, 30, 0.25) 100%);
    backdrop-filter: blur(20px) saturate(0%) brightness(1.15) contrast(1.1);
    -webkit-backdrop-filter: blur(20px) saturate(0%) brightness(1.15) contrast(1.1);
    isolation: isolate; /* Creates stacking context for backdrop-filter */
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(160, 170, 180, 0.25),
        inset 0 0 20px rgba(200, 210, 220, 0.15);
}

/* Gold gradient border for feature cards */
.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    border-radius: var(--card-border-radius);
    padding: var(--gold-border-thickness);
    background: var(--gold-gradient-css);
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    box-shadow: 0 0 10px rgba(var(--accent-gold-rgb), 0.3); /* Outer glow for feature cards */
    pointer-events: none;
}

.feature-card .icon-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: 10px;
    margin-bottom: 20px;
    flex-shrink: 0;
    position: relative;
}

/* Style SVG icons to match your theme */
.feature-card .icon-container svg {
    width: 48px;
    height: 48px;
    display: block;
    margin: auto;
    /* Apply subtle teal glow using CSS filter */
    filter: drop-shadow(0 0 8px rgba(0, 194, 168, 0.6));
    transition: filter 0.3s ease, transform 0.3s ease;
}

/* Enhanced glow on hover */
.feature-card:hover .icon-container svg {
    filter: drop-shadow(0 0 12px rgba(0, 194, 168, 0.8));
    transform: scale(1.05);
}

.feature-card .card-title {
    font-size: 1.3em;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 14px;
    color: var(--ivory-sand);
    flex-shrink: 0;
}

.feature-card .card-description {
    font-size: 0.95em;
    line-height: 1.6;
    color: var(--ivory-sand);
    margin-top: 0;
    margin-bottom: 0;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Question Number Indicator --- */
.question-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(var(--accent-gold-rgb), 0.2);
}

.question-number {
    font-size: 0.9em;
    font-weight: 600;
    color: var(--accent-gold);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* --- Responsive Adjustments --- */
@media (max-width: 900px) {
    .unified-card {
        flex-direction: column;
        min-height: auto;
    }

    .left-section {
        border-right: none;
        border-bottom: 1px solid rgba(var(--accent-gold-rgb), 0.2);
    }

    .right-section .submit-btn {
        align-self: center;
        width: fit-content;
    }

    .waitlist-form {
        flex-direction: column;
    }

    .email-input {
        width: 100%;
    }

    .primary-btn.waitlist-btn {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .header {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }

    .main-nav {
        margin-top: 10px;
    }

    .main-nav .nav-link {
        margin: 0 10px;
    }

    .headline {
        font-size: 2em;
    }

    .section-label {
        font-size: 1.5em;
    }

    .card-section {
        padding: 25px;
    }

    /* Mobile: Fixed height to prevent jitter, account for button space */
    .right-section {
        height: 650px !important; /* Increased to fit all questions without cutting off */
        overflow: visible !important; /* Allow content to be visible */
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
    }
    
    .survey-stage-wrapper {
        position: relative !important; /* KEY: Stage anchor - fixed reference point for absolute children */
        height: calc(100% - 80px) !important; /* Fixed height - leave space for button */
        min-height: 400px !important; /* Minimum height for content to be visible */
        max-height: calc(100% - 80px) !important; /* Leave space for button */
        margin-bottom: 8px !important; /* Reduced gap before button - moved button up */
        overflow: hidden !important; /* Remove scrolling at wrapper level */
        width: 100%; /* Full width */
    }
    
    /* Ensure flow states use absolute positioning for smooth stage swap on mobile */
    .flow-state {
        position: absolute !important; /* KEY: Remove from document flow - stage swap */
        top: 0 !important; /* Anchor to same position */
        left: 0 !important; /* Anchor to same position */
        width: 100% !important; /* Full width */
        height: 100% !important; /* Fill wrapper height */
        min-height: 100% !important; /* At least fill wrapper */
        max-height: 100% !important; /* Don't exceed wrapper */
        overflow: visible !important; /* Allow content to be visible */
        /* Keep base opacity/visibility from .flow-state class - don't override */
    }
    
    .flow-state.active {
        position: absolute !important; /* KEY: Remove from document flow - stage swap */
        top: 0 !important; /* Anchor to same position */
        left: 0 !important; /* Anchor to same position */
        width: 100% !important; /* Full width */
        height: 100% !important; /* Fill wrapper height */
        min-height: 100% !important; /* At least fill wrapper */
        max-height: 100% !important; /* Don't exceed wrapper */
        overflow: visible !important; /* Allow content to be visible */
        opacity: 1 !important; /* Ensure visible */
        visibility: visible !important; /* Ensure visible */
        pointer-events: auto !important; /* Enable interaction */
        z-index: 2 !important; /* Ensure on top */
    }
    
    /* Reduce spacing in survey form to fit better on mobile */
    .survey-form {
        height: auto !important; /* Let content determine height */
        overflow: visible !important; /* Allow content to be visible */
        display: flex !important;
        flex-direction: column !important;
        min-height: 0 !important; /* Remove min-height constraint */
    }
    
    /* Ensure survey question content is visible */
    .survey-question {
        overflow: visible !important;
        height: auto !important;
    }
    
    /* Ensure survey content is visible on mobile but constrained */
    .survey-content {
        overflow: visible !important; /* Allow content to be visible */
        height: auto !important; /* Let content determine height */
        min-height: 0 !important; /* Remove min-height constraint */
        display: flex !important;
        flex-direction: column !important;
    }
    
    /* Constrain results display on mobile to prevent expansion */
    .results-display {
        overflow-y: auto !important; /* Allow scrolling within results if needed */
        max-height: 100% !important; /* Don't exceed parent */
        flex: 1 1 auto !important; /* Take available space */
        min-height: 0 !important; /* Allow shrinking */
        gap: 12px !important; /* Comfortable gap between results */
        margin-bottom: 15px !important; /* Space before button */
    }
    
    /* Better spacing for mobile survey elements */
    .section-label {
        margin-bottom: 20px !important; /* Space after title */
    }
    
    .question-header {
        margin-bottom: 15px !important; /* Space after question number */
    }
    
    .survey-question-text {
        margin-bottom: 20px !important; /* Space after question text */
        line-height: 1.4 !important; /* Tighter line height for mobile */
    }
    
    .survey-options {
        gap: 12px !important; /* Comfortable gap between options */
        margin-bottom: 20px !important; /* Space before button */
    }
    
    .survey-question {
        margin-bottom: 0 !important; /* Remove extra margin */
    }
    
    /* Ensure button is visible on mobile with proper spacing */
    .right-section .submit-btn {
        margin-top: 50px !important; /* Increased margin to move button down */
        margin-bottom: 0 !important;
        display: block !important;
        position: relative !important;
        flex-shrink: 0 !important; /* Don't shrink button */
        align-self: center !important; /* Center button on mobile */
        width: fit-content !important;
        min-width: 150px !important;
        max-width: 250px !important;
        order: 999 !important; /* Ensure button is after content */
    }

    .waitlist-form {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .radio-option {
        font-size: 0.9em;
    }

    .bar-container {
        grid-column: 1 / -1;
        margin-top: 10px;
        margin-bottom: 5px;
    }
}

/* --- Footer --- */
.footer {
    width: 100%;
    margin-top: 60px;
    padding: 40px 0 25px;
    border-top: 1px solid rgba(var(--accent-gold-rgb), 0.2);
    background: transparent;
}

.footer-content {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 25px;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-logo {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--accent-gold);
    position: relative;
    padding-bottom: 5px;
}

.footer-logo::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background-color: var(--tech-highlight-teal);
    box-shadow: 0 0 8px var(--tech-highlight-teal);
    opacity: 0.7;
}

.footer-tagline {
    font-size: 0.9em;
    color: rgba(var(--ivory-sand-rgb), 0.7);
    font-weight: 400;
    margin: 0;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 15px;
}

.footer-link {
    color: rgba(var(--ivory-sand-rgb), 0.7);
    text-decoration: none;
    font-size: 0.9em;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: var(--accent-gold);
}

.footer-separator {
    color: rgba(var(--ivory-sand-rgb), 0.4);
    font-size: 0.9em;
}

.footer-bottom {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 20px;
    border-top: 1px solid rgba(var(--accent-gold-rgb), 0.1);
    text-align: center;
}

.footer-copyright {
    color: rgba(var(--ivory-sand-rgb), 0.6);
    font-size: 0.85em;
    margin: 0;
}

@media (max-width: 600px) {
    .footer {
        padding: 30px 0 20px;
        margin-top: 40px;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .footer-links {
        justify-content: center;
    }
}

/* Desktop Viewport Specific Fix (Targeting screens above 768px) */
@media (min-width: 769px) {
    /* Desktop: Fixed height to prevent jitter, account for button space */
    .right-section {
        height: 520px !important; /* Increased to fit content + button */
        overflow: hidden !important; /* Prevent scrolling */
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
    }
    
    .survey-stage-wrapper {
        height: calc(100% - 70px) !important; /* Leave space for button */
        margin-bottom: 10px !important; /* Small gap before button */
        overflow: hidden !important; /* Prevent scrolling */
        min-height: 0 !important; /* Remove min-height constraint */
    }
    
    /* Ensure flow states fit within wrapper */
    .flow-state {
        height: 100% !important;
        overflow: hidden !important;
        min-height: 0 !important;
    }
    
    .flow-state.active {
        height: 100% !important;
        overflow: hidden !important;
        min-height: 0 !important;
    }
    
    /* Reduce spacing in survey form to fit better */
    .survey-form {
        height: 100% !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
    }
    
    .survey-question-text {
        margin-bottom: 15px !important; /* Reduced spacing */
    }
    
    .survey-options {
        gap: 10px !important; /* Reduced gap between options */
        margin-bottom: 15px !important; /* Reduced bottom margin */
    }
    
    .question-header {
        margin-bottom: 10px !important; /* Reduced spacing */
    }
    
    /* Constrain results display to prevent expansion during loading */
    .survey-content {
        overflow: hidden !important; /* Prevent content from expanding container */
        height: 100% !important; /* Fill parent height */
        max-height: 100% !important; /* Don't exceed parent */
        display: flex !important;
        flex-direction: column !important;
    }
    
    .results-display {
        overflow-y: auto !important; /* Allow scrolling within results if needed */
        max-height: 100% !important; /* Don't exceed parent */
        flex: 1 1 auto !important; /* Take available space but don't grow beyond */
        min-height: 0 !important; /* Allow shrinking */
        gap: 10px !important; /* Reduced gap to fit better */
        margin-bottom: 10px !important; /* Reduced margin */
    }
    
    /* Ensure result items don't cause expansion */
    .result-item {
        flex-shrink: 0 !important; /* Don't shrink individual items */
    }
    
    /* Ensure button is visible and positioned correctly */
    .right-section .submit-btn {
        margin-top: 10px !important;
        margin-bottom: 0 !important;
        display: block !important;
        position: relative !important;
        flex-shrink: 0 !important; /* Don't shrink button */
        align-self: flex-end !important;
    }
}
