/* Plate Patterns survey. Layout: one question per screen, fluid from 320px phones to wide desktops.
   Palette: pomegranate (action), turmeric (highlight), pistachio (success) on a warm ground. */
:root {
  --bg: #FCF5EE; --surface: #FFFFFF; --surface-2: #F6EADD; --ink: #2B1B17; --ink-2: #6B544C;
  --line: #E8D8C9; --accent: #A3224A; --accent-ink: #FFFFFF; --accent-soft: #F8DDE5;
  --turmeric: #E9A21B; --pistachio: #2F7A52; --danger: #B3261E; --focus: #1F5FBF;
  --shadow: 0 1px 2px rgba(43, 27, 23, .06), 0 8px 24px rgba(43, 27, 23, .06);
  --font-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ic-red: #D9304F; --ic-orange: #E8731A; --ic-amber: #C98A00; --ic-violet: #7A4FD6; --ic-teal: #0E9488; --ic-blue: #2F6FDE; --ic-green: #2E8B57;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1B1214; --surface: #281A1D; --surface-2: #33232A; --ink: #F7EBE2; --ink-2: #CBB4AA;
    --line: #4A3438; --accent: #F06A92; --accent-ink: #2B0A15; --accent-soft: #4A2230;
    --turmeric: #F5B83D; --pistachio: #6BC08D; --danger: #FF8A80; --focus: #8AB4FF;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25); color-scheme: dark;
  --ic-red: #FF7A93; --ic-orange: #FFA05C; --ic-amber: #F5B83D; --ic-violet: #B29BFF; --ic-teal: #4FD1C5; --ic-blue: #7FA8FF; --ic-green: #6BC08D;
  }
}
:root[data-theme="dark"] {
  --bg: #1B1214; --surface: #281A1D; --surface-2: #33232A; --ink: #F7EBE2; --ink-2: #CBB4AA;
  --line: #4A3438; --accent: #F06A92; --accent-ink: #2B0A15; --accent-soft: #4A2230;
  --turmeric: #F5B83D; --pistachio: #6BC08D; --danger: #FF8A80; --focus: #8AB4FF;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25); color-scheme: dark;
  --ic-red: #FF7A93; --ic-orange: #FFA05C; --ic-amber: #F5B83D; --ic-violet: #B29BFF; --ic-teal: #4FD1C5; --ic-blue: #7FA8FF; --ic-green: #6BC08D;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.5 var(--font-body);
  min-height: 100dvh; -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 10px; }

.shell { min-height: 100dvh; display: grid; grid-template-columns: 1fr; }
.side { display: none; }
.app {
  display: flex; flex-direction: column; min-height: 100dvh; width: 100%; max-width: 640px; margin: 0 auto;
  padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px));
}

/* progress */
.top { position: sticky; top: 0; z-index: 5; background: var(--bg); padding-block: calc(14px + env(safe-area-inset-top, 0px)) 10px; }
.top-row { display: flex; justify-content: space-between; font-size: 14px; color: var(--ink-2); margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar-fill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--turmeric), var(--accent)); border-radius: 99px; transition: width .45s cubic-bezier(.2, .8, .2, 1); }

/* stage */
.stage { flex: 1; padding-block: 18px 28px; outline: none; }
.screen { animation: enter .32s cubic-bezier(.2, .8, .2, 1) both; }
.screen.back { animation-name: enterBack; }
@keyframes enter { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes enterBack { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }

.q-title { font: 800 clamp(26px, 6.2vw, 34px)/1.12 var(--font-display); letter-spacing: -.015em; margin: 6px 0 8px; text-wrap: balance; }
.q-hint { margin: 0 0 22px; color: var(--ink-2); }
.q-hint .count { color: var(--accent); font-weight: 700; }
.optional-tag { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); background: var(--surface-2); padding: 3px 9px; border-radius: 99px; margin-bottom: 8px; }

