/* --- Global Resets and Dark Theme Variables --- */
html {
    box-sizing: border-box;
    scroll-behavior: smooth;
}
*, *:before, *:after {
    box-sizing: inherit;
    margin: 0;
    padding: 0;
}

:root {
    --font-primary: 'Poppins', sans-serif;
    
    --bg-main: #1A1E2C; /* Dark Desaturated Blue/Charcoal */
    --bg-survey-container-solid: #23283B; /* A solid slightly lighter dark for container */
    --bg-card: rgba(50, 56, 77, 0.6); /* Glassmorphism card bg (slightly more opaque) */
    --bg-card-border: rgba(125, 137, 181, 0.2); /* Softer border for glass cards */
    --bg-input: rgba(30, 34, 48, 0.7); /* Darker input background */

    --text-primary: #EAEAEA; /* Slightly brighter Light Gray */
    --text-secondary: #B0B0B0; /* Lighter Medium Gray */
    --text-headings: #FFFFFF;
    
    --accent-orange: #FF7A00; /* BBQ/CTA */
    --accent-green: #3DDA7C; /* Produce/Success */
    --accent-yellow: #FFD24D; /* Flowers/Highlight */

    --progress-segment-empty: #32384D; /* Darker empty segment */
    --progress-segment-filled: var(--accent-orange);

    --button-glow-orange: 0 0 8px var(--accent-orange), 0 0 16px var(--accent-orange), 0 0 24px rgba(255, 122, 0, 0.4);
    --button-glow-green: 0 0 8px var(--accent-green), 0 0 16px var(--accent-green), 0 0 24px rgba(61, 218, 124, 0.4);
    --button-glow-yellow: 0 0 8px var(--accent-yellow), 0 0 16px var(--accent-yellow), 0 0 24px rgba(255, 210, 77, 0.4);
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-main);
    color: var(--text-primary);
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start; 
    min-height: 100vh;
    padding-top: 70px; 
    padding-bottom: 75px; 
}

/* --- Sticky Header --- */
.sticky-survey-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: rgba(20, 23, 36, 0.85); 
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 10px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5); 
    z-index: 1010;
    display: flex;
    align-items: center;
    justify-content: center; 
}
.header-logo {
    height: 35px; 
    width: auto;
}
.header-title { 
    font-size: 1.4em;
    color: var(--text-headings);
    font-weight: 600;
}


/* --- Survey Container & Sections --- */
.survey-container {
    background-color: var(--bg-survey-container-solid); 
    padding: 0; 
    border-radius: 12px; 
    box-shadow: 0 8px 30px rgba(0,0,0,0.3); 
    width: 100%;
    max-width: 700px; 
    margin: 20px; 
}

.survey-sections-wrapper {
    padding: 20px; 
}

.survey-section {
    display: none; 
    padding: 20px 0; 
    border-bottom: 1px solid var(--bg-card-border); 
}
.survey-section:last-of-type {
    border-bottom: none;
}
.survey-section.active-section {
    display: block; 
}

/* --- Typography --- */
h1, h2 {
    color: var(--text-headings);
    text-align: center;
    font-weight: 600;
}
.welcome-title {
    font-size: 2.2em;
    margin-bottom: 15px;
}
h2 { 
    font-size: 1.8em;
    margin-bottom: 30px;
    margin-top: 10px; 
}
.tagline {
    font-size: 1.3em;
    color: var(--accent-yellow); 
    text-align: center;
    margin-bottom: 20px;
    font-weight: 500;
}
.description {
    font-size: 1em;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 25px;
    line-height: 1.7;
}
.sub-heading {
    font-size: 1.4em;
    color: var(--accent-yellow);
    text-align: center;
    margin-top: 30px;
    margin-bottom: 15px;
    font-weight: 600;
}

/* --- Hero Image --- */
.hero-image { 
    display: block;
    margin: 25px auto 35px auto;
    max-width: 100%; 
    height: auto;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* --- Question Cards (Glassmorphism) --- */
.question-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--bg-card-border);
    padding: 20px; 
    margin-bottom: 20px; 
    border-radius: 8px; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); 
}
.question-card label { 
    display: block;
    font-weight: 500; 
    margin-bottom: 15px;
    color: var(--text-primary);
    font-size: 1.05em; 
}
.question-description {
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-bottom: 15px; /* Space before options */
    line-height: 1.5;
    font-weight: 400;
}

