/* App shell: one thing per screen, large targets, calm. Inherits tokens from /css/style.css */

body.app { font-size: 19px; }

.app-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px max(16px, env(safe-area-inset-left));
  background: rgba(251, 246, 238, 0.9); backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(59, 47, 42, 0.08);
}
.app-header-actions { display: flex; align-items: center; gap: 10px; }

.app-main { width: min(640px, 100% - 32px); margin: 0 auto; padding: 24px 0 80px; }
.screen { animation: fade .25s ease; }
.hidden { display: none !important; }
.center { text-align: center; }
.mt { margin-top: 40px; }
.muted { color: var(--ink-soft); }
.tip { background: #f3eadb; border-inline-start: 4px solid var(--gold); padding: 12px 16px; border-radius: 12px; color: var(--ink-soft); font-size: .95rem; }

@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

h1 { font-size: clamp(1.9rem, 5vw, 2.5rem); margin-bottom: .4em; }
h2 { text-align: start; font-size: 1.5rem; margin-bottom: .3em; }
h3 { font-size: 1.15rem; margin: 0 0 .15em; }

.card-lg { background: var(--white); border-radius: 24px; padding: 32px 28px; box-shadow: var(--shadow); }
.big-icon { font-size: 56px; margin-bottom: 8px; }

/* Forms */
label { display: block; font-weight: 600; margin: 18px 0 8px; }
input[type="text"], input[type="email"], input[type="tel"], input[type="date"], .select {
  width: 100%; font: inherit; font-size: 1.1rem; padding: 16px 18px; border-radius: 14px;
  border: 1.5px solid rgba(59, 47, 42, 0.2); background: var(--white); color: var(--ink);
}
input:focus, .select:focus { outline: 3px solid rgba(200, 100, 58, 0.35); outline-offset: 1px; border-color: var(--terracotta); }
form .btn-block { margin-top: 22px; }
.phone-row { display: grid; grid-template-columns: minmax(130px, 42%) 1fr; gap: 8px; }
.phone-row .select { padding-inline: 10px; }
.btn-retry { background: var(--gold); color: var(--ink); }
.btn-xl { padding: 18px 32px; font-size: 1.15rem; }
.btn-danger { background: transparent; color: #a33; box-shadow: inset 0 0 0 1.5px rgba(170, 51, 51, 0.4); }
.btn-danger:hover { background: rgba(170, 51, 51, 0.06); }
.btn:disabled { opacity: .55; cursor: wait; }
.or { display: flex; align-items: center; gap: 12px; color: var(--ink-soft); margin: 20px 0; font-size: .9rem; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: rgba(59, 47, 42, 0.15); }
.stack { display: grid; gap: 10px; margin-top: 20px; }
.form-msg { min-height: 1.5em; color: var(--terracotta-dark); margin-top: 12px; }
.form-msg.ok { color: var(--sage); }

.back { background: none; border: 0; font: inherit; color: var(--ink-soft); padding: 0; margin-bottom: 18px; cursor: pointer; }
.back:hover { color: var(--ink); }

/* Home */
.home-top { text-align: center; margin-bottom: 28px; }
.btn-checkin { width: 100%; max-width: 360px; font-size: 1.35rem; padding: 22px 32px; gap: 10px; }
.btn-checkin .check { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.25); }
.btn-checkin.done { background: var(--sage); }
.banner-calm { background: #e9efe6; border-radius: 16px; padding: 16px 20px; margin-bottom: 22px; display: grid; gap: 4px; color: #3f4f3e; }

.path { list-style: none; padding: 0; margin: 0 0 32px; display: grid; gap: 12px; }
.path-step {
  display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 14px;
  background: var(--white); border-radius: 18px; padding: 16px 18px; box-shadow: var(--shadow);
}
.path-num {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--gold); color: var(--ink); font-family: var(--font-display); font-weight: 600; font-size: 1.2rem;
}
.path-step.done .path-num { background: var(--sage); color: var(--white); }
.path-step.done .path-num::before { content: "✓"; }
.path-step.done .path-num { font-size: 0; }
.path-step.done .path-num::before { font-size: 1.2rem; }
.path-body p { margin: 0; font-size: .92rem; }

/* Lists */
.video-list, .people-list { display: grid; gap: 12px; margin: 18px 0 24px; }
.row {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px;
  background: var(--white); border-radius: 16px; padding: 16px 18px; box-shadow: var(--shadow);
}
.row .sub { color: var(--ink-soft); font-size: .92rem; margin: 2px 0 0; }
.row .pill { font-size: .8rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--terracotta-dark); }
.row .actions { display: flex; gap: 8px; }
.empty { text-align: center; color: var(--ink-soft); padding: 24px; border: 1.5px dashed rgba(59,47,42,.2); border-radius: 16px; }