/* choice inputs: real inputs overlaid on the visual body so keyboard, tap and screen readers all work */
.choice { position: relative; display: block; }
.choice input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.body { transition: transform .12s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease; }
.choice:active .body { transform: scale(.975); }
.choice input:focus-visible + .body { outline: 3px solid var(--focus); outline-offset: 2px; }
.choice input:checked + .body { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.choice.is-full input:not(:checked) + .body { opacity: .5; }

.tick {
  position: absolute; top: 10px; right: 10px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-size: 14px; font-weight: 800; transform: scale(0); transition: transform .22s cubic-bezier(.3, 1.6, .5, 1);
}
.choice input:checked + .body .tick { transform: scale(1); }

/* cards */
.grid-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.card { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 108px; padding: 14px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.card .emoji { font-size: 30px; line-height: 1; transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); }
.choice input:checked + .card .emoji { transform: scale(1.18) rotate(-6deg); }
.card .lbl { font-weight: 700; line-height: 1.2; padding-right: 22px; }
.card .desc { font-size: 14px; color: var(--ink-2); line-height: 1.3; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 20px 0 16px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 99px; font-weight: 600; }
.chip .emoji { font-size: 20px; }
.chip .tick { position: static; width: 0; height: 22px; opacity: 0; transform: none; overflow: hidden; transition: width .2s ease, opacity .2s ease; }
.choice input:checked + .chip .tick { width: 22px; opacity: 1; }

/* list rows */
.list { display: grid; gap: 10px; }
.row { position: relative; display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 12px 16px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px; font-weight: 600; }
.row .radio { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); display: grid; place-items: center; transition: border-color .15s, background .15s; }
.row .radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent-ink); transform: scale(0); transition: transform .2s cubic-bezier(.3, 1.6, .5, 1); }
.choice input:checked + .row .radio { background: var(--accent); border-color: var(--accent); }
.choice input:checked + .row .radio::after { transform: scale(1); }

/* sliders */
.slider-wrap { background: var(--surface); border: 1.5px solid var(--line); border-radius: 22px; padding: 22px 18px 18px; box-shadow: var(--shadow); }
.readout { text-align: center; margin-bottom: 18px; }
.readout .big { font: 800 clamp(40px, 12vw, 56px)/1 var(--font-display); letter-spacing: -.02em; color: var(--accent); font-variant-numeric: tabular-nums; }
.readout .sub { margin-top: 6px; min-height: 24px; color: var(--ink-2); }
.readout.untouched .big { color: var(--ink-2); opacity: .55; }
.chili-row { display: flex; justify-content: center; gap: 6px; margin-bottom: 8px; font-size: 30px; }
.chili-row span { filter: grayscale(1); opacity: .3; transform: scale(.85); transition: filter .2s, opacity .2s, transform .25s cubic-bezier(.3, 1.6, .5, 1); }
.chili-row span.on { filter: none; opacity: 1; transform: scale(1.08); }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; background: transparent; margin: 0; cursor: pointer; --pct: 50%; }
input[type=range]::-webkit-slider-runnable-track { height: 12px; border-radius: 99px; background: linear-gradient(90deg, var(--accent) var(--pct), var(--surface-2) var(--pct)); }
input[type=range]::-moz-range-track { height: 12px; border-radius: 99px; background: var(--surface-2); }
input[type=range]::-moz-range-progress { height: 12px; border-radius: 99px; background: var(--accent); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 34px; height: 34px; margin-top: -11px; border-radius: 50%; background: var(--surface); border: 4px solid var(--accent); box-shadow: 0 2px 8px rgba(0, 0, 0, .25); transition: transform .12s; }
input[type=range]::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: var(--surface); border: 4px solid var(--accent); box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
input[type=range]:active::-webkit-slider-thumb { transform: scale(1.12); }
.range-ends { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); margin-top: 2px; }

