/* FamDay tester feedback. Colors and type match the FamDay app (rthms-app apps/famday). */

:root {
  color-scheme: light;
  --floor: #fdf8f2;
  --fill: #f5f0ea;
  --surface: #ffffff;
  --line: #e7e2dc;
  --line-strong: #d6d0c7;
  --ink: #1a2250;
  --ink-2: #544f47;
  --ink-3: #6e6860;
  --ring: #8b857d;
  --coral: #ff6a3d;
  --coral-ink: #a83101;
  --coral-soft: #fecec1;
  --coral-pale: #ffe7e0;
  --sun: #fec858;
  --sun-pale: #fff0d6;
  --road: #073bc9;
  --warn-bg: #fff1d6;
  --warn-ink: #80540a;
  --display: "Nunito", system-ui, sans-serif;
  --body: "Figtree", system-ui, sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --kb: 0px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--floor);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--coral-ink); }
a:hover { color: #7f2403; }

button { font-family: inherit; color: inherit; cursor: pointer; }
button, a { touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid var(--road);
  outline-offset: 2px;
}
textarea:focus, textarea:focus-visible { outline: none; }
::placeholder { color: var(--ink-3); opacity: 1; }

.page {
  max-width: 600px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 20px 20px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

/* ---------- Top ---------- */

.brand { display: flex; align-items: center; gap: 10px; height: 40px; flex: none; }
.brand .icon { width: 36px; height: 36px; border-radius: 10px; display: block; }
.brand .word { height: 22px; width: auto; display: block; }
.brand .count { margin-left: auto; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.brand .back {
  margin-left: auto; height: 44px; padding: 0 10px; border: 0; border-radius: 999px;
  background: transparent; font-size: 15px; font-weight: 600; color: var(--ink-2);
}
.brand .back + .count { margin-left: 0; }

.view { flex: 1; display: flex; flex-direction: column; }

.intro { margin-top: 32px; display: flex; flex-direction: column; gap: 10px; }
.eyebrow { margin: 0; font-size: 15px; font-weight: 600; color: var(--coral-ink); }

h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 900;
  font-size: 38px;
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
h1.question { font-size: 30px; line-height: 1.12; letter-spacing: -0.015em; }
.mark { box-shadow: inset 0 -0.36em 0 var(--sun); }
.sub { margin: 0; color: var(--ink-2); }

/* ---------- Composer ---------- */

.composer {
  margin-top: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: 0 1px 2px rgba(26, 34, 80, 0.04), 0 14px 32px -14px rgba(26, 34, 80, 0.14);
  overflow: hidden;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.composer:focus-within {
  border-color: var(--ink);
  box-shadow: 0 1px 2px rgba(26, 34, 80, 0.04), 0 14px 32px -14px rgba(26, 34, 80, 0.22);
}
.composer.drop { border-color: var(--road); border-style: dashed; }

.composer-text {
  display: block;
  width: 100%;
  min-height: 132px;
  max-height: 46dvh;
  border: 0;
  resize: none;
  padding: 20px 20px 8px;
  background: transparent;
  font: inherit;
  font-size: 18px;
  color: inherit;
}

.composer.has-files .composer-text { min-height: 84px; }

.voices { display: flex; flex-direction: column; gap: 8px; padding: 4px 20px 8px; }
.voice {
  display: flex; align-items: center; gap: 10px;
  height: 52px; padding: 0 6px 0 8px;
  border-radius: 999px; background: var(--fill);
  animation: pop 0.24s var(--ease) both;
}
.voice .play {
  flex: none; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%;
  background: var(--ink); color: #fff; display: grid; place-items: center;
}
.voice .label { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.voice .time { flex: none; font-size: 15px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.voice .drop-it {
  flex: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: var(--ink-2); display: grid; place-items: center;
}
.voice[data-state="uploading"] .label { color: var(--ink-2); }
.voice[data-state="failed"] { background: var(--warn-bg); color: var(--warn-ink); }
.voice[data-state="failed"] .play { background: var(--warn-ink); }

.shots {
  display: flex; gap: 16px;
  margin: 0; padding: 14px 20px 16px;
  list-style: none; overflow-x: auto; scrollbar-width: none;
}
.shots::-webkit-scrollbar { display: none; }
.shot { position: relative; flex: none; width: 60px; height: 104px; animation: pop 0.24s var(--ease) both; }
.shot .pic {
  display: block; width: 100%; height: 100%;
  object-fit: cover; border-radius: 12px;
  border: 1px solid var(--line); background: var(--fill);
}
.shot .pic.blank { display: grid; place-items: center; color: var(--ink-3); }
.shot .dur {
  position: absolute; left: 5px; bottom: 5px;
  padding: 1px 5px; border-radius: 6px;
  background: #fff; color: var(--ink);
  font-size: 11px; font-weight: 700; line-height: 1.4;
}
.shot .veil {
  position: absolute; inset: 0; padding: 0; border: 0; border-radius: 12px;
  background: rgba(255, 255, 255, 0.76);
  display: grid; place-items: center; color: var(--ink);
}
.shot[data-state="done"] .veil { display: none; }
.shot[data-state="failed"] .veil { background: rgba(255, 241, 214, 0.92); color: var(--warn-ink); }
.shot .ring { transform: rotate(-90deg); }
.shot .ring .track { stroke: var(--line); }
.shot .ring .bar { stroke: var(--ink); transition: stroke-dashoffset 0.2s linear; }
.shot .x {
  position: absolute; top: -17px; right: -17px;
  width: 44px; height: 44px; padding: 0; border: 0;
  background: transparent; display: grid; place-items: center;
}
.shot .x span {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--ink); color: #fff; box-shadow: 0 0 0 2px #fff;
  display: grid; place-items: center;
}

.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: 16px;
  background: var(--warn-bg); color: var(--warn-ink);
  font-size: 15px; line-height: 1.4;
  animation: rise 0.3s var(--ease) both;
}
.alert svg { flex: none; margin-top: 1px; }
.alert strong { font-weight: 700; }
.composer .alert { margin: 0 12px 12px; }

.tools {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 12px; border-top: 1px dashed var(--line-strong);
}
.tool {
  display: inline-flex; align-items: center; gap: 7px;
  height: 44px; padding: 0 12px; border: 0; border-radius: 999px;
  background: var(--fill); font-weight: 600; font-size: 14.5px;
  transition: transform 0.12s ease, background-color 0.18s ease;
}
.tool:active, .btn:active, .choice:active { transform: scale(0.97); }
.tools .hint { display: none; margin-left: auto; padding: 0 8px; font-size: 14px; color: var(--ink-3); }

.rec { animation: rise 0.3s var(--ease) both; }
.rec-body {
  min-height: 236px; padding: 20px 20px 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 14px;
}
.rec-state { align-self: flex-start; display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: var(--coral-ink); }
.rec-state i { width: 10px; height: 10px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 4px var(--coral-pale); animation: pulse 1.4s ease-in-out infinite; }
.rec-clock { font-family: var(--display); font-weight: 900; font-size: 56px; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.rec-bars { display: flex; align-items: center; gap: 4px; height: 48px; }
.rec-bars span { width: 4px; height: 6px; border-radius: 2px; background: var(--coral); transition: height 0.12s ease; }
.rec-hint { margin: 0; text-align: center; font-size: 15px; color: var(--ink-2); }
.rec-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px; border-top: 1px dashed var(--line-strong); }
.rec-cancel { height: 44px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-2); font-weight: 600; font-size: 15px; }
.rec-done { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 20px; border: 0; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 600; font-size: 15px; }
.rec-done i { width: 10px; height: 10px; border-radius: 3px; background: #fff; }

/* ---------- From, send ---------- */

.from {
  margin-top: 12px; flex: none;
  display: flex; align-items: center; gap: 12px;
  height: 56px; padding: 0 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  transition: border-color 0.18s ease;
}
.from:focus-within { border-color: var(--ink); }
.from label { font-size: 15px; font-weight: 600; color: var(--ink-3); }
.from input {
  flex: 1; min-width: 0; height: 44px; border: 0; background: transparent;
  font: inherit; font-weight: 500; color: inherit; outline: none;
}

.actions {
  margin-top: auto;
  position: sticky; bottom: var(--kb);
  display: flex; flex-direction: column; gap: 14px;
  padding-top: 24px;
  background: linear-gradient(to bottom, rgba(253, 248, 242, 0), var(--floor) 18px);
}
.actions.row { flex-direction: row; align-items: center; gap: 8px; flex-wrap: wrap; }
.actions.row .alert { flex: 1 0 100%; }
body.kb .actions { padding-bottom: 10px; }
body.kb .actions .fine { display: none; }

.btn {
  display: flex; align-items: center; justify-content: center;
  height: 56px; padding: 0 24px; border: 0; border-radius: 999px;
  background: var(--coral); color: var(--ink);
  box-shadow: 0 12px 24px -12px rgba(207, 69, 22, 0.7);
  font-family: var(--display); font-weight: 900; font-size: 19px;
  text-decoration: none;
  transition: transform 0.12s ease, background-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}
a.btn:hover { color: var(--ink); }
.btn[aria-disabled="true"] {
  background: var(--fill); color: var(--ink-3);
  box-shadow: inset 0 0 0 1px var(--line); cursor: default;
}
.btn.busy { background: var(--coral-soft); box-shadow: none; cursor: default; }
.btn.grow { flex: 1; }
.quiet {
  height: 56px; padding: 0 22px; border: 0; border-radius: 999px;
  background: transparent; color: var(--ink-2); font-weight: 600; font-size: 17px;
}
.fine { margin: 0; text-align: center; font-size: 14px; line-height: 1.4; color: var(--ink-3); }

/* ---------- Sent ---------- */

.thanks { margin-top: 72px; display: flex; flex-direction: column; gap: 20px; }
.badge {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--sun); box-shadow: 0 0 0 8px var(--sun-pale);
  display: grid; place-items: center;
  animation: pop 0.3s var(--ease) both;
}
.thanks .words { display: flex; flex-direction: column; gap: 10px; animation: rise 0.38s var(--ease) both; }

.recap {
  margin-top: 28px; display: flex; flex-direction: column; gap: 12px;
  padding: 16px 18px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 24px;
  animation: rise 0.38s var(--ease) 0.08s both;
}
.recap .meta { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.recap .said { margin: 0; font-size: 16px; white-space: pre-line; overflow-wrap: anywhere; max-height: 8.7em; overflow: hidden; }
.recap .extras { padding-top: 12px; border-top: 1px dashed var(--line-strong); font-size: 14px; font-weight: 500; color: var(--ink-2); }

.row-link {
  margin-top: 12px; display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 24px;
  color: var(--ink); text-decoration: none;
  animation: rise 0.38s var(--ease) 0.14s both;
}
.row-link:hover { color: var(--ink); border-color: var(--ink); }
.row-link .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-link b { font-size: 16px; font-weight: 700; }
.row-link small { font-size: 14px; color: var(--ink-2); }

.stack { margin-top: auto; padding-top: 24px; display: flex; flex-direction: column; gap: 6px; }
.text-link { display: flex; align-items: center; justify-content: center; height: 48px; font-size: 16px; font-weight: 600; text-decoration: none; }

/* ---------- Questions ---------- */

.progress { margin-top: 16px; display: flex; gap: 6px; flex: none; }
.progress span { flex: 1; height: 6px; border-radius: 3px; background: var(--line); transition: background-color 0.3s ease; }
.progress span.on { background: var(--coral); }

.q { display: flex; flex-direction: column; animation: rise 0.34s var(--ease) both; }
.q .intro { margin-top: 28px; }

.choices { margin-top: 24px; display: flex; flex-direction: column; gap: 10px; }
.choice {
  display: flex; align-items: center; gap: 14px;
  width: 100%; height: 60px; padding: 0 18px;
  background: var(--surface); border: 0; border-radius: 20px;
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 17px; font-weight: 600; text-align: left;
  transition: transform 0.12s ease, box-shadow 0.18s ease;
}
.choice .dot {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--ring); display: grid; place-items: center; color: transparent;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}
.choice[aria-checked="true"] { box-shadow: inset 0 0 0 2px var(--ink); font-weight: 700; }
.choice[aria-checked="true"] .dot { background: var(--ink); border-color: var(--ink); color: #fff; }
.escape {
  align-self: flex-start; margin-top: 6px; height: 48px; padding: 0 4px; border: 0;
  background: transparent; color: var(--coral-ink);
  font-size: 15px; font-weight: 600; text-decoration: underline;
}
.escape[aria-checked="true"] { color: var(--ink); text-decoration-thickness: 2px; }

/* ---------- Motion ---------- */

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: none; } }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(255, 231, 224, 0.5); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Wider screens ---------- */

@media (min-width: 700px) {
  .page { padding-top: 28px; padding-bottom: 48px; }
  .intro { margin-top: 64px; gap: 12px; }
  h1 { font-size: 48px; }
  h1.question { font-size: 36px; }
  .sub { font-size: 18px; }
  .composer { margin-top: 28px; }
  .composer-text { min-height: 190px; padding: 24px 24px 12px; }
  .tools .hint { display: block; }
  .actions, .stack { margin-top: 0; position: static; }
  .thanks { margin-top: 96px; }
}
