/* ============================================================
   Diwali Moments — Components
   ============================================================ */

/* ---------------- Buttons ---------------- */
.btn {
    --btn-bg: var(--gold);
    --btn-fg: var(--navy);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    min-height: 52px;
    padding: 0.85rem 1.8rem;
    font-size: var(--fs-body);
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--btn-fg);
    background: var(--btn-bg);
    border: 2px solid transparent;
    border-radius: var(--radius-pill);
    transition: transform var(--dur-fast) var(--ease),
                box-shadow var(--dur-fast) var(--ease),
                background var(--dur-fast) var(--ease),
                color var(--dur-fast) var(--ease),
                opacity var(--dur-fast) var(--ease);
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-gold); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

.btn--primary { --btn-bg: var(--gold); --btn-fg: var(--navy); }
.btn--primary:hover { --btn-bg: var(--yellow); }

/* Begin: a touch larger, uppercase, as in the mockup */
.btn--begin {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding-inline: 2.6rem;
    align-self: center;
}

/* Ghost (Back): quiet, outlined */
.btn--ghost {
    --btn-bg: transparent;
    --btn-fg: var(--white);
    border-color: rgba(255, 255, 255, 0.4);
}
.btn--ghost:hover { --btn-bg: rgba(255, 255, 255, 0.1); box-shadow: none; }

/* Next: gold text + chevron, minimal fill (matches mockup) */
.btn--next {
    --btn-bg: transparent;
    --btn-fg: var(--gold);
    border-color: transparent;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 800;
}
.btn--next:hover { --btn-bg: rgba(255, 188, 38, 0.12); box-shadow: none; }
.btn__chev { font-size: 1.5em; line-height: 0; transform: translateY(1px); }

/* ---------------- Nav row ---------------- */
.nav {
    display: flex;
    gap: var(--sp-4);
    justify-content: space-between;
    align-items: center;
    margin-top: var(--sp-2);
}
.nav--center { justify-content: center; }

/* ---------------- Screen 1: intro ---------------- */
.screen__inner--intro { gap: var(--sp-6); }

.intro__greeting {
    font-size: clamp(2.1rem, 8.5vw, 3.6rem);
    font-weight: 800;
    line-height: 1.05;
    color: var(--gold);
    letter-spacing: 0.01em;
    text-shadow: 0 0 26px rgba(255, 188, 38, 0.5);
    margin-bottom: calc(var(--sp-4) * -1);   /* group with the heading below */
}

.intro__eyebrow {
    font-size: var(--fs-eyebrow);
    font-weight: 800;
    line-height: 1.15;
    max-width: 18ch;
    margin-inline: auto;
    text-wrap: balance;
}
.intro__lead {
    font-size: var(--fs-lead);
    font-weight: 600;
    line-height: 1.35;
    max-width: 22ch;
    margin-inline: auto;
}
.intro__diya img {
    width: clamp(130px, 40vw, 200px);
    height: auto;
    margin-inline: auto;
    filter: drop-shadow(0 0 26px rgba(255, 188, 38, 0.55));
    animation: diya-glow 2.4s var(--ease) infinite;
}
@keyframes diya-glow {
    0%, 100% { filter: drop-shadow(0 0 22px rgba(255, 188, 38, 0.45)); }
    50%      { filter: drop-shadow(0 0 34px rgba(255, 188, 38, 0.85)); }
}

/* ---------------- Question screens ---------------- */
.q-step {
    font-size: var(--fs-small);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.q-step__now { color: var(--gold); font-weight: 800; }

.q-text {
    font-size: var(--fs-question);
    font-weight: 700;
    line-height: 1.3;
    max-width: 20ch;
    margin-inline: auto;
}

/* ============================================================
   Flame slider — the signature interaction
   A fixed, full-length gradient track (grey at the bottom → yellow
   at the top). The diya lamp IS the draggable handle (the native
   range thumb); its flame brightens as it rises.
   ============================================================ */
.flame-slider {
    --thumb-w: 74px;                 /* diya handle size (overridable per breakpoint) */
    --thumb-h: 62px;
    --val: 50;                       /* 0–100, kept in sync by slider.js */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-3);
    margin: var(--sp-3) auto var(--sp-2);
}

