/* FRND Live audition: applicant UI. Mobile first (360x740 baseline), system fonts, no build step. */

:root {
  /* FRND brand tokens (brand/BRAND.md). Text colours are darkened where the brand value is under 4.5:1 on white. */
  --bg: #FFFFFF;
  --surface: #F5F6F7;          /* brand surface tint */
  --card: #FFFFFF;
  --ink: #171717;              /* brand ink */
  --heading: #1C0756;          /* brand deep purple */
  --muted: #666666;            /* brand muted #7E7E7E is 4.06:1 on white; this is 5.74:1 */
  --line: #DFE2E6;             /* brand line */
  --pink: #FF1282;             /* brand pink */
  --pink-a: #FF198B;           /* gradient start */
  --pink-b: #FE1959;           /* gradient end */
  --pink-grad: linear-gradient(135deg, var(--pink-a), var(--pink-b));
  --pink-text: #D4006B;        /* pink text / links on white: 5.23:1 */
  --pink-soft: #FFE8F3;
  --purple: #623FCD;           /* brand accent purple: progress, focus */
  --yellow: #FFC24B;
  --primary: var(--pink);
  --primary-press: #E0006F;
  --primary-ink: var(--pink-text);
  --primary-soft: var(--pink-soft);
  --ok: #0B7A55;               /* success text (brand #1BB785 is 2.57:1) */
  --ok-icon: #128A63;
  --ok-soft: #E3F7F0;
  --warn: #A34A00;             /* warning text (brand #FC8F26 is 2.31:1) */
  --warn-icon: #C25E00;
  --warn-soft: #FFF1E3;
  --error: #D13A3A;            /* brand error, 4.8:1 */
  --rec: #FF1282;
  --radius: 16px;
  --pad: max(20px, env(safe-area-inset-left), env(safe-area-inset-right));
  --header-h: 56px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", "Helvetica Neue", Arial, sans-serif;
  --font-head: "Poppins", var(--font);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.is-hidden { display: none !important; }
h1:focus, h1:focus-visible { outline: none; }
:focus-visible { outline: 3px solid #A48CF0; outline-offset: 2px; }

#app {
  position: relative; max-width: 480px; margin: 0 auto;
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top);
}
#screen { flex: 1; display: flex; flex-direction: column; }

/* ------------------------------------------------------------- header + progress */

.topbar {
  height: var(--header-h); flex: none;
  display: flex; align-items: center; gap: 12px;
  padding: 0 var(--pad);
}
.topbar.is-hidden { display: none !important; }
.progress { flex: 1; min-width: 0; }
.progress-track { display: flex; gap: 4px; }
.progress-seg { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.progress-seg[data-state="done"] { background: var(--purple); }
.progress-seg[data-state="now"] { background: linear-gradient(90deg, var(--purple) 50%, var(--line) 50%); }
.progress-label {
  margin: 6px 0 0; font-size: 13px; line-height: 16px; height: 16px; color: var(--muted); font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lang-btn {
  flex: none; width: 88px; min-height: 44px; padding: 0 8px; margin-left: auto;
  border: 1.5px solid var(--line); border-radius: 22px; background: var(--card);
  font-size: 15px; font-weight: 600; cursor: pointer;
}

/* ------------------------------------------------------------- screen frame */

.screen { flex: 1; display: flex; flex-direction: column; padding: 8px var(--pad) 0; }
.content { flex: 1; }
.actions {
  position: sticky; bottom: 0; z-index: 2;
  display: flex; flex-direction: column; gap: 10px;
  margin: 0 calc(-1 * var(--pad)); padding: 20px var(--pad) calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(rgba(255, 255, 255, 0), var(--bg) 18px);
}
.center .content { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }

.title { font-size: 26px; line-height: 1.2; font-weight: 750; letter-spacing: -0.01em; margin: 8px 0 10px; }
.lede { font-size: 17px; line-height: 1.5; margin: 0 0 18px; }
.lede.strong { font-weight: 650; }
.muted { color: var(--muted); margin: 0 0 14px; }
.small { font-size: 14px; }

.icon { display: inline-flex; width: 24px; height: 24px; flex: none; }
.icon svg { width: 100%; height: 100%; }

.hero {
  width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; margin: 12px 0 8px;
  background: var(--primary-soft); color: var(--primary-ink);
}
.hero .icon { width: 32px; height: 32px; }
.hero-ok { background: var(--ok-soft); color: var(--ok); border-radius: 50%; width: 88px; height: 88px; }
.hero-ok .icon { width: 44px; height: 44px; }
.hero-alert { background: var(--warn-soft); color: var(--warn); }
.hero-soft { background: var(--surface); color: var(--heading); }
.hero-pair { display: flex; gap: 12px; }

/* ------------------------------------------------------------- buttons */

.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 52px; padding: 12px 20px; border-radius: 14px; border: 0;
  font-size: 17px; font-weight: 700; line-height: 1.25; text-align: center; text-decoration: none; cursor: pointer;
  transition: background-color .15s, transform .1s, opacity .15s;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.btn:active { transform: scale(.985); }
.btn-primary { background: var(--pink-grad); color: #fff; box-shadow: 0 6px 16px rgba(255, 18, 130, .28); }
.btn-primary:active { background: var(--primary-press); }
.btn-primary:disabled { background: #E6E8EB; color: #5C5F66; box-shadow: none; cursor: default; transform: none; }
.btn-secondary { background: var(--card); color: var(--ink); border: 1.5px solid var(--line); }
.btn-link {
  min-height: 44px; padding: 8px 12px; width: auto; align-self: center; background: none;
  color: var(--primary-ink); font-size: 15px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px;
}
.btn .icon { width: 20px; height: 20px; }

/* ------------------------------------------------------------- welcome */

.welcome-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 8px; }
.live-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
  background: var(--card); border: 1.5px solid var(--line); font-size: 13px; font-weight: 700; letter-spacing: .02em;
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rec); box-shadow: 0 0 0 3px rgba(255, 18, 130, .2); }
.seg-toggle { display: flex; padding: 3px; border-radius: 24px; background: var(--surface); }
.seg-btn {
  min-height: 44px; min-width: 76px; padding: 0 14px; border: 0; border-radius: 21px; background: none;
  font-size: 15px; font-weight: 600; color: var(--muted); cursor: pointer;
}
.seg-btn[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 4px rgba(35, 27, 22, .12); }
.greeting { margin: 22px 0 0; font-size: 17px; font-weight: 600; color: var(--primary-ink); }
.welcome .title { font-size: 28px; margin-top: 4px; }
.parts { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.part {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px;
  background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line);
}
.part-num {
  flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary-ink); font-weight: 750;
}
.part-text { display: flex; flex-direction: column; line-height: 1.35; }
.part-text strong { font-size: 16px; }
.part-text span { font-size: 14px; color: var(--muted); }
.hint { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 8px; color: var(--muted); font-size: 15px; }
.hint-icon { color: var(--primary-ink); width: 22px; height: 22px; margin-top: 1px; }