/* --- Options (Radio/Checkbox) --- */
.options {
    display: grid; 
    grid-template-columns: auto 1fr; 
    gap: 10px 8px; 
    align-items: center; 
}
.options input[type="radio"],
.options input[type="checkbox"] {
    margin-right: 0; /* Grid gap handles spacing, was 8px before grid */
    justify-self: start; 
    accent-color: var(--accent-orange); 
    width: 1.1em; 
    height: 1.1em;
    cursor: pointer;
    position: relative; 
    vertical-align: middle; /* Retained for good measure, though grid align-items should handle */
}
.options label { /* Text label for an option */
    font-weight: 400; 
    margin-bottom: 0; /* Grid gap handles spacing, was 8px */
    display: block; /* Was flex, align-items:center. Grid cell handles alignment. */
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s ease;
    padding: 5px 0; 
}
.options input[type="radio"]:checked + label,
.options input[type="checkbox"]:checked + label,
.options label:hover {
    color: var(--text-primary);
}

/* --- Form Fields (Text, Select, Textarea) --- */
.form-field {
    margin-bottom: 20px;
}
.form-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}
.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="tel"],
.form-field input[type="password"],
.form-field select,
textarea {
    width: 100%; 
    padding: 10px 12px;
    background-color: var(--bg-input);
    border: 1px solid var(--bg-card-border);
    border-radius: 5px;
    font-size: 0.95em;
    color: var(--text-primary);
    font-family: var(--font-primary);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.form-field input[type="text"]:focus,
.form-field input[type="email"]:focus,
.form-field input[type="tel"]:focus,
.form-field input[type="password"]:focus,
.form-field select:focus,
textarea:focus {
    border-color: var(--accent-orange);
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 122, 0, 0.25); 
}
.form-field select {
    appearance: none; 
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23A0A0A0' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E"); 
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 0.9em;
}
textarea {
    resize: vertical;
    min-height: 90px;
}

/* --- Buttons --- */
button, .nav-button, .cta-button, .submit-button { 
    padding: 10px 20px;
    border: 1px solid transparent; 
    border-radius: 6px;
    font-size: 0.95em;
    font-weight: 600; 
    font-family: var(--font-primary);
    cursor: pointer;
    transition: all 0.25s ease-out;
    text-align: center;
    letter-spacing: 0.5px;
}
.cta-button, .sticky-button-footer #global-next-btn:not(.prev-section-btn):not(.submit-button) { 
    background-color: var(--accent-orange);
    color: white;
    border-color: var(--accent-orange);
}
.cta-button:hover, .sticky-button-footer #global-next-btn:not(.prev-section-btn):not(.submit-button):hover {
    background-color: #FF8C00; 
    transform: translateY(-2px);
    box-shadow: var(--button-glow-orange);
}
.prev-section-btn {
    background-color: var(--bg-input); 
    color: var(--text-secondary);
    border-color: var(--bg-card-border);
}
.prev-section-btn:hover {
    background-color: #3B425D; 
    color: var(--text-primary);
    border-color: var(--text-secondary);
}
.submit-button { 
    background-color: var(--accent-green);
    color: white;
    border-color: var(--accent-green);
}
.submit-button:hover {
    background-color: #35A56A; 
    transform: translateY(-2px);
    box-shadow: var(--button-glow-green);
}


/* --- Sticky Button Footer --- */
.sticky-button-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(20, 23, 36, 0.85); 
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 12px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.4);
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}
.sticky-button-footer .nav-button { 
    flex-grow: 1; 
    margin: 0; 
}

@media (min-width: 769px) { 
    .sticky-button-footer {
        justify-content: center; 
    }
    .sticky-button-footer .nav-button {
        flex-grow: 0; 
        width: auto; 
        min-width: 150px; 
        max-width: 220px; 
    }
    
    .progress-bar-container {
        padding-left: 50px; 
        padding-right: 50px; 
    }
}


/* --- Segmented Progress Bar --- */
.progress-bar-container {
    width: 100%;
    display: flex; 
    gap: 4px; 
    margin: 20px 0 30px 0; 
    height: 6px; 
    border-radius: 3px;
    display: none; 
}
.progress-segment {
    flex-grow: 1; 
    height: 100%;
    background-color: var(--progress-segment-empty); 
    border-radius: 3px;
    transition: background-color 0.4s ease-in-out; 
}
.progress-segment.segment-filled {
    background-color: var(--progress-segment-filled); 
}


