/* =============================================================
   SingMyWish — Quiz-specific Styles (index.html only)
   ============================================================= */

/* ── Header overrides for quiz (back button + progress bar) ── */
.header {
    padding: 16px 20px 14px;
    justify-content: flex-start;
    gap: 11px;
}
.hback {
    width: 36px; height: 36px; border-radius: 12px;
    background: var(--brand-bg); border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--brand); flex-shrink: 0; transition: background .2s;
}
.hback:hover   { background: rgba(139,92,246,0.13); }
.hback.hidden  { visibility: hidden; }
.hstep { font-size:12px; font-weight:700; color:var(--text-muted); white-space:nowrap; flex-shrink:0; }
.ptrack {
    height: 3px; background: var(--border);
    position: absolute; bottom: 0; left: 20px; right: 20px;
    border-radius: 99px 99px 0 0; overflow: hidden;
}
.pfill {
    width: 0; height: 100%; background: linear-gradient(90deg, var(--brand), var(--accent));
    transition: width .45s cubic-bezier(.4,0,.2,1);
}
.wrapper { padding-bottom: 0; }

/* ── Screen system ──────────────────────────────────────────── */
.screen-area { flex: 1; position: relative; overflow: hidden; }
.screen {
    position: absolute; inset: 0; display: flex; flex-direction: column;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
    transition: transform .4s cubic-bezier(.25,.46,.45,.94), opacity .4s ease;
}
.screen.active    { transform: translateX(0);     opacity: 1;    z-index: 2; }
.screen.in-right  { transform: translateX(100%);  opacity: 0;    z-index: 2; }
.screen.out-left  { transform: translateX(-25%);  opacity: .15;  z-index: 1; }
.screen.in-left   { transform: translateX(-100%); opacity: 0;    z-index: 2; }
.screen.out-right { transform: translateX(25%);   opacity: .15;  z-index: 1; }

/* ── Screen content ─────────────────────────────────────────── */
.sc  { padding: 24px 20px 32px; flex: 1; display: flex; flex-direction: column; }
.sh  { font-size: 26px; font-weight: 800; color: var(--text); line-height: 1.25; margin-bottom: 6px; letter-spacing: -.6px; }
.ss  { font-size: 14px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 8px; }

/* ── Icon container ─────────────────────────────────────────── */
.ic { border-radius: 0; flex-shrink: 0; overflow: hidden; background: none; display: flex; align-items: center; justify-content: center; }
.ic picture, .ic img { object-fit: contain; }

/* ── Image-select grid (delivery / postcard styles) ─────────── */
.img-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.img-card {
    border-radius: var(--radius); border: 2px solid var(--border);
    background: var(--white); cursor: pointer; overflow: hidden;
    display: flex; flex-direction: column; box-shadow: var(--sh);
    transition: border-color .2s, box-shadow .2s, transform .15s; font-family: inherit;
}
.img-card:active { transform: scale(.97); }
.img-card.sel    { border-color: var(--brand); box-shadow: var(--sel-shadow); }
.img-card-vis    { height: 120px; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg,rgba(139,92,246,0.04),rgba(236,72,153,0.04)); overflow: hidden; }
.img-card-vis picture { width: 75%; height: 75%; }
.img-card-vis img     { width: 100%; height: 100%; object-fit: contain; }
.img-card-lbl  { padding: 11px 12px; font-size: 14px; font-weight: 700; text-align: center; color: var(--text); }
.img-card-vis.square { height: auto; aspect-ratio: 1; }

