/* assets/quiz.css -- Ayamveda Vitality Quiz
   Design language matches themes/ayam_new/lp-ired.php (same tokens, same
   pack-card and trust-badge shapes) so the quiz doesn't read as a separate
   product from the rest of the site. */
:root {
    --red:        #ea444e;
    --red-dark:   #c63038;
    --green:      #2e764e;
    --green-dark: #1a5e38;
    --green-tint: oklch(96% 0.03 155);
    --surface:      oklch(98.5% 0.005 145);
    --surface-alt:  oklch(96% 0.007 145);
    --text:         oklch(14% 0.012 145);
    --text-muted:   oklch(48% 0.012 145);
    --text-subtle:  oklch(60% 0.01 145);
    --border:       oklch(87% 0.009 145);
    --border-strong: oklch(78% 0.01 145);
    --r-sm: 8px;
    --r-md: 14px;
    --r-lg: 20px;
    --shadow-sm: 0 1px 2px oklch(20% 0.02 155 / 0.06);
    --shadow-md: 0 8px 24px oklch(20% 0.02 155 / 0.09);
    --f-head: 'Montserrat', system-ui, sans-serif;
    --f-body: 'DM Sans', system-ui, sans-serif;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body.quiz-ired {
    font-family: var(--f-body);
    color: var(--text);
    background: var(--surface);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
body.quiz-ired #site-header,
body.quiz-ired footer.site,
body.quiz-ired #colophon,
body.quiz-ired .promo-bar { display: none !important; }

img { display: block; max-width: 100%; }

/* -----------------------------------------------------------------------
   Layout
   ----------------------------------------------------------------------- */
.quiz-wrap { max-width: 560px; margin: 0 auto; padding: 32px 20px 100px; }

.quiz-header { text-align: center; margin-bottom: 10px; }
.quiz-logo { height: 34px; width: auto; margin: 0 auto 14px; }

.quiz-trust-line {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px 16px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text-subtle);
    margin-bottom: 28px;
}
.quiz-trust-line span { display: inline-flex; align-items: center; gap: 5px; }
.quiz-trust-line span::before {
    content: '';
    width: 12px; height: 12px;
    background: var(--green);
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6l3 3 5-5' stroke='%23fff' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-size: 100%;
    flex-shrink: 0;
}

/* -----------------------------------------------------------------------
   Progress -- a segmented step row reads as "quiz" more than a generic bar
   ----------------------------------------------------------------------- */
.quiz-progress { margin-bottom: 8px; }
.quiz-progress-steps { display: flex; gap: 5px; }
.quiz-progress-step {
    flex: 1;
    height: 4px;
    border-radius: 999px;
    background: var(--border);
    overflow: hidden;
}
.quiz-progress-step-fill {
    height: 100%;
    width: 0%;
    background: var(--green);
    border-radius: inherit;
    transition: width 0.5s var(--ease);
}
.quiz-progress-step.is-done .quiz-progress-step-fill { width: 100%; }
.quiz-progress-label {
    display: block;
    margin-top: 10px;
    font-family: var(--f-head);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-subtle);
}
.quiz-progress-label--done { color: var(--green); }

/* -----------------------------------------------------------------------
   Question
   ----------------------------------------------------------------------- */
.quiz-eyebrow {
    display: block;
    font-family: var(--f-head);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--green);
    margin: 28px 0 10px;
}
.quiz-question h2 {
    font-family: var(--f-head);
    font-size: clamp(21px, 5.5vw, 28px);
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 22px;
}

.quiz-options { display: flex; flex-direction: column; gap: 10px; }

.quiz-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    text-align: left;
    min-height: 44px;
    padding: 14px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--r-md);
    background: #fff;
    color: var(--text);
    font-family: var(--f-body);
    font-size: 15px;
    line-height: 1.45;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, transform 0.15s var(--ease);
    opacity: 0;
    animation: quiz-rise 0.4s var(--ease) forwards;
}
.quiz-options .quiz-option:nth-child(1) { animation-delay: 0.02s; }
.quiz-options .quiz-option:nth-child(2) { animation-delay: 0.07s; }
.quiz-options .quiz-option:nth-child(3) { animation-delay: 0.12s; }
.quiz-options .quiz-option:nth-child(4) { animation-delay: 0.17s; }
.quiz-options .quiz-option:nth-child(5) { animation-delay: 0.22s; }

