:root {
  --ink: #10141c;
  --ink-2: #171d28;
  --line: #2a3342;
  --mute: #95a0b2;
  --paper: #f4f2ec;
  --paper-ink: #161a22;
  --paper-mute: #5d6573;
  --paper-line: #dcd6c8;
  --gold: #c9a043;
  --gold-light: #e8c873;
  --danger: #ff6b57;
  --font-body: "Onest", system-ui, sans-serif;
  --font-display: "Unbounded", "Onest", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--paper-ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
a { color: inherit; }

/* ---------- layout ---------- */
.page {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  min-height: 100vh;
  min-height: 100dvh;
}
.intro {
  display: flex;
  flex-direction: column;
  gap: clamp(2rem, 6vh, 4rem);
  padding: clamp(1.25rem, 3vw, 2.5rem) clamp(1rem, 5vw, 4.5rem);
}
.road {
  background: var(--ink);
  color: #fff;
  display: grid;
  align-content: center;
  padding: clamp(2rem, 5vw, 4rem) clamp(1rem, 5vw, 4rem);
}
@media (max-width: 900px) {
  .page { grid-template-columns: 1fr; min-height: 0; }
  .intro { padding-bottom: 2.5rem; }
  .road { border-radius: 28px 28px 0 0; padding-top: 2.25rem; padding-bottom: 3rem; }
}

/* ---------- header ---------- */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .8rem; text-decoration: none; min-width: 0; }
.brand img { flex: none; width: 56px; height: 56px; }
.brand span {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .78rem;
  line-height: 1.25;
  letter-spacing: .02em;
  text-transform: uppercase;
  max-width: 14rem;
}
@media (max-width: 420px) { .brand span { display: none; } }
.langs { display: flex; flex: none; padding: 3px; border: 1.5px solid var(--paper-line); border-radius: 999px; }
.langs button {
  border: 0; background: transparent;
  padding: .3rem .75rem; border-radius: 999px;
  font-size: .85rem; font-weight: 600; color: var(--paper-mute);
}
.langs button[aria-pressed="true"] { background: var(--ink); color: #fff; }

/* ---------- intro ---------- */
.hero { max-width: 34rem; }
h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.9rem, 3.8vw, 3.1rem);
  line-height: 1.12;
  letter-spacing: -.02em;
  text-wrap: balance;
}
.lead { margin: 1.25rem 0 0; max-width: 30rem; font-size: 1.125rem; color: var(--paper-mute); }
.ledger { display: grid; grid-template-columns: 1fr 1fr; max-width: 40rem; }
.ledger section { padding-right: 1.75rem; }
.ledger section + section { padding-left: 1.75rem; padding-right: 0; border-left: 1.5px solid var(--paper-line); }
.ledger h2 { margin: 0 0 .6rem; font-size: 1rem; font-weight: 700; }
.ledger p { margin: 0 0 .75rem; color: var(--paper-mute); font-size: .95rem; }
.ledger ul { margin: 0; padding: 0; list-style: none; }
.ledger li { position: relative; padding: 0 0 .4rem 1.1rem; color: var(--paper-mute); font-size: .95rem; }
.ledger li::before {
  content: ""; position: absolute; left: 0; top: .62em;
  width: .55rem; height: 2px; background: var(--gold);
}
@media (max-width: 560px) {
  .ledger { grid-template-columns: 1fr; gap: 1.5rem; }
  .ledger section, .ledger section + section { padding: 0; border: 0; }
}
.foot { margin-top: auto; display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; color: var(--paper-mute); font-size: .9rem; }
.foot a { text-underline-offset: 3px; }