/* Wizard */
.wiz-progress { display: flex; gap: 8px; justify-content: center; margin: 0 0 24px; }
.wiz-progress span { width: 10px; height: 10px; border-radius: 50%; background: rgba(59,47,42,.15); }
.wiz-progress span.on { background: var(--terracotta); }
.choice-grid { display: grid; gap: 14px; }
.choice {
  display: grid; gap: 4px; text-align: start; font: inherit; cursor: pointer;
  background: var(--white); border: 2px solid transparent; border-radius: 20px; padding: 20px 22px; box-shadow: var(--shadow);
}
.choice:hover, .choice:focus-visible { border-color: var(--terracotta); outline: none; }
.choice-icon { font-size: 32px; }
.choice-list { display: grid; gap: 10px; }
.choice-list .choice { padding: 16px 20px; grid-template-columns: 1fr auto; align-items: center; }
.choice-list .choice.selected { border-color: var(--terracotta); background: #fff4ec; }
.choice-list .choice .rec { font-size: .8rem; color: var(--terracotta-dark); font-weight: 600; }

.recorder { position: relative; background: #1d1714; border-radius: 20px; aspect-ratio: 4 / 3; overflow: hidden; display: grid; place-items: center; }
.recorder video { width: 100%; height: 100%; object-fit: cover; }
.rec-placeholder { display: grid; gap: 8px; justify-items: center; padding: 24px; }
.rec-placeholder .or { color: rgba(255,255,255,.6); }
.rec-placeholder .or::before, .rec-placeholder .or::after { background: rgba(255,255,255,.2); }
.rec-placeholder .btn-ghost { color: var(--cream); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.4); cursor: pointer; }
.rec-countdown { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-display); font-size: 120px; color: var(--cream); background: rgba(0,0,0,.35); }
.rec-timer { position: absolute; top: 14px; inset-inline-start: 14px; background: rgba(200,100,58,.95); color: #fff; font-weight: 600; padding: 6px 12px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.rec-timer::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #fff; margin-inline-end: 8px; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.rec-controls { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 20px; }
.btn-record { width: 76px; height: 76px; border-radius: 50%; background: #d9342b; box-shadow: 0 0 0 6px rgba(217,52,43,.25); padding: 0; }
.btn-record:hover { background: #b92a22; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid rgba(59,47,42,.2); background: var(--white); font: inherit; cursor: pointer; }
.chip.selected { border-color: var(--terracotta); background: #fff4ec; }

.progress { height: 14px; background: rgba(59,47,42,.1); border-radius: 999px; overflow: hidden; margin: 24px 0 10px; }
.progress div { height: 100%; width: 0; background: var(--terracotta); transition: width .2s; }

/* Legacy code */
.legacy-code {
  font-family: ui-monospace, Menlo, monospace; font-size: 2.4rem; letter-spacing: .25em;
  background: #fff4ec; border: 2px dashed var(--terracotta); border-radius: 16px; padding: 20px; margin: 20px 0;
  user-select: all;
}

/* Toast / spinner */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--dark); color: var(--cream); padding: 12px 20px; border-radius: 999px; opacity: 0; transition: .25s; pointer-events: none; max-width: 90vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 4px solid rgba(59,47,42,.15); border-top-color: var(--terracotta); animation: spin .8s linear infinite; margin: 80px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 480px) {
  body.app { font-size: 18px; }
  .card-lg { padding: 26px 20px; }
  .path-step { grid-template-columns: 40px 1fr; }
  .path-step .btn { grid-column: 2; justify-self: start; }
  .brand-name { display: inline; font-size: 1rem; }
}

@media print {
  body * { visibility: hidden; }
  #s-code, #s-code * { visibility: visible; }
  #s-code { position: absolute; inset: 0; }
  #s-code .btn { display: none; }
}