.quiz-option-radio {
    flex-shrink: 0;
    width: 20px; height: 20px;
    border-radius: 50%;
    border: 1.5px solid var(--border-strong);
    position: relative;
}
.quiz-option-radio::after {
    content: '';
    position: absolute; inset: 3px;
    border-radius: 50%;
    background: var(--green);
    transform: scale(0);
    transition: transform 0.15s var(--ease);
}

.quiz-option:hover:not(:disabled) { border-color: var(--green); }
.quiz-option:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: 2px;
}
.quiz-option.is-selected {
    border-color: var(--green);
    background: var(--green-tint);
}
.quiz-option.is-selected .quiz-option-radio { border-color: var(--green); }
.quiz-option.is-selected .quiz-option-radio::after { transform: scale(1); }
.quiz-option:disabled:not(.is-selected) { opacity: 0.45; cursor: default; }

.quiz-feedback-icon {
    flex-shrink: 0;
    width: 18px; height: 18px;
    margin-top: 2px;
    color: var(--green);
}
.quiz-continue-btn {
    display: block;
    width: 100%;
    min-height: 44px;
    padding: 14px;
    background: var(--red);
    color: #fff;
    border: none;
    border-radius: var(--r-md);
    font-family: var(--f-head);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    opacity: 0;
    animation: quiz-rise 0.4s var(--ease) 0.1s forwards;
}
.quiz-continue-btn:hover { background: var(--red-dark); }
.quiz-continue-btn:active { transform: scale(0.99); }
.quiz-continue-btn:focus-visible { outline: 2px solid var(--red-dark); outline-offset: 2px; }

@keyframes quiz-rise {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* -----------------------------------------------------------------------
   Phone / OTP step
   ----------------------------------------------------------------------- */
.quiz-phone-row {
    display: flex;
    align-items: stretch;
    border: 1.5px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
    background: #fff;
    margin-bottom: 14px;
}
.quiz-phone-prefix {
    display: flex;
    align-items: center;
    padding: 0 14px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--surface-alt);
    border-right: 1.5px solid var(--border);
}
.quiz-phone-input {
    flex: 1;
    min-height: 44px;
    padding: 12px 14px;
    border: none;
    outline: none;
    font-family: var(--f-body);
    font-size: 16px;
    color: var(--text);
    background: transparent;
}
.quiz-phone-input:focus { background: var(--surface-alt); }

.quiz-otp-row { margin-top: 16px; }
.quiz-otp-label { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; }
.quiz-otp-input {
    width: 140px;
    min-height: 44px;
    padding: 10px 12px;
    font-family: 'DM Sans', monospace;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-align: center;
    border: 1.5px solid var(--border);
    border-radius: var(--r-md);
    color: var(--text);
    background: #fff;
    margin-bottom: 12px;
    display: block;
}
.quiz-otp-input:focus { outline: 2px solid var(--green); outline-offset: 1px; border-color: var(--green); }
.quiz-otp-msg { min-height: 18px; font-size: 13px; color: var(--red); margin-top: 8px; }
.quiz-otp-resend {
    background: none; border: none; padding: 0;
    font-size: 13px; color: var(--text-subtle);
    text-decoration: underline; cursor: pointer;
}
.quiz-reassurance { font-size: 13px; color: var(--text-subtle); margin-top: 16px; }

/* -----------------------------------------------------------------------
   Intro screen
   ----------------------------------------------------------------------- */
.quiz-intro-body {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-muted);
    max-width: 60ch;
    margin-bottom: 26px;
    opacity: 0;
    animation: quiz-rise 0.4s var(--ease) 0.05s forwards;
}

/* -----------------------------------------------------------------------
   Per-question insight screen
   ----------------------------------------------------------------------- */
