:root {
    --primary: #2e4ed2;
    --primary-light: #5c7af0;
    --primary-dark: #1a2f96;
    --secondary: #f5a5b8;
    --secondary-hover: #fcdde6;
    --bg-color: #f8fafc;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --white: #ffffff;
    --shadow: 0 10px 40px -10px rgba(46, 78, 210, 0.15);
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: 1px solid rgba(255, 255, 255, 0.8);
    --radius: 20px;
    --font-family: 'Outfit', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    background-image:
        radial-gradient(circle at 10% 20%, rgba(46, 78, 210, 0.08) 0%, transparent 25%),
        radial-gradient(circle at 90% 80%, rgba(92, 122, 240, 0.08) 0%, transparent 25%);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    overflow-x: hidden;
}

#app {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 100vh;
    position: relative;
    padding-bottom: 80px;
    /* Space for footer/scroll */
}

/* Common Layouts */
.container {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: var(--glass-border);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    margin-bottom: 24px;
    position: relative;
    z-index: 10;
}

h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
    line-height: 1.3;
    font-weight: 600;
}

p {
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.headline {
    text-align: center;
}

.subheadline {
    font-weight: 500;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}

/* Buttons */
.btn {
    display: block;
    width: 100%;
    padding: 18px 20px;
    border: none;
    border-radius: 16px;
    background: var(--white);
    color: var(--text-color);
    font-size: 1.05rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    margin-bottom: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-color: var(--primary-light);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    text-align: center;
    font-size: 1.15rem;
    box-shadow: 0 10px 25px -5px rgba(46, 78, 210, 0.4);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 15px 30px -5px rgba(46, 78, 210, 0.5);
    border-color: transparent;
}

.btn.selected {
    border-color: var(--primary);
    background-color: #eff6ff;
    /* Light blue */
    color: var(--primary);
}

/* Inputs */
input[type="text"] {
    width: 100%;
    padding: 18px;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    font-size: 1.1rem;
    margin-bottom: 24px;
    transition: 0.3s;
    outline: none;
    background: #f8fafc;
}

input[type="text"]:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(46, 78, 210, 0.1);
}