/* ------------------------------------------------------------- forms */

.form { display: flex; flex-direction: column; gap: 22px; margin-top: 8px; }
.field { border: 0; margin: 0; padding: 0; min-width: 0; }
.field-label { display: block; font-weight: 650; font-size: 16px; margin: 0 0 8px; padding: 0; }
.text-input {
  display: block; width: 100%; height: 52px; padding: 0 16px; font-size: 17px;
  background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; outline: none;
  -webkit-appearance: none; appearance: none;
}
.text-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(98, 63, 205, .18); }
.text-input[aria-invalid="true"] { border-color: var(--warn); }
.text-input::placeholder { color: #8A8D93; }
.field-error { margin: 8px 0 0; color: var(--warn); font-size: 14px; font-weight: 600; line-height: 1.4; }

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice {
  position: relative; display: flex; flex-direction: column; justify-content: center;
  min-height: 56px; padding: 8px 34px 8px 14px; border-radius: 14px;
  background: var(--surface); border: 1.5px solid var(--line); cursor: pointer; line-height: 1.25;
  transition: border-color .15s, background-color .15s;
}
.choice-native { font-size: 16px; font-weight: 650; }
.choice-en { font-size: 13px; color: var(--muted); }
.choice-check {
  position: absolute; right: 10px; top: 50%; margin-top: -10px; width: 20px; height: 20px;
  color: var(--primary); opacity: 0; transition: opacity .15s;
}
.choice.is-checked, .choice:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.choice.is-checked .choice-check, .choice:has(input:checked) .choice-check { opacity: 1; }
.choice:focus-within, .check-row:focus-within { outline: 3px solid #A48CF0; outline-offset: 1px; }
.cover-input {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1;
  -webkit-appearance: none; appearance: none;
}

.check-row {
  position: relative; display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 10px 14px;
  border-radius: 14px; background: var(--surface); border: 1.5px solid var(--line); cursor: pointer; font-weight: 600;
}
.check-row .box {
  flex: none; width: 26px; height: 26px; border-radius: 8px; border: 2px solid #B9BEC5; background: var(--card);
  display: grid; place-items: center; color: transparent; transition: all .15s;
}
.check-row .box .icon { width: 18px; height: 18px; }
.check-row.is-checked .box, .check-row:has(input:checked) .box { background: var(--primary); border-color: var(--primary); color: #fff; }
.check-row.is-checked, .check-row:has(input:checked) { border-color: var(--primary); }
.form-status { min-height: 0; margin: 8px 0 0; color: var(--warn); font-weight: 600; }
.form-status:empty { margin: 0; }

/* ------------------------------------------------------------- consent / notes / lists */

.bullets { list-style: none; padding: 0; margin: 0 0 18px; display: flex; flex-direction: column; gap: 12px; }
.bullets li {
  display: flex; gap: 14px; align-items: flex-start; padding: 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); font-size: 16px; line-height: 1.45;
}
.bullet-icon { color: var(--primary-ink); margin-top: 1px; }
.note { display: flex; gap: 10px; align-items: flex-start; color: var(--muted); margin: 0 0 12px; }
.note-icon { width: 22px; height: 22px; color: var(--muted); margin-top: 1px; }

.steps { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 10px; counter-reset: s; }
.steps li { display: flex; gap: 12px; align-items: flex-start; line-height: 1.45; }
.steps .num {
  flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary-ink); font-size: 14px; font-weight: 750; margin-top: -1px;
}
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 6px; margin: 0 0 12px; }
.card-h { font-size: 16px; margin: 0 0 10px; font-weight: 700; }