.quiz-insight {
    margin-bottom: 22px;
    opacity: 0;
    animation: quiz-rise 0.4s var(--ease) 0.05s forwards;
}
.quiz-insight .quiz-feedback-icon {
    width: 26px;
    height: 26px;
    color: var(--green);
    margin-bottom: 14px;
}
.quiz-insight-lead {
    font-family: var(--f-head);
    font-size: clamp(18px, 4.5vw, 22px);
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 14px;
}
.quiz-insight-body {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-muted);
    max-width: 60ch;
}
.quiz-insight-credibility {
    font-size: 13px;
    font-style: italic;
    color: var(--text-subtle);
    margin-top: 14px;
    max-width: 60ch;
}

/* -----------------------------------------------------------------------
   Result
   ----------------------------------------------------------------------- */
.quiz-result h2 {
    font-family: var(--f-head);
    font-size: clamp(22px, 6vw, 30px);
    font-weight: 800;
    line-height: 1.22;
    margin-bottom: 14px;
}
.quiz-result h2 em { font-style: normal; color: var(--red); }
.quiz-result-mechanism {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-muted);
    max-width: 62ch;
    margin-bottom: 26px;
}

.quiz-pack-card {
    border: 2px solid var(--green);
    border-radius: var(--r-lg);
    background: var(--green-tint);
    padding: 22px;
    margin-bottom: 18px;
    position: relative;
}
.quiz-pack-tag {
    display: inline-block;
    font-family: var(--f-head);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fff;
    background: var(--green);
    border-radius: 999px;
    padding: 4px 12px;
    margin-bottom: 12px;
}
.quiz-pack-name { font-family: var(--f-head); font-size: 19px; font-weight: 800; margin-bottom: 4px; }
.quiz-pack-desc { font-size: 14px; color: var(--text-muted); margin-bottom: 14px; }
.quiz-pack-price {
    font-family: var(--f-head);
    font-size: clamp(26px, 6vw, 32px);
    font-weight: 800;
    color: var(--text);
}

.quiz-add-to-cart {
    display: block;
    width: 100%;
    min-height: 48px;
    padding: 16px;
    background: var(--red);
    color: #fff;
    border: none;
    border-radius: var(--r-md);
    font-family: var(--f-head);
    font-size: 17px;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    transition: background 0.15s;
}
.quiz-add-to-cart:hover { background: var(--red-dark); }
.quiz-add-to-cart:focus-visible { outline: 2px solid var(--red-dark); outline-offset: 2px; }

.quiz-alt-duration {
    display: block;
    text-align: center;
    font-size: 13px;
    color: var(--text-subtle);
    text-decoration: underline;
    margin-top: 14px;
}

.quiz-trust-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 32px;
}
.quiz-trust-badge {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12.5px;
    color: var(--text-muted);
    background: var(--surface-alt);
    border-radius: var(--r-sm);
    padding: 10px 12px;
}
.quiz-trust-badge svg { flex-shrink: 0; color: var(--green); margin-top: 1px; }

/* Sticky mobile checkout bar on the result screen */
.quiz-sticky-bar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    display: none;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: #fff;
    border-top: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    z-index: 40;
}
.quiz-sticky-bar-text { flex: 1; min-width: 0; }
.quiz-sticky-bar-name { display: block; font-size: 12px; color: var(--text-subtle); }
.quiz-sticky-bar-price { display: block; font-family: var(--f-head); font-size: 17px; font-weight: 800; }
.quiz-sticky-bar .quiz-add-to-cart { width: auto; flex-shrink: 0; padding: 12px 22px; font-size: 15px; }

@media (max-width: 640px) {
    .quiz-sticky-bar { display: flex; }
    .quiz-wrap { padding-bottom: 92px; }
}

/* -----------------------------------------------------------------------
   Error state (network / server failure)
   ----------------------------------------------------------------------- */
.quiz-error-message {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 20px;
    font-size: 15px;
    color: var(--text-muted);
    text-align: center;
}

@media (prefers-reduced-motion: reduce) {
    .quiz-option, .quiz-continue-btn, .quiz-intro-body, .quiz-insight { animation: none; opacity: 1; }
    .quiz-progress-step-fill { transition: none; }
}