/* ---------- steps ---------- */
.route { margin: 0 auto; padding: 0; list-style: none; width: 100%; max-width: 28rem; }
.stop {
  position: relative;
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  column-gap: 1rem;
  padding-bottom: 1.75rem;
}
.stop:last-child { padding-bottom: 0; }
.stop::before {
  content: ""; position: absolute;
  left: calc(1rem - 1px); top: 2.4rem; bottom: .4rem; width: 2px;
  background: repeating-linear-gradient(to bottom, var(--line) 0 5px, transparent 5px 10px);
}
.stop:last-child::before { display: none; }
.stop[data-state="done"]::before { background: var(--gold); }
.dot {
  z-index: 1; display: grid; place-items: center;
  width: 2rem; height: 2rem; border-radius: 50%;
  border: 2px solid var(--line); background: var(--ink);
  color: var(--mute); font-size: .85rem; font-weight: 700;
}
.stop[data-state="active"] .dot { background: var(--gold); border-color: var(--gold); color: var(--ink); box-shadow: 0 0 0 5px #c9a04338; }
.stop[data-state="done"] .dot { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.stop-title { margin: 0; font-size: 1.125rem; font-weight: 600; line-height: 2rem; color: var(--mute); }
.stop[data-state="active"] .stop-title { color: #fff; font-size: 1.3rem; }
.stop[data-state="done"] .stop-title { color: #fff; }
.stop-summary { margin: 0; color: var(--mute); font-size: .9rem; }
.stop-body { margin-top: .75rem; animation: arrive .32s ease-out; }
.stop:not([data-state="active"]) .stop-body { display: none; }
.stop:not([data-state="done"]) .stop-summary { display: none; }
@keyframes arrive { from { opacity: 0; transform: translateY(8px); } }

.hint { margin: 0 0 1.25rem; color: var(--mute); font-size: .95rem; }
.field { display: block; margin-bottom: 1.1rem; }
.label { display: block; margin-bottom: .4rem; font-size: .9rem; font-weight: 600; }
input {
  width: 100%; height: 3.25rem; padding: 0 1rem;
  border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--ink-2); color: #fff;
}
input::placeholder { color: #5e6676; }
input:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 2px; }
.phone, .pw { display: flex; align-items: stretch; gap: .5rem; }
.cc {
  display: grid; place-items: center; padding: 0 .9rem;
  border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--ink-2); font-weight: 600; color: var(--mute);
}
.pw button {
  flex: none; padding: 0 .9rem;
  border: 1.5px solid var(--line); border-radius: 12px;
  background: transparent; color: var(--mute); font-size: .9rem;
}
.btn {
  display: block; width: 100%; height: 3.25rem;
  border: 0; border-radius: 12px; font-weight: 700; color: var(--ink);
  transition: transform .12s ease, opacity .15s ease;
}
.btn:active:not(:disabled) { transform: scale(.985); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-go { background: var(--gold); }
.btn-danger { background: var(--danger); }
.btn-ghost { background: transparent; color: #fff; border: 1.5px solid var(--line); }
.actions { display: grid; grid-template-columns: 1fr 2fr; gap: .6rem; }
.link {
  display: block; margin: 1rem auto 0; padding: .4rem .5rem;
  border: 0; background: none; color: var(--gold-light); font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px;
}
.link:disabled { color: var(--mute); text-decoration: none; cursor: default; }
.msg p { margin: 0 0 1rem; font-size: .92rem; }
.msg-error { color: var(--danger); }
.msg-info { color: var(--gold-light); }
.sub { margin: 0 0 .6rem; font-size: .95rem; font-weight: 600; }
.warn { margin: 0 0 1.25rem; padding: 0; list-style: none; }
.warn li { position: relative; padding: 0 0 .45rem 1.1rem; color: var(--mute); font-size: .95rem; }
.warn li::before {
  content: ""; position: absolute; left: 0; top: .62em;
  width: .55rem; height: 2px; background: var(--danger);
}
.check { display: flex; align-items: flex-start; gap: .75rem; margin-bottom: 1.25rem; cursor: pointer; font-weight: 500; }
.check input { flex: none; width: 1.4rem; height: 1.4rem; margin: .1rem 0 0; padding: 0; accent-color: var(--gold); }
.code { margin: 0 0 1.25rem; padding: 0; border: 0; }
.code legend { padding: 0; margin-bottom: .5rem; font-size: .9rem; font-weight: 600; }
.code-cells { display: grid; grid-template-columns: repeat(4, minmax(0, 4.2rem)); gap: .6rem; }
.code-cells input {
  height: 4.2rem; padding: 0; text-align: center;
  font-family: var(--font-display); font-size: 1.6rem; font-weight: 600;
}
.done-title { margin: 0 0 .5rem; font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; color: var(--gold-light); }
.done .hint { margin: 0; }

/* ---------- legal pages ---------- */
.legal { max-width: 52rem; margin: 0 auto; padding: clamp(1.25rem, 3vw, 2.5rem) 16px 4rem; }
.tabs { display: flex; gap: .5rem; margin: 2.5rem 0 1.75rem; flex-wrap: wrap; }
.tabs a {
  padding: .5rem 1rem; border-radius: 999px; text-decoration: none;
  border: 1.5px solid var(--paper-line); font-weight: 600; font-size: .92rem; color: var(--paper-mute);
}
.tabs a[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.legal h1 { font-size: clamp(1.5rem, 3vw, 2.25rem); margin-bottom: 1.5rem; }
.doc {
  background: #fff; border: 1.5px solid var(--paper-line); border-radius: 20px;
  padding: clamp(1.25rem, 4vw, 2.5rem);
  overflow-wrap: anywhere;
}
.doc h3 { margin: 1.75rem 0 .6rem; font-size: 1.1rem; }
.doc h3:first-of-type { margin-top: .5rem; }
.doc h4 { margin: 1rem 0 .4rem; font-size: 1rem; }
.doc p { margin: 0 0 .7rem; }
.doc ul { margin: 0 0 .9rem; padding-left: 1.25rem; }
.doc li { margin-bottom: .3rem; }
.doc a { color: #8a6a1f; text-underline-offset: 3px; }
.doc .meta { color: var(--paper-mute); font-size: .9rem; }
.legal .foot { margin-top: 2rem; }

@media (prefers-reduced-motion: reduce) {
  .stop-body { animation: none; }
  .btn { transition: none; }
}