.flame-slider__cap {
    font-size: var(--fs-small);
    font-weight: 700;
    color: var(--text-muted);
    max-width: 18ch;
}
.flame-slider__cap--top { color: var(--white); }

.flame-slider__stage {
    position: relative;
    width: 100px;
    height: clamp(240px, 44vh, 320px);
    display: flex;
    justify-content: center;
}

/* Fixed, full-length gradient track: light grey (bottom) → yellow (top).
   It never changes length; the diya handle moves along it. */
.flame-slider__track {
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    border-radius: var(--radius-pill);
    background: linear-gradient(to top, #cfcfd6 0%, var(--gold) 55%, var(--yellow) 100%);
    box-shadow: 0 0 12px rgba(255, 188, 38, 0.3);
    pointer-events: none;
}

/* Native range input, oriented vertically (min at bottom), transparent
   track. writing-mode makes it vertical; orient="vertical" covers Firefox. */
.flame-slider__input {
    position: absolute;
    inset: 0;
    margin: 0;
    width: 100%;
    height: 100%;
    writing-mode: vertical-rl;
    direction: rtl;                  /* flip so the maximum is at the top (up = increase) */
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
}
.flame-slider__input:focus { outline: none; }
.flame-slider__input::-webkit-slider-runnable-track { background: transparent; }
.flame-slider__input::-moz-range-track { background: transparent; }

/* Transparent thumb: invisible but provides the drag interaction and hit
   area. The visible handle is the diya <img> below, positioned by --val. */
.flame-slider__input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: var(--thumb-w);
    height: var(--thumb-h);
    background: transparent;
    border: 0;
    cursor: grab;
}
.flame-slider__input::-moz-range-thumb {
    width: var(--thumb-w);
    height: var(--thumb-h);
    background: transparent;
    border: 0;
    cursor: grab;
}
.flame-slider__input:active::-webkit-slider-thumb { cursor: grabbing; }

/* The diya lamp — the visible handle. A real <img> so it always renders.
   Its centre travels the length of the track as --val changes; the flame
   image (low/medium/high) is swapped by slider.js. */
.flame-slider__diya {
    position: absolute;
    left: 50%;
    bottom: calc((var(--thumb-h) / 2) + (var(--val) / 100) * (100% - var(--thumb-h)));
    transform: translate(-50%, 50%);
    width: var(--thumb-w);
    height: auto;
    pointer-events: none;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.4));
    transition: bottom var(--dur-fast) var(--ease);
}

/* Instruction-screen demo: slider.js animates --val frame by frame, so the
   CSS easing on `bottom` is switched off to avoid lag. */
.flame-slider.is-demoing .flame-slider__diya { transition: none; }

/* Keyboard focus ring on the visible handle */
.flame-slider__input:focus-visible ~ .flame-slider__diya {
    outline: 3px solid var(--focus-ring);
    outline-offset: 4px;
    border-radius: 10px;
}

/* ---------------- Personalization insight ---------------- */
.insight {
    display: flex;
    gap: var(--sp-4);
    align-items: flex-start;
    text-align: left;
    background: rgba(131, 76, 252, 0.16);
    border: 1px solid rgba(131, 76, 252, 0.5);
    border-left: 4px solid var(--purple);
    border-radius: var(--radius);
    padding: var(--sp-5);
}
.insight__spark {
    width: 44px; height: 44px;
    flex-shrink: 0;
    filter: drop-shadow(0 0 8px rgba(255, 188, 38, 0.6));
}
.insight__body { font-size: var(--fs-body); line-height: 1.6; }
.insight__body :where(strong) { color: var(--gold); }
.insight__turn { color: var(--text-muted); font-size: var(--fs-body); }

/* ---------------- Intention selection ---------------- */
.intentions { border: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-3); }
.intentions__hint { font-size: var(--fs-small); color: var(--text-muted); }

