:root {
  /* Content Doctor app chrome (lib/app_theme.dart, SandDark) */
  --ink: #0C1014;
  --panel: #11161B;
  --raise: #191E24;
  --rule: #242B33;
  --text: #EEF1F4;
  --muted: #8E98A3;
  --red: #E8202E;
  --red-ink: #FF4B57;
  --red-wash: rgba(232, 32, 46, 0.12);
  --gutter: clamp(16px, 5vw, 64px);
  --max: 1180px;
  --font: "Schibsted Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font: 400 17px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.025em; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--red-ink); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 10; background: var(--text); color: var(--ink); padding: 8px 12px; }

/* Bar */
.bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px var(--gutter);
  background: rgba(12, 16, 20, 0.82);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid transparent;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 18px; letter-spacing: -0.02em; }
.cross { width: 20px; height: 20px; fill: var(--red); flex: none; }
.bar-cta { font-weight: 600; font-size: 15px; text-decoration: none; padding: 8px 16px; border-radius: 999px; background: var(--raise); border: 1px solid var(--rule); }
.bar-cta:hover { border-color: #3a434d; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 26px;
  border: 0; border-radius: 14px;
  background: var(--red); color: #fff;
  font: 600 17px/1 var(--font); letter-spacing: -0.01em;
  text-decoration: none; cursor: pointer;
  transition: background-color 120ms ease, transform 120ms ease;
}
.btn:hover { background: #F2343F; }
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: 0.55; cursor: progress; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--rule); }
.btn.ghost:hover { background: var(--raise); }

