:root {
  --ink: #1A0000;          /* brand band */
  --brand: #8B1A1A;        /* actions, rail */
  --brand-deep: #6E1414;   /* hover */
  --paper: #FFFFFF;
  --mist: #F7F3F3;         /* input fill */
  --line: #E6DADA;
  --text: #241717;
  --muted: #6E5E5E;
  --ok: #1F7A4D;
  --ok-soft: #E9F5EE;
  --err: #B42318;
  --radius-s: 8px;
  --radius-m: 12px;
  --display: "Montserrat", Arial, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 400 16px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Brand band ---------- */
.band {
  background: var(--ink);
  color: #fff;
  border-bottom: 2px solid var(--brand);
}
.band-inner {
  max-width: 600px;
  margin: 0 auto;
  padding: 28px 20px 26px;
}
.logo { display: block; width: 72px; height: auto; margin-bottom: 22px; }
.band h1 {
  font: 800 clamp(28px, 6vw, 38px)/1.1 var(--display);
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}
.lede { margin: 0; color: rgba(255,255,255,.78); font-size: 16px; }

/* progress rail: the one bold device */
.rail {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 26px 0 0;
  padding: 0;
  counter-reset: s;
}
.rail-step {
  position: relative;
  padding-top: 18px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,.55);
}
.rail-step::before {          /* track */
  content: "";
  position: absolute; left: 0; right: 0; top: 5px;
  height: 3px; background: rgba(255,255,255,.16);
}
.rail-step::after {           /* fill */
  content: "";
  position: absolute; left: 0; top: 5px;
  height: 3px; width: 0; background: #fff;
  transition: width .5s ease;
}
.rail-step .dot {
  position: absolute; left: 0; top: 0;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--ink);
  border: 2px solid rgba(255,255,255,.35);
  z-index: 1;
}
.rail-step.current { color: #fff; }
.rail-step.current .dot { border-color: #fff; }
.rail-step.current::after { width: 45%; }
.rail-step.complete { color: #fff; }
.rail-step.complete::after { width: 100%; }
.rail-step.complete .dot { background: #fff; border-color: #fff; }

/* ---------- Content ---------- */
.wrap { max-width: 600px; margin: 0 auto; padding: 32px 20px 56px; }
.step[hidden] { display: none; }

.field { margin: 0 0 22px; border: 0; padding: 0; }
label, legend {
  display: block;
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 7px;
  padding: 0;
}
input[type="text"], input:not([type]), input[type="email"], input[type="tel"] {
  width: 100%;
  font: 400 16px/1.4 var(--body);   /* 16px stops iOS zoom */
  color: var(--text);
  background: var(--mist);
  border: 1.5px solid transparent;
  border-radius: var(--radius-s);
  padding: 13px 14px;
  transition: border-color .15s, background .15s;
}
input:hover { border-color: var(--line); }
input:focus { outline: none; background: #fff; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(139,26,26,.14); }
input[aria-invalid="true"] { border-color: var(--err); background: #fff; }
.field-error { color: var(--err); font-size: 14px; margin: 6px 0 0; }
.hint { color: var(--muted); font-size: 14px; margin: 6px 0 0; }

.inline-check, .confirm {
  display: flex; align-items: flex-start; gap: 10px;
  font-weight: 500; font-size: 15px; cursor: pointer;
}
.inline-check { margin-top: 10px; color: var(--muted); }
input[type="checkbox"] {
  flex: none;
  width: 20px; height: 20px; margin: 1px 0 0;
  accent-color: var(--brand);
  cursor: pointer;
}

/* phone plugin fit */
.iti { width: 100%; }
.iti__country-list { font-size: 15px; }
.iti--separate-dial-code .iti__selected-flag { background: transparent; border-radius: var(--radius-s) 0 0 var(--radius-s); }

/* members */
.members legend { margin-bottom: 2px; }
.member-row {
  display: grid;
  grid-template-columns: 1fr 1.3fr auto;
  gap: 8px;
  margin-top: 12px;
  align-items: start;
}
.member-row .remove {
  width: 46px; height: 48px;
  border: 0; border-radius: var(--radius-s);
  background: transparent; color: var(--muted);
  font-size: 22px; line-height: 1; cursor: pointer;
}
.member-row .remove:hover { background: var(--mist); color: var(--text); }
@media (max-width: 480px) {
  .member-row { grid-template-columns: 1fr auto; }
  .member-row .m-name { grid-column: 1 / -1; grid-row: 1; }
  .member-row .m-phone { grid-column: 1 / 2; grid-row: 2; }
  .member-row .remove { grid-column: 2; grid-row: 2; align-self: center; }
}

/* ---------- Buttons ---------- */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px;
  padding: 0 24px;
  font: 600 16px/1 var(--body);
  color: #fff;
  background: var(--brand);
  border: 0; border-radius: var(--radius-s);
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, transform .05s;
}
.btn-primary:hover { background: var(--brand-deep); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary[disabled] { background: #CDBDBD; cursor: not-allowed; }
#detailsForm .btn-primary, .btn-wide { width: 100%; }
.btn-primary.loading .label { opacity: .75; }
.btn-primary.loading::before {
  content: ""; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-quiet {
  margin-top: 12px;
  font: 600 15px/1 var(--body);
  color: var(--brand);
  background: transparent;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-s);
  padding: 13px 16px;
  width: 100%;
  cursor: pointer;
}
.btn-quiet:hover { border-color: var(--brand); }
.link {
  font: inherit; color: var(--brand); text-decoration: underline;
  background: none; border: 0; padding: 0; cursor: pointer;
}

:focus-visible { outline: 3px solid rgba(139,26,26,.45); outline-offset: 2px; }

.turnstile { margin: 4px 0 16px; min-height: 0; }
.form-error {
  color: var(--err); background: #FEF3F2;
  border-radius: var(--radius-s); padding: 12px 14px;
  font-size: 15px; margin: 0 0 16px;
}

/* ---------- Tasks (step 2) ---------- */
.task {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 16px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}
.task:first-child { padding-top: 0; }
.task-status {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  border: 2px solid var(--brand);
  color: var(--brand);
  font: 800 16px/1 var(--display);
  transition: background .25s, border-color .25s;
}
.task-status .tick { width: 20px; height: 20px; display: none; }
.task-status .tick path { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 24; }
.task[data-state="done"] .task-status { background: var(--ok); border-color: var(--ok); }
.task[data-state="done"] .num { display: none; }
.task[data-state="done"] .tick { display: block; }
.task[data-state="done"] .tick path { animation: draw .35s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.task h2 { font: 700 20px/1.25 var(--display); margin: 5px 0 6px; }
.task p { margin: 0 0 14px; }
.task .hint { margin: 10px 0 0; }
.confirm {
  margin-top: 18px;
  padding: 14px;
  background: var(--mist);
  border-radius: var(--radius-s);
}
.task[data-state="done"] .confirm { background: var(--ok-soft); }
.signed-note { color: var(--ok); font-weight: 600; margin: 12px 0 0 !important; }

.copy-to { font-size: 15px; color: var(--muted); margin: 22px 0 18px; }

/* ---------- Done ---------- */
.done { text-align: left; padding-top: 4px; }
.done-mark { width: 64px; height: 64px; margin-bottom: 14px; }
.done-mark circle { fill: var(--ok-soft); }
.done-mark path { fill: none; stroke: var(--ok); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 44; stroke-dashoffset: 44; animation: draw .5s .15s ease forwards; }
.done h2 { font: 800 28px/1.15 var(--display); margin: 0 0 8px; }
.done > p { margin: 0 0 18px; }
.next { margin: 0 0 22px; padding: 0; list-style: none; }
.next li { padding: 12px 0 12px 22px; border-top: 1px solid var(--line); position: relative; }
.next li::before { content: ""; position: absolute; left: 0; top: 21px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }

.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 0 20px 32px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .task-status .tick path, .done-mark path { stroke-dashoffset: 0; }
}
