@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

/* Simplified HTML styles */
html {
    /* Removed scroll-behavior: auto !important; */
    /* Removed overflow-y: scroll; */
    /* Removed height: 100%; */
    font-size: 100%; /* Base font size */
    -webkit-text-size-adjust: 100%; /* Prevent font scaling in landscape */
     scroll-padding-top: 20px; /* Adjust scroll target position if needed */
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: #f4f4f4;
    min-height: 100vh; /* Use viewport height unit for full height */
    margin: 0;
    padding: 30px 15px;
    box-sizing: border-box;
    color: #333;
    overflow-x: hidden; /* Prevent horizontal scroll */
    /* Let body handle vertical scroll naturally */
    /* Removed overflow-y: auto; - default is visible/auto which is usually fine */
    display: flex; /* Helps with centering container */
    flex-direction: column; /* Ensure content flows vertically */
    align-items: center; /* Center the quiz container */
}

#quiz-container {
    background-color: #fff;
    padding: 30px 35px 45px 35px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 700px;
    /* Removed margin: 0 auto; as body flex handles centering */
    margin-top: 0; /* Adjust top margin if needed */
    margin-bottom: 30px; /* Add some space at the bottom */
    text-align: center;
    box-sizing: border-box;
}

/* --- Rest of your CSS --- */
/* (Keep all other styles from the previous version, */
/*  including logo, progress bar, steps, buttons, etc.) */

/* Logo */
#quiz-logo { display: block; max-width: 170px; height: auto; margin: 0 auto 25px auto; }

/* Progress Bar */
#progress-container {
    width: 100%;
    background-color: #e9ecef;
    border-radius: 25px;
    margin-bottom: 30px;
    position: relative; /* Crucial for absolute positioning of children/pseudo-elements */
    overflow: hidden; /* Already there, good */
    height: 25px;
    /* We'll use this variable to control the clipping */
    --progress-width: 0%;
}#progress-bar {
    height: 100%;
    width: var(--progress-width); /* Use the CSS variable */
    background-color: #007bff;
    border-radius: 25px;
    transition: width 0.5s ease-in-out;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1; /* Ensure bar is above container background */
}

/* Original Progress Text (Dark) - Keep z-index below the overlay */
#progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    font-size: 0.85em;
    color: #444; /* Dark color for the background part */
    /* Removed text-shadow as it might interfere visually */
    z-index: 2; /* Above the bar background */
    font-weight: 600;
    white-space: nowrap;
    width: 100%; /* Ensure it spans the container for centering */
    text-align: center; /* Explicitly center */
    pointer-events: none; /* Make it non-interactive */
}

#progress-container::before {
    content: attr(data-text); /* Get text from parent's data attribute */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    height: 100%; /* Match container height */
    width: 100%; /* Match container width */
    font-size: 0.85em; /* Match original text */
    font-weight: 600; /* Match original text */
    color: #ffffff; /* Contrasting color (white) */
    display: flex; /* Use flex to center content vertically */
    align-items: center; /* Vertical centering */
    justify-content: center; /* Horizontal centering */
    z-index: 3; /* Above the original text AND the progress bar */
    white-space: nowrap; /* Prevent wrapping */
    pointer-events: none; /* Make it non-interactive */
    user-select: none; /* Prevent text selection */

    /* The magic: Clip this layer based on the progress bar's width */
    clip-path: inset(0 calc(100% - var(--progress-width, 0%)) 0 0);

    /* Smooth transition for the clipping effect */
    transition: clip-path 0.5s ease-in-out;
}

/* Ensure the text itself doesn't overflow its clipped container visually */
#progress-container::before span { /* If text content is wrapped */
   display: inline-block;
}