/* --- Completion Screen --- */
#completion-screen { text-align: center; padding-bottom: 20px; }
.completion-content .thank-you-message {
    font-size: 2.2em;
    color: var(--accent-green);
    margin-bottom: 15px;
}
.completion-content p {
    font-size: 1em;
    color: var(--text-secondary);
    margin-bottom: 10px;
    line-height: 1.6;
}
.badge-container { margin: 25px 0; }
.badge {
    display: inline-block;
    padding: 10px 20px;
    background: linear-gradient(45deg, var(--accent-orange), var(--accent-yellow));
    color: var(--bg-main);
    font-size: 1.1em;
    font-weight: 600;
    border-radius: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.confetti-container {
    position: relative; 
    height: 120px; 
    margin-bottom: 15px;
    overflow: hidden; 
}
.social-link {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 18px;
    background-color: var(--accent-yellow);
    color: #1A1E2C; 
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.95em;
    font-weight: 600;
    transition: all 0.25s ease-out;
}
.social-link:hover {
    background-color: #FFC800; 
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--button-glow-yellow);
}

/* --- Custom Modal Styles --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); 
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: none; 
    align-items: center;
    justify-content: center;
    z-index: 2000; 
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}
.modal-overlay.modal-active {
    display: flex;
    opacity: 1;
}
.modal-content {
    background-color: var(--bg-survey-container-solid); 
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.4);
    text-align: center;
    max-width: 400px;
    width: 90%;
    border: 1px solid var(--bg-card-border);
    transform: scale(0.95);
    transition: transform 0.3s ease-in-out;
}
.modal-overlay.modal-active .modal-content {
    transform: scale(1);
}
.modal-text {
    font-size: 1.1em;
    color: var(--text-primary);
    margin-bottom: 25px;
    line-height: 1.6;
    white-space: pre-line; 
}
.modal-button {
    background-color: var(--accent-orange);
    color: white;
    padding: 10px 25px;
    border-radius: 6px;
    border: none;
    font-family: var(--font-primary);
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}
.modal-button:hover {
    background-color: #FF8C00; 
    box-shadow: var(--button-glow-orange);
}


/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    body {
        padding-top: 60px; 
        padding-bottom: 70px; 
    }
    .sticky-survey-header { padding: 10px 15px; }
    .header-logo { height: 30px; }
    .header-title { font-size: 1.2em; }

    .survey-container {
        margin: 0; 
        border-radius: 0;
        padding: 15px; 
        box-shadow: none;
        background-color: var(--bg-main); 
    }
    .survey-sections-wrapper { padding: 10px 5px; } 

    .welcome-title { font-size: 1.6em; } 
    h2 { font-size: 1.3em; margin-bottom: 20px; }  
    .sub-heading { font-size: 1.0em; margin-top: 20px; } 
    .tagline { font-size: 1em; } 
    .description { font-size: 0.9em; } 

    .question-card {
        padding: 15px; 
        background-color: rgba(44, 48, 64, 0.75); 
        backdrop-filter: blur(8px); 
        -webkit-backdrop-filter: blur(8px);
    }
    .question-card label { font-size: 0.95em; }
    .options { gap: 8px 6px; }
    .options input[type="radio"], .options input[type="checkbox"] { width: 1em; height: 1em; }
    .options label { font-size: 0.9em; }


    .sticky-button-footer { padding: 10px; gap: 8px; }
    button, .nav-button, .cta-button, .submit-button { font-size: 0.9em; padding: 10px 12px; }

    .modal-content { padding: 20px; max-width: 90%; }
    .modal-text { font-size: 1em; margin-bottom: 20px; }
    .modal-button { padding: 8px 20px; font-size: 0.9em;}
}

@media (max-width: 480px) {
    body {
        padding-top: 50px; 
        padding-bottom: 65px; 
    }
    .sticky-survey-header { padding: 8px 10px; }
    .header-logo { height: 24px; }
    .header-title { font-size: 1em; }
    
    .welcome-title { font-size: 1.4em; }
    h2 { font-size: 1.1em; } 
    .sub-heading { font-size: 0.85em; } 
    .tagline { font-size: 0.9em; }
    .description { font-size: 0.85em; }

    .question-card { padding: 12px; margin-bottom: 15px; }
    .question-card label { font-size: 0.9em; }
    .options label { font-size: 0.85em; }

    .form-field input, .form-field select, textarea { font-size: 0.85em; padding: 8px 10px; }
    button, .nav-button, .cta-button, .submit-button { font-size: 0.85em; }
}