/* ── Occasion grid ──────────────────────────────────────────── */
.occ-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.occ-card {
    padding: 18px 12px 14px; border-radius: var(--radius);
    border: 2px solid var(--border); background: var(--white);
    cursor: pointer; text-align: center; display: flex; flex-direction: column;
    align-items: center; gap: 8px; box-shadow: var(--sh);
    transition: border-color .2s, box-shadow .2s, transform .15s; font-family: inherit;
}
.occ-card:active { transform: scale(.97); }
.occ-card.sel    { border-color: var(--brand); box-shadow: var(--sel-shadow); }
.occ-icon         { width: 64px; height: 64px; }
.occ-icon picture { width: 64px; height: 64px; display: flex; }
.occ-icon img     { width: 64px; height: 64px; object-fit: contain; }
.occ-lbl { font-size: 13px; font-weight: 700; color: var(--text); line-height: 1.3; }

/* ── Option buttons ─────────────────────────────────────────── */
.opt-grid       { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.opt-grid.g2    { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.opt-btn {
    padding: 14px 16px; border-radius: var(--radius);
    border: 2px solid var(--border); background: var(--white);
    font-size: 15px; font-weight: 600; color: var(--text);
    cursor: pointer; text-align: left; display: flex; align-items: center;
    gap: 12px; font-family: inherit; box-shadow: var(--sh);
    transition: border-color .2s, box-shadow .2s, transform .15s;
}
.opt-btn:active { transform: scale(.98); }
.opt-btn.sel    { border-color: var(--brand); box-shadow: var(--sel-shadow); }
.opt-ic         { width: 44px; height: 44px; }
.opt-ic picture { width: 44px; height: 44px; display: flex; }
.opt-ic img     { width: 44px; height: 44px; object-fit: contain; }

/* Square variant for g2 with images (vocals) */
.opt-grid.g2 .opt-btn:has(.opt-ic) {
    flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 20px 12px 16px; gap: 10px; aspect-ratio: 1;
}
.opt-grid.g2 .opt-btn:has(.opt-ic) .opt-ic         { width: 80px; height: 80px; }
.opt-grid.g2 .opt-btn:has(.opt-ic) .opt-ic picture { width: 80px; height: 80px; }
.opt-grid.g2 .opt-btn:has(.opt-ic) .opt-ic img     { width: 80px; height: 80px; }

/* ── Pills (multi-select genres) ───────────────────────────── */
.pills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.pill {
    padding: 11px 18px; border-radius: 28px;
    border: 2px solid var(--border-soft); background: var(--white);
    font-size: 14px; font-weight: 600; color: var(--text);
    cursor: pointer; transition: all .15s; font-family: inherit;
}
.pill.sel {
    border-color: var(--brand);
    background: linear-gradient(135deg, var(--brand), var(--brand-light));
    color: #fff; box-shadow: 0 4px 12px rgba(139,92,246,0.25);
}

/* ── Inspire me ─────────────────────────────────────────────── */
.inspire-row { display: flex; justify-content: flex-end; margin-top: 8px; }
.inspire-btn {
    background: var(--brand); border: none; color: #fff;
    border-radius: 20px; padding: 5px 14px; font-size: 13px; font-weight: 600;
    cursor: pointer; font-family: inherit; transition: opacity .15s;
    display: flex; align-items: center; gap: 4px;
}
.inspire-btn:active { opacity: .8; }
.inspire-spark { font-size: 15px; line-height: 1; }

/* ── Character counter ──────────────────────────────────────── */
.char-count { font-size: 12px; color: var(--text-muted); text-align: right; margin-top: 4px; }

/* ── Text inputs ────────────────────────────────────────────── */
.igroup { margin-top: 12px; margin-bottom: 16px; }
.tinput, .tarea {
    width: 100%; padding: 15px 16px; border-radius: 14px;
    border: 2px solid var(--border-soft); background: var(--white);
    font-size: 16px; font-weight: 500; color: var(--text);
    transition: border-color .2s, box-shadow .2s; font-family: inherit;
}
.tinput:focus, .tarea:focus {
    border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-bg); outline: none;
}
.tarea   { min-height: 120px; resize: vertical; font-size: 15px; line-height: 1.5; }
.ierr    { font-size: 12px; color: var(--danger); margin-top: 5px; opacity: 0; transition: opacity .2s; }
.ierr.on { opacity: 1; }

/* ── Bottom action row ──────────────────────────────────────── */
.brow { margin-top: auto; padding-top: 20px; }

/* ── Info / welcome screen ──────────────────────────────────── */
.iblock  { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.iillus picture, .iillus img { width: 100%; height: auto; }
.ititle  { font-size: 24px; font-weight: 800; letter-spacing: -.5px; line-height: 1.25; }
.itext   { font-size: 14px; color: var(--text-secondary); line-height: 1.6; max-width: 300px; }

/* ── Feature list (welcome screen) ─────────────────────────── */
.feats  { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.feat   { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,0.75); border: 1px solid rgba(139,92,246,0.07); }
.feat-ic         { width: 44px; height: 44px; }
.feat-ic picture { width: 44px; height: 44px; display: flex; }
.feat-ic img     { width: 44px; height: 44px; object-fit: contain; }
.feat-txt { font-size: 14px; font-weight: 600; color: var(--text); }

/* ── Loading / generating screen ───────────────────────────── */
.lblock   { text-align: center; padding: 32px 0; display: flex; flex-direction: column; align-items: center; gap: 20px; flex: 1; justify-content: center; }
.ring-wrap { position: relative; width: 130px; height: 130px; }
.ring      { transform: rotate(-90deg); }
.ring-bg   { fill: none; stroke: var(--border); stroke-width: 8; }
.ring-fg   { fill: none; stroke: url(#g);             stroke-width: 8; stroke-linecap: round; }
.ring-pct  {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
    font-size: 28px; font-weight: 800;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.lsteps { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 260px; text-align: left; }
.lstep  { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--text-muted); transition: color .3s; }
.lstep.on   { color: var(--text); }
.lstep.done { color: var(--brand); }
.ldot {
    width: 22px; height: 22px; border-radius: 50%;
    border: 2px solid rgba(139,92,246,0.15); flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 700; transition: all .3s;
}
.lstep.on   .ldot { border-color: var(--brand); background: var(--brand-bg); }
.lstep.done .ldot { border-color: var(--brand); background: var(--brand); color: #fff; }
.lctr { font-size: 13px; color: var(--text-secondary); padding: 7px 14px; border-radius: 20px; background: var(--brand-bg-xs); }


/* ── Loading text heading ───────────────────────────────────── */
.lhead { font-size: 20px; font-weight: 700; }

/* ── Image-select placeholder (no image) ────────────────────── */
.img-card-placeholder {
    width: 100%; height: 100%;
    background: var(--brand-bg-xs);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 12px;
}

/* ── Info / welcome — illustration container ────────────────── */
.iillus { width: 190px; margin: 0 auto; }

/* ── Welcome screen overrides ───────────────────────────────── */
.sc--welcome                { justify-content: center; padding-top: 12px; }
.sc--welcome .iblock        { gap: 8px; flex: 0; }
.sc--welcome .iillus        { width: 160px; }
.sc--welcome .ititle        { font-size: 22px; }
.sc--welcome .brow          { margin-top: 10px; padding-top: 0; }

/* ── Ready screen — iblock fills remaining vertical space ────── */
.iblock-fill { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }

/* ── Testimonials screen — compact iblock + list wrapper ─────── */
.iblock--testi { flex: 0; padding-bottom: 8px; }
.testi-list    { display: flex; flex-direction: column; gap: 12px; margin: 16px 0; }

/* ── Direct <img> in img-card-vis (jpg / gif / http urls) ──────── */
.img-cover { width: 100%; height: 100%; object-fit: cover; }

/* ── SVG gradient defs (invisible, position out of flow) ───────── */
.svg-defs { position: absolute; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 380px) {
    .sh { font-size: 22px; }
    .opt-btn { padding: 12px 14px; }
    .img-card-vis { height: 100px; }
}