/* validation */
.error { display: none; margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--danger) 14%, var(--surface)); color: var(--danger); font-weight: 600; border: 1.5px solid var(--danger); }
.error.show { display: block; animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* nav */
.nav {
  position: sticky; bottom: 0; z-index: 5; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  padding-block: 12px calc(12px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(180deg, transparent, var(--bg) 24%);
}
.btn { min-height: 54px; padding: 0 24px; border-radius: 99px; border: 1.5px solid transparent; font-weight: 700; cursor: pointer; transition: transform .1s, background .15s, opacity .15s; }
.btn:active { transform: scale(.96); }
.btn.primary { background: var(--accent); color: var(--accent-ink); min-width: 140px; justify-self: end; }
.btn.primary[disabled] { opacity: .6; cursor: progress; }
.btn.ghost { background: var(--surface); border-color: var(--line); }
.btn.text { background: none; color: var(--ink-2); justify-self: center; }
.btn.text:hover { color: var(--ink); }

/* welcome + result */
.ico { --tone: var(--accent); flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: var(--tone); background: color-mix(in srgb, var(--tone) 15%, var(--surface)); }
.ico.big { width: 48px; height: 48px; }
.ico-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.t-red { --tone: var(--ic-red); } .t-orange { --tone: var(--ic-orange); } .t-amber { --tone: var(--ic-amber); } .t-violet { --tone: var(--ic-violet); }
.t-teal { --tone: var(--ic-teal); } .t-blue { --tone: var(--ic-blue); } .t-green { --tone: var(--ic-green); }
.promise { list-style: none; margin: 22px 0 28px; padding: 0; display: grid; gap: 16px; }
.promise li { display: flex; align-items: flex-start; gap: 14px; }
.ptext { display: grid; gap: 2px; min-width: 0; }
.ptext b { color: var(--ink); font-weight: 700; font-size: 17px; line-height: 1.3; }
.ptext span { color: var(--ink-2); font-size: 16px; line-height: 1.4; }
.start { width: 100%; min-height: 60px; font-size: 18px; }

.result-head { text-align: center; padding: 8px 0 4px; }
.badge { display: inline-flex; align-items: center; gap: 8px; background: color-mix(in srgb, var(--pistachio) 18%, var(--surface)); color: var(--pistachio); font-weight: 700; padding: 6px 14px; border-radius: 99px; font-size: 14px; }
.persona { font: 800 clamp(32px, 9vw, 44px)/1.05 var(--font-display); letter-spacing: -.02em; margin: 14px 0 8px; text-wrap: balance; }
.persona-blurb { color: var(--ink-2); max-width: 46ch; margin: 0 auto 22px; }
.facts { display: grid; gap: 1px; background: var(--line); border: 1.5px solid var(--line); border-radius: 18px; overflow: hidden; margin-bottom: 18px; }
.fact { display: grid; grid-template-columns: 112px 1fr; gap: 12px; padding: 13px 16px; background: var(--surface); }
.fact dt { color: var(--ink-2); font-size: 14px; padding-top: 2px; } .fact dd { margin: 0; font-weight: 600; }
.tips { background: var(--surface-2); border-radius: 18px; padding: 16px 18px; margin: 0 0 20px; }
.tips h3 { margin: 0 0 8px; font: 700 15px var(--font-body); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); }
.tips ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.thanks { text-align: center; color: var(--ink-2); font-size: 15px; }
.notice { margin: 0 0 16px; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--turmeric) 22%, var(--surface)); font-size: 15px; }