/* Step Styling */
.quiz-step { display: none; animation: fadeIn 0.4s ease-out; margin-top: 20px; }
.quiz-step.active-step { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Question Text */
.question-text { font-size: 1.4em; color: #333; margin-bottom: 15px; font-weight: 600; }
.sub-text { font-size: 1.05em; color: #555; margin-top: 0px; margin-bottom: 25px; }

/* Options Container */
.options-container { margin-bottom: 25px; display: flex; gap: 15px; }
.options-container.vertical { flex-direction: column; align-items: stretch; }
.options-container.horizontal { flex-direction: row; justify-content: center; gap: 25px; }

/* Radio Button Labels */
.options-container label {
    display: block;
    background-color: #f8f9fa;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 15px 20px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    text-align: left;
    font-size: 1em;
    position: relative;
    font-weight: 500;
    /* Add these for better text wrapping */
    word-wrap: break-word; /* Older browsers */
    overflow-wrap: break-word; /* Standard property */
    hyphens: auto; /* Optional: allow hyphenation for smoother breaks (needs lang="en" on <html>) */
    line-height: 1.4; /* Ensure adequate line spacing when wrapped */
}
.options-container label:hover { background-color: #e9ecef; border-color: #bbb; }
.options-container input[type="radio"] {
    margin-right: 10px;
    vertical-align: top; /* Align radio with the top of the text */
    margin-top: 0.2em; /* Adjust slightly for better alignment */
    accent-color: #007bff;
}
.options-container label.selected { background-color: #e2f0ff; border-color: #007bff; font-weight: 600; }

/* Input Fields */
.input-container { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 5px; }
.input-container input[type="number"] { padding: 12px 15px; border: 1px solid #ccc; border-radius: 6px; font-size: 1.1em; width: 120px; text-align: center; transition: border-color 0.2s ease; font-family: 'Montserrat', sans-serif; }
.input-container input[type="number"]:focus { outline: none; border-color: #007bff; }
.input-container span { font-size: 1em; color: #555; font-weight: 500; }
.error-message { color: #dc3545; font-size: 0.9em; min-height: 1.2em; margin-bottom: 20px; font-weight: 500; }

/* Next Buttons (Quiz Steps) */
.next-button { padding: 14px 35px; color: white; border: none; border-radius: 8px; cursor: pointer; font-size: 1.1em; font-weight: 600; transition: background 0.25s ease, opacity 0.2s ease; margin-top: 10px; display: inline-block; background: linear-gradient(180deg, #55b718, #3fa707); font-family: 'Montserrat', sans-serif; }
.next-button:hover:not(:disabled) { background: linear-gradient(180deg, #4aa314, #369106); }
.next-button:disabled { background-image: none; background-color: #cccccc; cursor: not-allowed; opacity: 0.65; }

/* CTA Button (Results Page) */
.cta-button { padding: 16px 40px; background: linear-gradient(180deg, #4aa314, #369106); color: white; border: none; border-radius: 6px; cursor: pointer; font-size: 1.3em; font-weight: 700; transition: background-color 0.2s ease; margin-top: 20px; display: inline-block; text-transform: uppercase; letter-spacing: 0.5px; font-family: 'Montserrat', sans-serif; }
.cta-button:hover { background-color: #45b800; }

/* Info Step */
.info-step p { font-size: 1.05em; color: #444; line-height: 1.6; margin-bottom: 20px; background-color: #eef2f7; padding: 15px 20px; border-left: 4px solid #007bff; border-radius: 4px; text-align: left; }

/* Analyzing Step */
#analyzing-step { text-align: center; padding: 45px 0; min-height: 200px; }
#analyzing-step p { font-size: 1.25em; color: #555; margin-bottom: 25px; font-weight: 500; }
.loader { border: 5px solid #f0f0f0; border-top: 5px solid #007bff; border-radius: 50%; width: 45px; height: 45px; animation-name: spin; animation-duration: 1.3s; animation-timing-function: linear; animation-iteration-count: infinite; margin: 25px auto 30px auto; display: inline-block; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Results Page */
#results-page h2 { color: #333; margin-bottom: 15px; font-weight: 700; }
#results-page h3 { color: #444; margin-bottom: 15px; font-weight: 600; }
.projection-text { font-size: 1.2em; color: #333; margin-bottom: 30px; background-color: #e9f5ff; padding: 15px 20px; border-radius: 6px; font-weight: 500; }
.projection-text strong { color: #0056b3; font-weight: 700; }

/* CanvasJS Chart Container */
#chartContainer { border-radius: 8px; border: 1px solid #e0e5ec; margin-bottom: 35px; }

/* Comparison Section */
.comparison-section {
    display: flex;
    gap: 20px; /* Keep the gap between columns */
    margin-bottom: 40px;
    background-color: #f8f9fa;
    /* Add horizontal padding to squeeze the columns */
    padding: 25px 35px; /* Increased horizontal padding */
    border-radius: 8px;
}.column { flex: 1; text-align: center; }
.column h3 { font-size: 1.3em; margin-bottom: 10px; font-weight: 600; }
.weight-display { font-size: 1.5em; font-weight: 700; color: #007bff; margin-bottom: 15px; display: block; }
.body-image { max-width: 80%; height: auto; margin: 10px auto 15px auto; display: block; }
.body-fat { font-size: 0.95em; color: #555; font-weight: 500; }

/* Product Section */
.product-section { border-top: 1px solid #eee; border-bottom: 1px solid #eee; padding: 35px 0; margin-bottom: 35px; }
.brand-logo { max-width: 150px; margin-bottom: 15px; }
.offer-text { font-size: 1.3em; color: #dc3545; font-weight: 600; margin-bottom: 20px; }
.offer-text strong { font-size: 1.2em; font-weight: 700; }
.product-image { max-width: 300px; height: auto; margin-bottom: 20px; border-radius: 6px; }
.pricing { font-size: 1.4em; margin-bottom: 10px; font-weight: 500; }
.old-price { text-decoration: line-through; color: #888; margin-right: 15px; font-size: 0.75em; }
.new-price { color: #28a745; font-weight: 700; }
.pack-note { font-size: 0.9em; color: #666; margin-bottom: 25px; max-width: 400px; margin-left: auto; margin-right: auto; }
.guarantee-text { font-weight: 600; color: #333; margin-top: 15px; font-size: 1.0em; }

/* Social Proof */
.social-proof { margin-bottom: 30px; font-size: 1.1em; }
.social-proof p { margin: 5px 0; font-weight: 500; }
.star-inline { width: 16px; height: auto; vertical-align: -2px; margin-left: 2px; }

/* Testimonials */
.testimonials { margin-top: 30px; margin-bottom: 35px; border: 1px solid #eee; padding: 15px 25px; border-radius: 8px; background-color: #fdfdff; text-align: left; }
.testimonials h3 { margin-top: 0; margin-bottom: 20px; text-align: center; font-size: 1.3em; font-weight: 600; color: #444; }
.testimonial { background-color: #fff; border: 1px solid #eee; border-radius: 6px; padding: 15px; margin-bottom: 15px; }
.testimonial p:first-child { margin: 0 0 8px 0; font-size: 1em; font-weight: 600; }
.testimonial p strong { color: #333; }
.testimonial .verified { font-size: 0.85em; color: #777; margin-left: 8px; font-weight: 500; }
.testimonial blockquote { margin: 0; font-size: 0.95em; color: #555; line-height: 1.6; font-style: normal; padding-left: 12px; border-left: 3px solid #f0f0f0; font-weight: 400; }

/* Responsive */
@media (max-width: 700px) {
    /* This rule is likely correct for stacking options vertically */
    .options-container.horizontal { flex-direction: column; gap: 15px; }

    /* Corrected rule for comparison section to keep columns side-by-side */
    .comparison-section {
        /* REMOVED flex-direction: column; */
        padding: 20px 15px; /* Keep padding adjustment */
        gap: 10px;          /* Keep gap adjustment */
    }

    /* REMOVED these column margin rules as they are for stacked layout */
    /* .column { margin-bottom: 25px; } */
    /* .column:last-child { margin-bottom: 0; } */

    /* These rules are likely fine for general mobile adjustments */
    .pricing { font-size: 1.3em; }
    .question-text { font-size: 1.4em; }
    .cta-button { font-size: 1.3em; padding: 16px 35px; }
    .next-button { font-size: 1.15em; padding: 13px 30px; }
}

/* The (max-width: 400px) block is fine and will inherit the side-by-side layout */
@media (max-width: 400px) {
   .comparison-section {
        padding: 15px 10px;
        gap: 8px;
   }
    .column h3 {
       font-size: 1em;
    }
    .weight-display {
       font-size: 1.1em;
    }
}
@media (max-width: 500px) {
     #quiz-container { padding: 25px 20px 40px 20px; }
     .options-container label { padding: 14px 18px; }
     .input-container input[type="number"] { width: 100px; padding: 12px 15px; }
     .projection-text { font-size: 1.15em; padding: 15px 20px; }
     .testimonials { padding: 15px 15px; }
     #progress-text { font-size: 0.8em; }
}

/* Add these styles to your existing quiz-style.css */

/* Styling for the new engagement step */
.engagement-step p {
    /* Inherits from .info-step, but you can override */
    text-align: center; /* Center text elements */
    max-width: 550px; /* Limit text width for readability */
    margin-left: auto;
    margin-right: auto;
}

.engagement-step p strong {
    color: #0056b3; /* Highlight key phrases */
}
#step-4 .video-wrapper { /* Add this class to the video's outer div in HTML */
    width: 100%;
    max-width: 480px; /* Or your preferred max width */
    margin: 20px auto 25px auto; /* Center it */
    border-radius: 8px; /* Optional: add border radius */
    overflow: hidden; /* Ensure iframe respects border radius */
    box-shadow: 0 4px 10px rgba(0,0,0,0.1); /* Optional shadow */
}