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

/* --- BASE & BODY STYLES --- */
html {
    font-size: 100%;
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: 20px;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: #f4f4f4;
    min-height: 100vh;
    margin: 0;
    padding: 30px 15px;
    box-sizing: border-box;
    color: #333;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- 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;
    margin-top: 0;
    margin-bottom: 30px;
    text-align: center;
    box-sizing: border-box;
}

/* --- 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;
    overflow: hidden;
    height: 25px;
    --progress-width: 0%; /* CSS Variable for progress */
}

#progress-bar {
    height: 100%;
    width: var(--progress-width);
    background-color: #007bff;
    border-radius: 25px;
    transition: width 0.5s ease-in-out;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* Base text (behind the clipped text) */
#progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    font-size: 0.85em;
    color: #444;
    z-index: 2;
    font-weight: 600;
    white-space: nowrap;
    width: 100%;
    text-align: center;
    pointer-events: none;
}

/* Clipped text (overlay) */
#progress-container::before {
    content: attr(data-text);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    height: 100%;
    width: 100%;
    font-size: 0.85em;
    font-weight: 600;
    color: #ffffff; /* White text */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3; /* Above base text and bar */
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
    clip-path: inset(0 calc(100% - var(--progress-width, 0%)) 0 0);
    transition: clip-path 0.5s ease-in-out;
}

#progress-container::before span { /* Prevent potential wrapping issues */
   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 & Sub-text */
.question-text {
    font-size: 1.4em;
    color: #333;
    margin-bottom: 25px; /* Increased margin */
    font-weight: 600;
}
.sub-text {
    font-size: 1.05em;
    color: #555;
    margin-top: -15px; /* Pull closer to question */
    margin-bottom: 25px;
}

/* --- OPTIONS CONTAINER & BUTTON-LIKE RADIO STYLES --- */
.options-container {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column; /* Force column layout */
    align-items: stretch; /* Labels take full width */
    gap: 12px; /* Space between options */
}

/* Force horizontal containers to also stack vertically for this style */
.options-container.horizontal {
     flex-direction: column;
     align-items: stretch;
     gap: 12px;
}

/* 1. HIDE THE ACTUAL RADIO INPUT */
.options-container input[type="radio"] {
    opacity: 0;
    position: absolute;
    left: -9999px; /* Move way off-screen */
    width: 1px;
    height: 1px;
    overflow: hidden;
    margin: 0;
    padding: 0;
    border: none;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

/* 2. STYLE THE LABEL AS THE BUTTON */
.options-container label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 16px 20px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    text-align: left;
    font-size: 1.05em;
    font-weight: 500;
    color: #343a40;
    width: 100%;
    box-sizing: border-box;
    position: relative; /* Needed for pseudo-element */
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
    /* Remove margin-bottom here if using gap on container */
}

/* 3. ADD THE ARROW INDICATOR */
.options-container label::after {
    content: '→';
    font-size: 1.4em;
    font-weight: bold;
    color: #adb5bd; /* Muted color */
    margin-left: 15px;
    transition: color 0.2s ease, transform 0.2s ease;
}

/* 4. HOVER STATE */
.options-container label:hover {
    background-color: #f1f3f5;
    border-color: #ced4da;
}
.options-container label:hover::after {
    color: #495057; /* Darker arrow */
    transform: translateX(3px); /* Slight move */
}

/* 5. SELECTED STATE (Using :checked + label) */
.options-container input[type="radio"]:checked + label {
    background-color: #e7f5ff; /* Light blue selected */
    border-color: #007bff;
    color: #0056b3;
    font-weight: 600;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.options-container input[type="radio"]:checked + label::after {
    color: #007bff; /* Blue arrow */
    transform: translateX(0); /* Reset hover transform */
}

/* REMOVE this rule - it's no longer needed with the :checked selector */
/*
.options-container label.selected { ... }
.options-container label.selected::after { ... }
*/
/* --- END OPTIONS STYLING --- */


/* --- INPUT FIELDS (Height, Weight) --- */
.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; /* Prevent layout shifts */
    margin-bottom: 20px;
    font-weight: 500;
}

/* --- BUTTONS (Next, CTA) --- */
/* Next Buttons (Quiz Steps 4, 5, 6, 7, 8) */
.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 { /* Should not be needed if validation works */
    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; /* Simpler hover */
}