/* Checkbox Style */
.checkbox-option {
    display: flex;
    align-items: center;
    padding: 16px;
    background: var(--white);
    border-radius: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.checkbox-option:hover {
    background: #f8fafc;
    transform: translateY(-1px);
}

.checkbox-option.checked {
    border-color: var(--primary);
    background-color: #eff6ff;
}

.checkbox-visual {
    width: 24px;
    height: 24px;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    margin-right: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    flex-shrink: 0;
}

.checkbox-option.checked .checkbox-visual {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-visual::after {
    content: '✓';
    color: white;
    font-size: 14px;
    font-weight: bold;
    display: none;
}

.checkbox-option.checked .checkbox-visual::after {
    display: block;
}


/* Animations */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes progressFill {
    from {
        width: 0%;
    }

    to {
        width: 100%;
    }
}

/* Progress Bar */
.progress-container {
    width: 100%;
    height: 8px;
    background-color: #e2e8f0;
    border-radius: 10px;
    margin-bottom: 30px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: var(--primary);
    border-radius: 10px;
    transition: width 0.5s ease;
}

/* Specific Page Styles */
.hero-image {
    width: 100%;
    border-radius: var(--radius);
    margin-bottom: 24px;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.benefits-list li,
.social-proof-list li {
    list-style: none;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.05rem;
}

.icon {
    font-size: 1.2rem;
    color: var(--primary);
}

/* Loading Screen */
.loading-screen {
    text-align: center;
    padding: 60px 20px;
}

.loading-bar-container {
    height: 12px;
    background: #e2e8f0;
    border-radius: 6px;
    margin: 30px 0;
    overflow: hidden;
}

.loading-bar-fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
    animation: progressFill 10s linear forwards;
}

/* Results */
.result-box {
    background: #eff6ff;
    border: 1px solid var(--primary-light);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

/* Badge for boxes */
.result-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
}

.diagram {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 24px 0;
    font-weight: bold;
}

.sleep-scale {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 24px;
    background: linear-gradient(to right, #ef4444, #f59e0b, #2e4ed2);
    /* Red -> Orange -> Blue */
    border-radius: 12px;
    position: relative;
    margin: 30px 0;
}

.scale-marker {
    position: absolute;
    top: -40px;
    left: 10%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    box-shadow: 0 4px 10px rgba(46, 78, 210, 0.3);
    font-weight: bold;
}

.scale-marker::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--primary);
}

/* Footer elements */
.trust-footer {
    display: flex;
    justify-content: space-around;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 30px;
    border-top: 1px solid #e2e8f0;
    padding-top: 20px;
    font-weight: 500;
}

.testimonial-card {
    background: white;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    margin: 16px 0;
    font-style: italic;
    border: 1px solid #f1f5f9;
}

video,
.video-placeholder,
iframe {
    width: 100%;
    border-radius: 16px;
    margin-bottom: 20px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(46, 78, 210, 0.7);
    }

    70% {
        box-shadow: 0 0 0 20px rgba(46, 78, 210, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(46, 78, 210, 0);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

html {
    scroll-behavior: smooth;
}

.button-activated {
    animation: pulse 1.5s infinite;
    background: #22c55e !important;
    /* Green color */
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.6) !important;
}

.timer-display {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 10px;
    background: #f1f5f9;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.price-box {
    margin-top: 20px;
    padding: 15px 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #f9f9f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.price-box span:first-child {
    color: #333;
    font-weight: 500;
}

.price-box span:last-child {
    color: #2d7a5f;
    font-weight: bold;
    font-size: 16px;
}

.fade-in-element {
    animation: fadeIn 0.5s ease-in forwards;
}

/* Mobile first approach (Adjustment 1) */
@media (max-width: 768px) {

    /* Reduce general padding */
    .quiz-container,
    #app {
        padding: 16px 12px;
        /* reduced from 20px to 16px */
        padding-bottom: 80px;
        /* keep bottom space */
    }

    /* Reduce element spacing */
    .container {
        padding: 20px 16px;
        /* reduced internal padding */
    }

    /* Adjust font sizes */
    h1,
    .headline {
        font-size: 1.5rem;
        /* reduced from 1.8rem */
    }

    h2,
    .subheadline {
        font-size: 1.25rem;
        /* reduced from 1.5rem */
    }

    p {
        font-size: 0.95rem;
    }

    /* Reduce button heights */
    .btn {
        padding: 12px 16px;
        /* reduced from 18px 20px */
        font-size: 0.95rem;
        /* reduced from 1.05rem */
        min-height: 50px;
        /* touch friendly */
    }

    .btn-primary {
        padding: 14px 16px;
        font-size: 1rem;
    }

    /* Ensure multiple choice options fit without scroll */
    .options-container {
        gap: 8px;
        /* reduced gap */
    }

    .checkbox-option {
        padding: 10px 12px;
        margin-bottom: 8px;
    }

    .checkbox-visual {
        width: 20px;
        height: 20px;
        margin-right: 12px;
    }

    input[type="text"] {
        padding: 14px;
    }
}

/* Tablets */
@media (min-width: 769px) and (max-width: 1024px) {

    /* Keep larger spacing than mobile */
    .quiz-container,
    #app {
        padding: 20px 16px;
    }
}

/* Desktop */
@media (min-width: 1025px) {

    /* Keep original spacing */
    .quiz-container,
    #app {
        padding: 20px 24px;
    }
}

/* VSL Specific Styles */
.fade-in-vsl {
    animation: fadeInVSL 0.6s ease-in forwards;
}

@keyframes fadeInVSL {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.checkout-section {
    opacity: 0;
    /* Updated by JS animation */
    margin-top: 30px;
    text-align: center;
    padding: 20px;
    display: none;
    /* Initially hidden */
}

/* Ensure display:block overrides display:none when JS acts */
.checkout-section.visible {
    display: block;
    opacity: 1;
}

.btn-checkout {
    display: inline-block;
    padding: 14px 32px;
    background-color: #2d7a5f;
    /* Green */
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    width: 100%;
    /* Make full width on mobile default */
    max-width: 400px;
}

.btn-checkout:hover {
    background-color: #1f5a45;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 122, 95, 0.3);
}

.price-box-vsl {
    padding: 15px 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #f9f9f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    max-width: 400px;
    margin: 0 auto;
}

.price-box-vsl span:first-child {
    color: #333;
    font-weight: 500;
}

.price-box-vsl span:last-child {
    color: #2d7a5f;
    font-weight: bold;
    font-size: 16px;
}

.vsl-content-delayed {
    opacity: 0;
    transition: opacity 0.6s ease-in;
    display: none;
}