.tips { list-style: none; padding: 0; margin: 0 0 18px; display: flex; flex-direction: column; gap: 10px; text-align: left; }
.tips li {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); line-height: 1.45;
}
.tip-icon { color: var(--primary-ink); }
.retry-date {
  display: flex; gap: 10px; align-items: flex-start; padding: 14px; border-radius: var(--radius);
  background: var(--surface); font-weight: 600; margin: 0 0 16px;
}

.link-box {
  margin: 0 0 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px dashed #C4C9D0;
  font-size: 14px; color: var(--muted); overflow-wrap: anywhere; user-select: all; -webkit-user-select: all;
}
.copy-feedback { min-height: 20px; margin: -2px 0 0; font-size: 14px; font-weight: 600; text-align: center; color: var(--ok); line-height: 20px; }
.copy-feedback[data-tone="warn"] { color: var(--warn); }

.qr { width: 232px; height: 232px; padding: 12px; margin: 8px auto 4px; background: #fff; border-radius: 20px; border: 1px solid var(--line); }
.qr svg { display: block; width: 208px; height: 208px; }

/* ------------------------------------------------------------- media placeholders */

.media-ph {
  position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center;
  color: rgba(255, 255, 255, .22);
  background: radial-gradient(120% 80% at 50% 30%, #6B4A3C 0%, #3A2A23 55%, #261C18 100%);
}
.media-ph svg { width: 78%; height: 82%; }
.live-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #1A1411; }
.mirror { transform: scaleX(-1); }

/* ------------------------------------------------------------- camera check */

.camera-check .title { margin-bottom: 12px; }
.cam-preview {
  position: relative; overflow: hidden; margin: 0 auto 12px; border-radius: 22px; background: #261C18;
  height: min(48vh, 420px); height: min(48dvh, 420px); aspect-ratio: 3 / 4; max-width: 100%;
}
.indicators { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; margin-bottom: 10px; }
.ind {
  display: flex; flex-direction: column; align-items: center; gap: 2px; height: 82px; padding: 8px 4px; justify-content: center;
  border-radius: 14px; background: var(--surface); border: 1.5px solid var(--line); text-align: center;
}
.ind-top { position: relative; display: block; width: 28px; height: 28px; margin-bottom: 2px; }
.ind-icon { width: 26px; height: 26px; color: var(--muted); }
.ind-badge {
  position: absolute; right: -9px; bottom: -4px; width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center; background: #9AA0A8; color: #fff; border: 2px solid var(--card);
}
.ind-badge .icon { width: 12px; height: 12px; }
.ind-badge svg { stroke-width: 3.2; }
.ind-label { font-weight: 700; font-size: 15px; line-height: 1.2; }
.ind-state { font-size: 12.5px; line-height: 1.2; color: var(--muted); white-space: nowrap; }
.ind[data-state="ok"] { border-color: #9FD9C2; background: var(--ok-soft); }
.ind[data-state="ok"] .ind-icon, .ind[data-state="ok"] .ind-state { color: var(--ok); }
.ind[data-state="ok"] .ind-badge { background: var(--ok); }
.ind[data-state="warn"] { border-color: #F5C08F; background: var(--warn-soft); }
.ind[data-state="warn"] .ind-icon, .ind[data-state="warn"] .ind-state { color: var(--warn); }
.ind[data-state="warn"] .ind-badge { background: var(--warn); }
.spinner {
  width: 10px; height: 10px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .5); border-top-color: #fff;
  animation: spin .8s linear infinite;
}
.coach {
  display: flex; align-items: center; justify-content: center; text-align: center;
  height: 48px; margin: 0; font-size: 16px; font-weight: 650; line-height: 1.35; color: var(--muted);
}
.coach[data-tone="ok"] { color: var(--ok); }
.coach[data-tone="warn"] { color: var(--warn); }

/* ------------------------------------------------------------- record (immersive) */

body.immersive { background: #1A1411; }
body.immersive #app { padding-top: 0; }
body.immersive .topbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 6; padding-top: env(safe-area-inset-top);
  height: calc(var(--header-h) + env(safe-area-inset-top));
  background: linear-gradient(rgba(0, 0, 0, .5), rgba(0, 0, 0, 0));
}
body.immersive .progress-seg { background: rgba(255, 255, 255, .3); transition: none; }
body.immersive .progress-seg[data-state="done"] { background: #fff; }
body.immersive .progress-seg[data-state="now"] { background: linear-gradient(90deg, #fff 50%, rgba(255, 255, 255, .3) 50%); }
body.immersive .progress-label { color: rgba(255, 255, 255, .85); }

.screen.record {
  position: relative; padding: 0; overflow: hidden; color: #fff; background: #1A1411;
  height: 100vh; height: 100dvh; flex: none;
}
.rec-stage { position: absolute; inset: 0; }
.rec-stage::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(rgba(0, 0, 0, .25), rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, .55));
}
.rec-ui {
  position: absolute; left: 0; right: 0; top: calc(var(--header-h) + env(safe-area-inset-top)); z-index: 3;
  padding: 0 12px;
}
.rec-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; min-width: 0; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px 0 4px; border-radius: 15px;
  background: rgba(0, 0, 0, .35); color: rgba(255, 255, 255, .8); font-size: 13px; font-weight: 650; white-space: nowrap;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.chip-num {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px;
  background: rgba(255, 255, 255, .22);
}
.chip[data-state="todo"], .chip[data-state="done"] { padding: 0 4px; }
.chip[data-state="todo"] .chip-label, .chip[data-state="done"] .chip-label { display: none; }
.chip-tick { display: none; width: 14px; height: 14px; }
.chip-tick svg { stroke-width: 3; }
.chip[data-state="done"] .chip-n { display: none; }
.chip[data-state="done"] .chip-tick { display: inline-flex; }
.chip[data-state="now"] { background: #fff; color: var(--ink); }
.chip[data-state="now"] .chip-num { background: var(--primary); color: #fff; }
.chip[data-state="done"] .chip-num { background: rgba(255, 255, 255, .9); color: var(--ink); }
.rec-pill {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 15px;
  background: rgba(0, 0, 0, .45); font-size: 13px; font-weight: 750; font-variant-numeric: tabular-nums;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, .5); }
.rec-pill[data-on="true"] .rec-dot { background: var(--rec); animation: blink 1.2s ease-in-out infinite; }
.rec-pill[data-on="false"] .rec-label { opacity: .6; }
.rec-time { min-width: 34px; text-align: right; }

.prompt-card {
  background: rgba(255, 255, 255, .95); color: var(--ink); border-radius: 18px; padding: 12px 16px 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
}
.prompt-part { margin: 0 0 4px; font-size: 13px; font-weight: 700; color: var(--primary-ink); text-transform: uppercase; letter-spacing: .04em; }
.prompt-text { margin: 0; font-size: 20px; line-height: 1.35; font-weight: 650; }
.prompt-sub { display: block; font-size: 15px; font-weight: 600; color: var(--muted); }
.prompt-text strong { font-weight: 750; }

.comments {
  position: absolute; z-index: 3; left: 12px; right: 64px; bottom: calc(96px + env(safe-area-inset-bottom));
  list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px;
}
.bubble {
  display: flex; align-items: flex-start; gap: 10px; align-self: flex-start; max-width: 100%;
  padding: 8px 14px 8px 8px; border-radius: 18px; background: rgba(20, 14, 11, .55);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  animation: slide-in .45s cubic-bezier(.2, .9, .3, 1.2) both;
}
.avatar {
  flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  font-size: 15px; font-weight: 750; color: #fff;
}
.bubble-body { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.bubble-name { font-size: 12.5px; font-weight: 700; color: rgba(255, 255, 255, .75); }
.bubble-text { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }

.rec-bottom {
  position: absolute; z-index: 4; left: 0; right: 0; bottom: 0;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
}
.rec-bottom[data-show="false"] { visibility: hidden; }
.rec-bottom[data-show="true"] .btn { animation: fade-up .3s ease-out both; }

.rec-overlay { position: absolute; inset: 0; z-index: 5; display: none; }
.rec-overlay[data-mode="start"], .rec-overlay[data-mode="countdown"] {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding: 0 24px calc(40px + env(safe-area-inset-bottom));
  background: linear-gradient(rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, .55));
}
.rec-overlay[data-mode="countdown"] { justify-content: center; background: rgba(0, 0, 0, .45); }
.start-wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.shutter {
  width: 96px; height: 96px; border-radius: 50%; border: 4px solid #fff; background: transparent; padding: 5px; cursor: pointer;
}
.shutter-inner {
  display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%;
  background: var(--pink-grad); color: #fff; font: 700 18px/1 var(--font-head); letter-spacing: .01em;
}
.shutter:active .shutter-inner { transform: scale(.94); }
.start-hint { margin: 0; max-width: 300px; font-size: 15px; line-height: 1.45; color: rgba(255, 255, 255, .92); font-weight: 600; }
.countdown { text-align: center; }
.count-label { margin: 0; font-size: 18px; font-weight: 700; opacity: .9; }
.count-num { display: block; font-size: 120px; line-height: 1.1; font-weight: 800; font-variant-numeric: tabular-nums; }
.count-num.pop { animation: pop .9s ease-out both; }

/* ------------------------------------------------------------- review / upload */

.review .lede { margin-bottom: 14px; }
.review-media {
  position: relative; overflow: hidden; margin: 0 auto 12px; border-radius: 20px; background: #261C18;
  height: min(46vh, 400px); height: min(46dvh, 400px); aspect-ratio: 9 / 16; max-width: 100%;
}
.review-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.review-player { position: absolute; inset: 0; }
.review-player[data-state="playing"] .review-video { object-fit: contain; }
.play-btn {
  position: absolute; left: 50%; top: 50%; width: 72px; height: 72px; margin: -36px 0 0 -36px; border-radius: 50%;
  border: 0; display: grid; place-items: center; background: rgba(255, 255, 255, .94); color: var(--ink); cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .3);
}
.play-btn .icon { width: 32px; height: 32px; margin-left: 4px; }
.review-player[data-state="playing"] .play-btn, .review-player[data-state="playing"] .dur-badge { display: none; }
.review-ph { position: absolute; inset: 0; }
.play-badge {
  position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255, 255, 255, .92); color: var(--ink);
}
.play-badge .icon { width: 28px; height: 28px; margin-left: 3px; }
.dur-badge {
  position: absolute; right: 10px; bottom: 10px; padding: 2px 8px; border-radius: 8px; background: rgba(0, 0, 0, .55);
  color: #fff; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.quiet-line { margin: 0; height: 22px; font-size: 14px; color: var(--muted); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quiet-line[data-tone="warn"] { color: var(--warn); }

.up-box { margin: 6px 0 18px; }
.bar { height: 12px; border-radius: 6px; background: var(--line); overflow: hidden; }
.bar-fill { display: block; height: 100%; width: 0; border-radius: 6px; background: var(--primary); transition: width .4s ease; }
.up-row { display: flex; justify-content: space-between; margin-top: 10px; font-variant-numeric: tabular-nums; }
.up-pct { font-size: 22px; font-weight: 800; }
.up-mb { color: var(--muted); font-size: 15px; align-self: flex-end; }
.offline {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: var(--radius);
  background: var(--warn-soft); color: #5C2D00; min-height: 96px;
}
.offline[data-show="false"] { visibility: hidden; }
.offline p { margin: 2px 0 0; font-size: 15px; line-height: 1.45; }
.offline-icon { color: var(--warn); }

/* ------------------------------------------------------------- reviewing / results */

.reviewing .content, .approved .content, .blocked .content { padding-bottom: 12vh; }
.pulse { position: relative; width: 120px; height: 120px; margin-bottom: 18px; }
.pulse > span:not(.pulse-core) {
  position: absolute; inset: 0; border-radius: 50%; background: var(--primary); opacity: 0;
  animation: ripple 2.4s ease-out infinite;
}
.pulse > span:nth-child(2) { animation-delay: 1.2s; }
.pulse-core {
  position: absolute; inset: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--pink-grad); color: #fff; box-shadow: 0 8px 20px rgba(255, 18, 130, .35);
}
.pulse-core .icon { width: 32px; height: 32px; animation: spin 6s linear infinite; }
.confetti { position: relative; padding: 8px; }
.confetti::before, .confetti::after {
  content: ""; position: absolute; width: 10px; height: 10px; border-radius: 3px; background: #F2B33D; top: 6px; left: -8px;
  transform: rotate(20deg);
}
.confetti::after { background: var(--primary); left: auto; right: -6px; top: 30px; width: 8px; height: 8px; border-radius: 50%; }
.result .title { margin-top: 10px; }
.approved .title { font-size: 30px; }

/* ------------------------------------------------------------- animations */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 50% { opacity: .35; } }
@keyframes slide-in { from { opacity: 0; transform: translate(-16px, 14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(1.5); opacity: 0; } 25% { transform: scale(1); opacity: 1; } 85% { opacity: 1; } 100% { opacity: .2; } }
@keyframes ripple { 0% { transform: scale(.45); opacity: .35; } 100% { transform: scale(1.15); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* Short screens (e.g. 360x640 with browser chrome): tighten vertical rhythm. */
@media (max-height: 680px) {
  .title { font-size: 23px; }
  .welcome .title { font-size: 25px; }
  .greeting { margin-top: 14px; }
  .part { padding: 9px 12px; }
  .hero { width: 52px; height: 52px; margin-top: 4px; }
}
.review-ph .media-ph { color: rgba(255, 255, 255, .12); }
.shutter:disabled { opacity: .55; cursor: default; }
.start-hint[data-tone="warn"] { color: #FFD9A8; }
.prompt-topic { display: block; margin-top: 2px; font-size: 22px; line-height: 1.3; }
.review .muted.small { text-align: center; margin: 0 0 6px; }

/* ============================================================= FRND brand layer */

@font-face {
  font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(/static/fonts/poppins-latin-600.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212;
}
@font-face {
  font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(/static/fonts/poppins-latin-700.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212;
}

/* headings + buttons in Poppins, body stays on the system stack */
.title { font-family: var(--font-head); font-weight: 700; color: var(--heading); letter-spacing: -0.015em; }
.card-h, .part-text strong, .live-badge, .chip, .rec-pill, .count-num, .up-pct { font-family: var(--font-head); }
.card-h { font-weight: 600; color: var(--heading); }
.btn { font-family: var(--font-head); font-weight: 600; }
.btn-primary { font-weight: 700; font-size: 19px; letter-spacing: .005em; }  /* >= 18.66 px bold: large text, 3:1 rule */
.btn-primary:active { background: var(--primary-press); }
.btn-secondary { color: var(--heading); font-size: 17px; }
.btn-link { color: var(--pink-text); font-family: var(--font); }
.seg-btn, .lang-btn { font-family: var(--font-head); font-weight: 600; }
.greeting { color: var(--pink-text); }
.field-error { color: var(--error); }
.text-input[aria-invalid="true"] { border-color: var(--error); }
.choice-check { color: var(--pink-text); }
.ind[data-state="ok"] .ind-icon { color: var(--ok-icon); }
.ind[data-state="ok"] .ind-badge { background: var(--ok-icon); }
.ind[data-state="warn"] .ind-icon { color: var(--warn-icon); }
.ind[data-state="warn"] .ind-badge { background: var(--warn-icon); }
.hero-alert { color: var(--warn-icon); }
.hero-ok { color: var(--ok-icon); }
.offline-icon { color: var(--warn-icon); }
.bar-fill { background: var(--pink-grad); }
.chip[data-state="now"] .chip-num { background: var(--pink-grad); }
.prompt-part { color: var(--pink-text); }
.prompt-text { color: var(--ink); }
.prompt-sub { color: var(--muted); }

/* ------------------------------------------------------------- header: small pink wordmark, language, progress */

.wordmark {
  display: inline-block; flex: none; background: currentColor;
  -webkit-mask: url(/static/brand/frnd-wordmark.svg) center / contain no-repeat;
  mask: url(/static/brand/frnd-wordmark.svg) center / contain no-repeat;
}
.wordmark-sm { width: 54px; height: 25px; color: var(--pink); }
.wordmark-lg { width: 118px; height: 55px; color: #fff; }
.wordmark-md { width: 84px; height: 39px; color: #fff; }

.topbar { height: auto; display: block; padding: 0 var(--pad) 8px; }
.topbar-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 52px; }
.topbar .progress { width: 100%; }
.lang-btn { margin-left: auto; }

/* result screens: the header floats over the pink band */
body.band-mode .topbar { position: absolute; top: 0; left: 0; right: 0; z-index: 5; padding-top: env(safe-area-inset-top); }
body.band-mode .topbar .wordmark-sm { visibility: hidden; }
body.band-mode .progress-seg { background: rgba(255, 255, 255, .35); }
body.band-mode .progress-seg[data-state="done"] { background: #fff; }
body.band-mode .progress-label {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0;
}
body.band-mode .lang-btn { border-color: transparent; color: var(--ink); }

/* record screen: dark and immersive, progress only */
body.immersive .topbar-row { display: none; }
body.immersive .topbar { padding-top: calc(12px + env(safe-area-inset-top)); }

/* ------------------------------------------------------------- pink band + white sheet (welcome, results) */

.screen.banded { padding: 0; }
.band {
  position: relative; overflow: hidden; color: #fff; text-align: center;
  background-color: var(--pink); background-image: var(--pink-grad);
  padding: 12px var(--pad) 40px;
}
.band::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .16;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 360 420' fill='none' stroke='%23fff' stroke-width='5'%3E%3Cpath d='M-20 60c60-30 110 20 170-10s90-60 150-30 60 50 80 40'/%3E%3Cpath d='M-20 110c70-20 100 40 180 10s100-70 170-30'/%3E%3Cpath d='M40 420c-10-60 50-90 30-150s-90-60-60-120 100-40 120-90'/%3E%3Cpath d='M380 250c-60 0-80 60-140 50s-60-80-120-70-80 70-140 60'/%3E%3Cpath d='M300 420c10-50-30-80 0-120s70-30 80-70'/%3E%3Cellipse cx='280' cy='170' rx='46' ry='30'/%3E%3Cellipse cx='280' cy='170' rx='22' ry='12'/%3E%3C/svg%3E") center / cover no-repeat;
}
.band > * { position: relative; }
.band .title { color: #fff; font-size: 27px; margin: 6px 0 0; }          /* 27 px bold white on pink: large text */
.band .greeting { color: #fff; font: 700 20px/1.3 var(--font-head); margin: 14px 0 0; }   /* 20 px bold: large text */
.band-mark { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.sheet {
  position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column;
  margin-top: -24px; padding: 22px var(--pad) 0; background: var(--bg); border-radius: 24px 24px 0 0;
}
.sheet .content { flex: 1; }

.welcome .band { padding-top: calc(12px + env(safe-area-inset-top)); }
.welcome .welcome-top { justify-content: flex-end; padding-top: 0; margin-bottom: 6px; }
.welcome .seg-toggle { background: rgba(28, 7, 86, .35); }
.welcome .seg-btn { color: #fff; }
.welcome .seg-btn[aria-pressed="true"] { background: #fff; color: var(--ink); }
.live-badge { border: 0; color: var(--pink-text); padding: 5px 12px; }
.welcome .title { font-size: 26px; }
.welcome .sheet .lede { margin-bottom: 14px; }
.welcome .parts { gap: 8px; }
.welcome .part { padding: 10px 12px; background: var(--surface); border-color: transparent; }

/* results */
.result .band { padding-top: calc(70px + env(safe-area-inset-top)); padding-bottom: 44px; }
.result-badge {
  width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; margin: 14px auto 0;
  background: #fff; color: var(--pink-text); box-shadow: 0 8px 24px rgba(28, 7, 86, .25);
}
.result-badge .icon { width: 38px; height: 38px; }
.approved .result-badge { color: var(--ok-icon); box-shadow: 0 0 0 6px var(--yellow), 0 10px 26px rgba(28, 7, 86, .3); }
.not-this-time .result-badge { color: var(--purple); }
.result .sheet .content { text-align: left; }
.approved .sheet .content { text-align: center; }
.confetti-dots { position: absolute; inset: 0; pointer-events: none; }
.confetti-dots i { position: absolute; display: block; width: 10px; height: 10px; border-radius: 3px; background: var(--yellow); }
.confetti-dots i:nth-child(1) { left: calc(50% - 74px); top: 44%; transform: rotate(20deg); }
.confetti-dots i:nth-child(2) { left: calc(50% + 62px); top: 40%; width: 8px; height: 8px; border-radius: 50%; }
.confetti-dots i:nth-child(3) { left: calc(50% + 50px); top: 62%; width: 7px; height: 7px; border-radius: 50%; background: #fff; }
.confetti-dots i:nth-child(4) { left: calc(50% - 60px); top: 63%; transform: rotate(-25deg); }
.confetti-dots i:nth-child(5) { left: calc(50% - 94px); top: 54%; width: 6px; height: 6px; border-radius: 50%; background: #fff; }
.confetti-dots i:nth-child(6) { left: calc(50% + 86px); top: 53%; width: 6px; height: 12px; border-radius: 3px; transform: rotate(30deg); }

@media (max-height: 680px) {
  .wordmark-lg { width: 96px; height: 45px; }
  .band .title { font-size: 24px; }
}

/* contrast: text over live video assumes the worst case (a white frame behind the scrim) */
.text-input::placeholder { color: #6E7177; }                         /* 4.89:1 */
.chip { background: rgba(0, 0, 0, .55); color: #fff; }                /* white on worst-case #737373: 4.74:1 */
.chip-num { background: transparent; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .75); }
.chip[data-state="done"] .chip-num { background: rgba(255, 255, 255, .92); box-shadow: none; }
.chip[data-state="now"] .chip-num { background: var(--pink-text); box-shadow: none; }   /* white 12 px on #D4006B: 5.23:1 */
.rec-pill { background: rgba(0, 0, 0, .6); }                          /* white on worst-case #666: 5.74:1 */
.rec-pill[data-on="false"] .rec-label { opacity: 1; }
.bubble { background: rgba(20, 14, 11, .65); }                        /* white on worst-case #666260: 6.03:1 */
.bubble-name { color: rgba(255, 255, 255, .88); }
.dur-badge { background: rgba(0, 0, 0, .62); }                        /* white on worst-case #616161: 6.19:1 */
body.immersive .topbar { background: linear-gradient(rgba(0, 0, 0, .62), rgba(0, 0, 0, .6) 75%, rgba(0, 0, 0, 0)); }
body.immersive .progress-label { color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
.camera-check.has-anyway .cam-preview { height: min(40vh, 360px); height: min(40dvh, 360px); }
.camera-check .actions .btn-link { margin-top: -4px; }

/* ------------------------------------------------------------- FRND Radio (/radio) */

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.field-note { margin: 8px 0 0; }

.choice-cards { display: flex; flex-direction: column; gap: 10px; }
.choice-card {
  position: relative; display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 12px 40px 12px 14px;
  border-radius: 16px; background: var(--surface); border: 1.5px solid var(--line); cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.choice-card-icon {
  flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
  background: var(--card); color: var(--primary-ink);
}
.choice-card-text { display: flex; flex-direction: column; line-height: 1.35; }
.choice-card-text strong { font-size: 17px; }
.choice-card-text span { font-size: 14px; color: var(--muted); }
.choice-card .choice-check { position: absolute; right: 12px; top: 50%; margin-top: -12px; color: var(--primary); opacity: 0; }
.choice-card.is-checked, .choice-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.choice-card.is-checked .choice-check, .choice-card:has(input:checked) .choice-check { opacity: 1; }
.choice-card:focus-within { outline: 3px solid #A48CF0; outline-offset: 1px; }

.mic-check .content { display: flex; flex-direction: column; }
.mic-hero { display: flex; justify-content: center; margin: 12px 0 20px; }
.mic-meter { height: 14px; border-radius: 7px; background: var(--line); overflow: hidden; margin: 0 0 14px; }
.mic-meter-fill { display: block; height: 100%; width: 0; border-radius: 7px; background: var(--ok-icon); transition: width .12s linear; }
.mic-ind { max-width: 160px; margin: 0 auto 10px; }

.radio-stage {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  background: radial-gradient(circle at 50% 42%, #3A1C6E 0, #1C0756 45%, #120438 100%);
}
.onair-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, .14); font: 700 14px/1 var(--font-head); letter-spacing: .08em; text-transform: uppercase;
}
.onair-mic {
  display: grid; place-items: center; width: 112px; height: 112px; border-radius: 50%;
  background: var(--pink-grad); box-shadow: 0 0 0 10px rgba(255, 18, 130, .18), 0 0 0 22px rgba(255, 18, 130, .08);
}
.onair-mic .icon { width: 52px; height: 52px; color: #fff; }
.onair-bars { display: flex; align-items: center; gap: 6px; height: 48px; }
.onair-bars span { display: block; width: 8px; height: 48px; border-radius: 4px; background: rgba(255, 255, 255, .85); transform: scaleY(.08); transition: transform .08s linear; }
.radio-record.voice .rec-stage::after { display: none; }
.radio-record.voice .radio-stage { justify-content: flex-start; padding-top: var(--stage-top, 120px); }
.onair-group { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.radio-record .chips { gap: 4px; }
.radio-record .chip .chip-label { display: none; }             /* five parts: the prompt card names the part */
.radio-record .chip[data-state="now"] { padding: 0 4px; }
.quiet-badge {
  position: absolute; z-index: 3; left: 12px; bottom: calc(104px + env(safe-area-inset-bottom)); margin: 0;
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 18px;
  background: rgba(20, 14, 11, .65); color: rgba(255, 255, 255, .92); font-weight: 650;
}
.quiet-badge .icon { width: 20px; height: 20px; }

.review-audio { margin: 0 0 12px; }
.audio-card {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--line);
}
.audio-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--pink-grad); color: #fff; }
.audio-body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.audio-title { font-weight: 700; }
.audio-dur { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.review-audio-el { width: 100%; height: 44px; }
.radio-audio { flex-wrap: nowrap; }
.radio-audio .review-audio-el { display: none; }

/* radio review player: a round play / pause / replay button wrapped in its progress ring */
.ap-play {
  position: relative; flex: none; display: grid; place-items: center; width: 56px; height: 56px; padding: 0; border: 0;
  border-radius: 50%; background: var(--pink-grad); color: #fff; cursor: pointer;
}
.ap-ring { position: absolute; inset: -6px; pointer-events: none; }
.ap-ring svg { display: block; width: 100%; height: 100%; transform: rotate(-90deg); }
.ap-track { fill: none; stroke: var(--line); stroke-width: 4; }
.ap-arc { fill: none; stroke: var(--primary); stroke-width: 4; stroke-linecap: round; }
.ap-play[data-progress="0.000"] .ap-arc { stroke: transparent; }
.ap-glyph { display: grid; place-items: center; }
.ap-glyph .icon { width: 24px; height: 24px; }
.ap-play[data-state="idle"] .ap-glyph .icon, .ap-play[data-state="paused"] .ap-glyph .icon { margin-left: 3px; }
.ap-time { font-variant-numeric: tabular-nums; }
.radio-player .ap-play {
  position: absolute; left: 50%; top: 50%; width: 72px; height: 72px; margin: -36px 0 0 -36px;
  background: rgba(255, 255, 255, .94); color: var(--ink); box-shadow: 0 6px 18px rgba(0, 0, 0, .3);
}
.radio-player .ap-glyph .icon { width: 30px; height: 30px; }
.radio-player .ap-track { stroke: rgba(255, 255, 255, .35); }
.radio-player[data-state="playing"] .ap-play { left: 14px; top: auto; bottom: 14px; width: 48px; height: 48px; margin: 0; }
.radio-player[data-state="playing"] .ap-glyph .icon { width: 22px; height: 22px; }
.radio-player[data-state="playing"] .review-video { object-fit: contain; }
.radio-player .ap-time {
  position: absolute; right: 10px; bottom: 10px; padding: 2px 8px; border-radius: 8px; background: rgba(0, 0, 0, .62);
  color: #fff; font-size: 13px; font-weight: 700;
}

.otp-input { font-size: 26px; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }
.form-status[data-tone="ok"] { color: var(--ok); }
.form-status[data-tone="neutral"] { color: var(--muted); }
.radio-verify .actions .btn-link { margin-top: -4px; }
.radio-verify .hero { margin-bottom: 4px; }


.radio-access .sheet .content { text-align: center; }
.radio-access .actions .btn { text-decoration: none; }

/* radio UX review fixes */
:root { --danger: #B42318; }                                   /* errors on radio screens: 6.4:1 on white */
body[data-track="radio"] .field-error, body[data-track="radio"] .form-status[data-tone="warn"],
body[data-track="radio"] .form-status:not([data-tone]) { color: var(--danger); }
body[data-track="radio"] .btn-link:disabled { color: var(--muted); text-decoration: none; cursor: default; }
body[data-track="radio"] .about .choices label:has(input[name="gender"][value="prefer_not_to_say"]) { grid-column: 1 / -1; }

/* voice only: the studio is the same size in every part; listener messages stay in the band below it (layoutStage) */
.radio-record.voice .comments { overflow: hidden; }            /* whole messages only (fitMessages) */
.radio-record[data-phase="countdown"] .radio-stage > * { visibility: hidden; }

/* Radio intro video (first radio screen): portrait 9:16, fits the screen above the Start button. */
.radio-intro .content { display: flex; justify-content: center; }
.intro-frame { width: 100%; max-width: 420px; margin: 0 auto; aspect-ratio: 9 / 16; max-height: calc(100dvh - 190px);
  border-radius: 18px; overflow: hidden; background: #fff; box-shadow: 0 6px 24px rgba(28, 7, 86, .12); }
.intro-video { display: block; width: 100%; height: 100%; object-fit: contain; background: #fff; }

/* Radio review: the number and the WhatsApp consent come before Submit in the page, never under a sticky Submit bar
   (with the camera on, the video pushes them below the fold at 360 px). The actions follow the form; on a tall
   screen they still sit at the bottom (.content grows). */
body[data-track="radio"] .screen.review .actions { position: static; }