.intention {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
    text-align: left;
    padding: var(--sp-4);
    background: rgba(104, 237, 230, 0.08);
    border: 2px solid rgba(104, 237, 230, 0.28);
    border-radius: var(--radius);
    transition: border-color var(--dur-fast) var(--ease),
                background var(--dur-fast) var(--ease),
                transform var(--dur-fast) var(--ease);
    cursor: pointer;
}
.intention:hover { background: rgba(104, 237, 230, 0.14); border-color: var(--cyan); }

.intention__input {
    width: 24px; height: 24px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: var(--gold);
    cursor: pointer;
}
.intention__body { display: flex; flex-direction: column; gap: 2px; }
.intention__title { color: var(--gold); font-size: var(--fs-body); }
.intention__desc { font-size: var(--fs-small); color: var(--text-muted); line-height: 1.5; }

/* Selected state (JS toggles .is-selected on the label) */
.intention.is-selected {
    background: rgba(131, 76, 252, 0.22);
    border-color: var(--purple);
    transform: translateY(-1px);
}
/* Dim the unselected options once two are chosen */
.intentions.is-full .intention:not(.is-selected) { opacity: 0.5; }

/* ---------------- Chosen intentions (confirm) ---------------- */
.chosen {
    background: rgba(255, 188, 38, 0.1);
    border: 2px solid var(--gold);
    border-radius: var(--radius);
    padding: var(--sp-5);
}
.chosen__list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: var(--sp-3); }
.chosen__list li {
    position: relative;
    padding-left: 1.8rem;
    font-size: var(--fs-body);
    color: var(--gold);
    line-height: 1.5;
    text-align: left;
}
.chosen__list li::before {
    content: "✓";
    position: absolute; left: 0; top: 0;
    font-weight: 800;
}

/* ---------------- Closing ---------------- */
.screen__inner--closing { gap: var(--sp-5); }
.closing__msg {
    background: rgba(250, 122, 149, 0.12);
    border-left: 4px solid var(--pink);
    border-radius: var(--radius);
    padding: var(--sp-5);
    font-size: var(--fs-body);
    line-height: 1.7;
    text-align: left;
}
.closing__brand {
    padding-top: var(--sp-5);
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-3);
}
.closing__logo { width: clamp(150px, 50vw, 190px); }
.closing__wish { color: var(--text-muted); font-size: var(--fs-body); }
.closing__cta { font-weight: 700; text-decoration: none; }
.closing__cta:hover { color: var(--yellow); text-decoration: underline; }

/* ---------------- Share modal ---------------- */
.modal {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: grid;
    place-items: center;
    padding: var(--gutter);
}
.modal[hidden] { display: none; }

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(3px);
    animation: fade-in var(--dur) var(--ease) both;
}
.modal__panel {
    position: relative;
    width: min(100%, 420px);
    background: var(--navy-deep);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-lg);
    padding: var(--sp-6);
    box-shadow: var(--shadow-soft);
    animation: pop-in var(--dur) var(--ease) both;
}
.modal__title { font-size: 1.4rem; text-align: center; margin-bottom: var(--sp-5); }
.modal__close {
    position: absolute; top: 10px; right: 14px;
    width: 40px; height: 40px;
    font-size: 1.6rem; line-height: 1;
    background: transparent; border: 0; color: var(--white);
    opacity: 0.75;
}
.modal__close:hover { opacity: 1; }

.share { display: flex; flex-direction: column; gap: var(--sp-3); }
.share__opt {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-4);
    font-weight: 600;
    color: var(--white);
    background: rgba(104, 237, 230, 0.1);
    border: 2px solid var(--cyan);
    border-radius: var(--radius);
    transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.share__opt:hover { background: rgba(104, 237, 230, 0.2); transform: translateY(-1px); }

/* Toast for share feedback */
.toast {
    position: fixed;
    left: 50%;
    top: max(var(--sp-5), env(safe-area-inset-top));
    transform: translateX(-50%);
    z-index: calc(var(--z-modal) + 10);
    padding: 0.7rem 1.3rem;
    background: var(--gold);
    color: var(--navy);
    font-weight: 700;
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-soft);
    animation: fade-in var(--dur) var(--ease) both;
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