/* desktop: split layout */
@media (min-width: 960px) {
  body { font-size: 18px; }
  .shell { grid-template-columns: minmax(320px, 40%) 1fr; }
  .side {
    display: flex; flex-direction: column; justify-content: space-between; position: sticky; top: 0; height: 100dvh; padding: 44px 48px;
    background: radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--turmeric) 38%, var(--bg)), transparent 60%), linear-gradient(160deg, var(--accent-soft), var(--bg));
    border-right: 1px solid var(--line);
  }
  .brand { font: 800 22px var(--font-display); display: flex; align-items: center; gap: 10px; }
  .brand-mark { color: var(--accent); font-size: 28px; }
  .side-kicker { text-transform: uppercase; letter-spacing: .14em; font-size: 13px; font-weight: 700; color: var(--accent); margin: 0 0 12px; }
  .side-line { font: 800 clamp(40px, 4.2vw, 64px)/1.02 var(--font-display); letter-spacing: -.025em; margin: 0; text-wrap: balance; }
  .side-foot { color: var(--ink-2); font-size: 15px; max-width: 34ch; }
  .app { max-width: 720px; padding-inline: 48px; justify-content: center; }
  .stage { flex: none; padding-block: 28px; }
  .grid-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .nav { background: none; }
}
@media (max-width: 959px) { .brand { display: none; } }
@media (max-width: 360px) { .grid-cards { gap: 8px; } .card { padding: 12px; } .fact { grid-template-columns: 1fr; gap: 2px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* explainer card (fees) and text fields */
.explain { background: var(--surface); border: 1.5px solid var(--line); border-left: 5px solid var(--turmeric); border-radius: 16px; padding: 16px 18px; margin: 0 0 20px; box-shadow: var(--shadow); }
.explain h2 { margin: 0 0 8px; font: 800 20px/1.2 var(--font-display); letter-spacing: -.01em; }
.explain p { margin: 0 0 10px; }
.explain p:last-child { margin-bottom: 0; }
.explain ul { margin: 0 0 10px; padding-left: 20px; display: grid; gap: 4px; }
.explain .strong { font-weight: 700; }
.explain .example { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; font-size: 15px; color: var(--ink-2); }
.field { display: grid; gap: 6px; }
.field textarea, .field input[type=text] {
  width: 100%; border: 1.5px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink);
  padding: 14px 16px; font: inherit; resize: vertical; min-height: 56px;
}
.field textarea { min-height: 130px; line-height: 1.45; }
.field textarea:focus, .field input:focus { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--accent); }
.chars { justify-self: end; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.fine { color: var(--ink-2); font-size: 14px; margin: 10px 2px 0; }
.q-hint:empty { display: none; }

/* the heading takes focus on each new screen for screen readers only; no ring needed */
.q-title:focus, .persona:focus { outline: none; }

/* typed detail under "something else" style options */
.detail { margin-top: 10px; animation: fadeIn .22s ease both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.detail-input { width: 100%; min-height: 56px; padding: 0 16px; border: 1.5px solid var(--accent); border-radius: 16px; background: var(--surface); color: var(--ink); font: inherit; }
.detail-input:focus { outline: 3px solid var(--focus); outline-offset: 1px; }

/* first screen: on desktop the heading and its supporting text live together in the left panel */
.side-sub { margin: 18px 0 0; max-width: 40ch; color: var(--ink-2); font-size: 18px; line-height: 1.5; }
.side-sub:empty { display: none; }
@media (min-width: 960px) {
  .side-copy { margin-block: auto; }
  .welcome > .q-title, .welcome > .q-hint { display: none; }
  .welcome .promise { margin-top: 0; }
}

.privacy { text-align: center; margin-top: 14px; }

/* approximate amount in rupees (venue payment) */
.amount { margin-top: 10px; animation: fadeIn .22s ease both; }
.amount-label { display: block; font-weight: 700; margin: 4px 2px 8px; }
.amount-field { position: relative; }
.rupee { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); font-weight: 800; color: var(--accent); font-size: 20px; }
.amount-input { width: 100%; min-height: 60px; padding: 0 16px 0 44px; border: 1.5px solid var(--accent); border-radius: 16px; background: var(--surface); color: var(--ink); font: 700 22px var(--font-body); font-variant-numeric: tabular-nums; }
.amount-input::placeholder { font-weight: 500; font-size: 17px; color: var(--ink-2); opacity: .7; }
.amount-input:focus { outline: 3px solid var(--focus); outline-offset: 1px; }
.amount .fine { margin: 8px 2px 0; }