/* Hero */
.hero {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(40px, 8vw, 96px) var(--gutter) clamp(56px, 8vw, 104px);
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: clamp(32px, 6vw, 88px); align-items: center;
}
.status { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 15px; font-weight: 500; margin-bottom: 28px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px var(--red-wash); }
h1 {
  font-size: clamp(42px, 6.6vw, 84px);
  line-height: 0.98; letter-spacing: -0.045em; font-weight: 800;
  max-width: 13ch; text-wrap: balance;
}
.lede { margin-top: 28px; font-size: clamp(18px, 1.6vw, 21px); line-height: 1.5; color: #C3CAD2; max-width: 34em; }
.hero-actions { margin-top: 36px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; }
.fine { color: var(--muted); font-size: 15px; max-width: 22em; }

/* Phone frame around real app renders */
.phone {
  margin: 0; position: relative;
  border-radius: 44px; padding: 10px;
  background: linear-gradient(160deg, #2A3139, #151A1F 40%, #0E1216);
  box-shadow: 0 0 0 1px #2B323A, 0 40px 80px -30px rgba(0,0,0,0.7), 0 0 120px -40px rgba(232,32,46,0.35);
}
.phone img { border-radius: 34px; width: 100%; }
.hero-phone { width: min(100%, 340px); justify-self: center; }

@media (prefers-reduced-motion: no-preference) {
  .hero-copy > * { animation: rise 700ms cubic-bezier(.2,.7,.2,1) both; }
  .hero-copy > :nth-child(2) { animation-delay: 60ms; }
  .hero-copy > :nth-child(3) { animation-delay: 120ms; }
  .hero-copy > :nth-child(4) { animation-delay: 180ms; }
  .hero-phone { animation: rise 900ms 160ms cubic-bezier(.2,.7,.2,1) both; }
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* Flow */
.flow, .who {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(56px, 8vw, 104px) var(--gutter);
  border-top: 1px solid var(--rule);
}
h2 { font-size: clamp(30px, 3.6vw, 44px); line-height: 1.05; letter-spacing: -0.035em; max-width: 18ch; }
.steps { list-style: none; margin: 56px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 3vw, 40px); counter-reset: step; }
.steps li { counter-increment: step; }
.phone-peek { border-radius: 34px 34px 0 0; padding: 8px 8px 0; aspect-ratio: 390 / 520; overflow: hidden; box-shadow: 0 0 0 1px #2B323A; }
.phone-peek img { border-radius: 27px 27px 0 0; }
.phone-peek::after { content: ""; position: absolute; inset: auto 0 0 0; height: 45%; background: linear-gradient(to bottom, rgba(12,16,20,0), var(--ink) 92%); }
.steps h3 { margin-top: 24px; font-size: 22px; display: flex; align-items: baseline; gap: 12px; }
.steps h3::before { content: counter(step); color: var(--red-ink); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.steps p { margin-top: 8px; color: #B7BFC8; max-width: 32em; }

/* Who */
.who-grid { margin-top: 48px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 3vw, 48px); }
.who-grid div { border-top: 2px solid var(--red); padding-top: 20px; }
.who-grid h3 { font-size: 21px; }
.who-grid p { margin-top: 10px; color: #B7BFC8; }
.promise { margin-top: 56px; padding: 20px 22px; border-radius: 16px; background: var(--panel); border: 1px solid var(--rule); color: #D5DBE1; max-width: 46em; }

/* Apply */
.apply {
  max-width: 820px; margin: 0 auto;
  padding: clamp(24px, 4vw, 56px) var(--gutter) clamp(72px, 10vw, 128px);
  scroll-margin-top: 64px;
}
.apply-head p { margin-top: 14px; color: #B7BFC8; max-width: 36em; }
.intake { margin-top: 40px; background: var(--panel); border: 1px solid var(--rule); border-radius: 24px; padding: clamp(20px, 4vw, 40px); }
.progress { height: 4px; border-radius: 4px; background: var(--raise); overflow: hidden; }
.progress span { display: block; height: 100%; width: 33.33%; background: var(--red); transition: width 280ms ease; }
.step-count { margin-top: 14px; color: var(--muted); font-size: 14px; font-weight: 500; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; font-size: 26px; font-weight: 700; letter-spacing: -0.03em; margin: 6px 0 24px; }
.step > * + * { margin-top: 22px; }
.step > legend + * { margin-top: 0; }

label { display: flex; flex-direction: column; gap: 8px; font-size: 15px; font-weight: 600; color: #D5DBE1; }
input, select, textarea {
  width: 100%; min-height: 50px;
  font: 400 16px/1.4 var(--font); color: var(--text);
  background: var(--ink); border: 1px solid var(--rule); border-radius: 12px;
  padding: 12px 14px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
textarea { resize: vertical; min-height: 96px; }
select { appearance: none; -webkit-appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238E98A3' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
input::placeholder, textarea::placeholder { color: #5E6873; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px var(--red-wash); }
[aria-invalid="true"] { border-color: var(--red-ink); }

.row { display: grid; gap: 16px; }
.row.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.group-label { font-size: 15px; font-weight: 600; color: #D5DBE1; margin-bottom: 12px; }
.opt { color: var(--muted); font-weight: 400; margin-left: 6px; }
.hint { margin-top: 10px; color: var(--muted); font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; display: inline-flex; flex-direction: row; font-weight: 500; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.chip span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--rule); background: var(--ink); color: #C9D0D7; cursor: pointer; transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease; }
.chip span:hover { border-color: #3a434d; }
.chip input:checked + span { background: var(--red-wash); border-color: var(--red); color: #fff; }
.chip input:focus-visible + span { outline: 2px solid var(--red-ink); outline-offset: 2px; }
.group.invalid .chip span { border-color: rgba(255,75,87,0.6); }

.handles { display: grid; gap: 10px; }
.handle { display: grid; grid-template-columns: 96px minmax(0, 1fr) minmax(0, 170px); gap: 10px; align-items: center; }
.plat { font-size: 15px; font-weight: 600; color: #D5DBE1; }

.reveal[hidden] { display: none; }
.consent { flex-direction: row; align-items: flex-start; gap: 12px; font-weight: 500; line-height: 1.45; cursor: pointer; }
.consent input { width: 22px; height: 22px; min-height: 0; flex: none; margin: 1px 0 0; accent-color: var(--red); padding: 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.turnstile { min-height: 65px; }

.error { margin-top: 20px; padding: 12px 14px; border-radius: 12px; background: var(--red-wash); color: #FFC9CD; font-size: 15px; }
.nav { margin-top: 32px; display: flex; gap: 12px; justify-content: flex-end; }
.nav .btn { min-width: 140px; }

.done { margin-top: 40px; padding: clamp(28px, 5vw, 48px); border-radius: 24px; background: var(--panel); border: 1px solid var(--rule); }
.done:focus { outline: none; }
.cross.big { width: 36px; height: 36px; margin-bottom: 20px; }
.done h2 { font-size: 30px; }
.done p { margin-top: 12px; color: #C3CAD2; }

.foot { max-width: var(--max); margin: 0 auto; padding: 32px var(--gutter) 48px; border-top: 1px solid var(--rule); display: flex; justify-content: space-between; gap: 24px; color: var(--muted); font-size: 14px; }
.foot a { color: #C3CAD2; }

@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-phone { width: min(78%, 320px); }
  .steps, .who-grid { grid-template-columns: minmax(0, 1fr); }
  .steps li { display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr); column-gap: 20px; align-items: start; }
  .steps li .phone-peek { grid-row: span 2; border-radius: 22px 22px 0 0; padding: 5px 5px 0; }
  .steps li .phone-peek img { border-radius: 18px 18px 0 0; }
  .steps h3 { margin-top: 4px; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .row.two, .row.three { grid-template-columns: 1fr; }
  .handle { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .plat { grid-column: 1 / -1; margin-bottom: -4px; }
  .steps li { grid-template-columns: minmax(0, 112px) minmax(0, 1fr); }
  .nav .btn { flex: 1; min-width: 0; }
  .foot { flex-direction: column; }
}

.legal h2 { font-size: 22px; margin-top: 40px; }
.legal p { margin-top: 12px; color: #C3CAD2; max-width: 38em; }
.legal-title { font-size: clamp(36px, 5vw, 56px); }