/* --- INFO & ENGAGEMENT STEPS --- */
/* General Info Step paragraph style */
.info-step p:not([style*="font-size: 0.8em"]) { /* Exclude disclaimer */
    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;
}
/* Specific styles for Engagement step (Step 4) paragraphs */
.engagement-step p:not(.pack-note):not([style*="font-size: 0.8em"]) { /* Exclude specific paragraphs */
    text-align: center;
    max-width: 550px;
    margin-left: auto;
    margin-right: auto;
    background-color: transparent; /* Remove default info background */
    border-left: none; /* Remove default info border */
    padding-left: 0; /* Reset padding */
    padding-right: 0;
}
.engagement-step p strong {
    color: #0056b3; /* Highlight */
}
/* Special highlighted paragraph in engagement step */
.engagement-step p[style*="background-color: #e9f5ff"] {
    background-color: #e9f5ff !important; /* Ensure override */
    padding: 12px !important;
    border-radius: 5px !important;
    border-left: none !important;
    text-align: center !important;
}
/* Disclaimer */
.engagement-step p[style*="font-size: 0.8em"] {
     margin-top: -20px;
     margin-bottom: 25px;
     font-style: italic;
     color: #888;
     text-align: center;
     /* Remove conflicting info styles */
     background-color: transparent;
     border-left: none;
     padding: 0;
}
/* Video Wrapper */
#step-4 .video-wrapper {
    width: 100%;
    max-width: 480px;
    margin: 20px auto 25px auto;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
/* Body image on Step 8 */
#step-8 .body-image {
    max-width: 80%; height: auto; margin: 10px auto 15px auto; display: block;
}


/* --- 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: spin 1.3s linear 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;
    /* Add overflow hidden if chart sometimes exceeds bounds */
    /* overflow: hidden; */
}

/* Comparison Section */
.comparison-section {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
    background-color: #f8f9fa;
    padding: 25px 35px;
    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; /* Relative size */
    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;
    line-height: 1.5;
}
.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 styling might need adjustment */
/* .star-inline { ... } */

/* 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 { /* Name + Verified */
    margin: 0 0 8px 0;
    font-size: 1em;
    font-weight: 600;
    display: flex; /* Align items */
    justify-content: space-between; /* Push verified text right */
    align-items: center;
}
.testimonial p strong { /* Name */
    color: #333;
}
.testimonial .verified {
    font-size: 0.85em;
    color: #777;
    /* margin-left: 8px; */ /* No longer needed with flex */
    font-weight: 500;
    white-space: nowrap; /* Prevent wrapping */
}
.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 STYLES --- */
@media (max-width: 700px) {
    /* Options container already forced column, this might be redundant */
    /* .options-container.horizontal { flex-direction: column; gap: 12px; } */

    /* Comparison section remains side-by-side */
    .comparison-section { padding: 20px 15px; gap: 10px; }

    /* General mobile adjustments */
    .pricing { font-size: 1.3em; }
    .question-text { font-size: 1.3em; } /* Slightly smaller */
    .cta-button { font-size: 1.2em; padding: 15px 30px; } /* Adjust CTA */
    .next-button { font-size: 1.05em; padding: 12px 28px; } /* Adjust Next */
}

@media (max-width: 500px) {
     #quiz-container { padding: 25px 20px 40px 20px; }
     .options-container label { padding: 14px 18px; font-size: 1em; } /* Adjust padding/font */
     .options-container label::after { font-size: 1.3em; } /* Adjust arrow */
     .input-container input[type="number"] { width: 100px; padding: 11px 12px; font-size: 1em; }
     .projection-text { font-size: 1.1em; padding: 14px 18px; }
     .testimonials { padding: 15px 15px; }
     #progress-text, #progress-container::before { font-size: 0.8em; }
     .question-text { font-size: 1.25em; }
     .cta-button { font-size: 1.15em; padding: 14px 25px; }
}

@media (max-width: 400px) {
   .comparison-section { padding: 15px 10px; gap: 8px; }
   .column h3 { font-size: 1em; }
   .weight-display { font-size: 1.1em; }
   .product-image { max-width: 250px; }
   .options-container label { padding: 12px 15px; font-size: 0.95em; }
   .options-container label::after { font-size: 1.2em; }
}