/* Neukunden-Registrierung — Twister Kuriere.
   Fünf kurze Schritte statt einer langen Seite. Eine Schrift (Source Sans, wie
   twisterkuriere.de), ein Akzent (Twister-Rot), eine Spalte. Farbe markiert nur
   Zustand: erledigt, aktuell, fehlerhaft. */
:root {
  --paper: #ffffff; --ground: #f4f5f6; --ink: #1c1e21; --muted: #626c76;
  --line: #d9dde1; --line-strong: #b3b9c0; --placeholder: #98a0a8;
  --red: #e0001a; --red-deep: #990000; --red-tint: #fff2f3; --ok: #1f7a45;
  --focus: rgba(224, 0, 26, .18);
}
* { box-sizing: border-box; }
html { background: var(--ground); -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--ink); background: var(--ground); font: 17px/1.5 "Source Sans 3", "Source Sans Pro", "Helvetica Neue", Arial, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: var(--red-deep); text-underline-offset: 2px; }
button { font: inherit; }
::placeholder { color: var(--placeholder); opacity: 1; }
.wrap { max-width: 640px; margin: 0 auto; padding: 26px 20px 80px; }

/* ---------- head ---------- */
.head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 40px; }
.logo img { display: block; width: 150px; height: auto; }
.phone { color: var(--ink); text-decoration: none; text-align: right; line-height: 1.2; font-weight: 700; font-size: 17px; white-space: nowrap; }
.phone small { display: block; color: var(--muted); font-weight: 400; font-size: 13px; }
@media (max-width: 420px) { .logo img { width: 120px; } }

/* ---------- intro ---------- */
h1 { font-size: clamp(32px, 7vw, 44px); line-height: 1.05; letter-spacing: -0.015em; margin: 0 0 12px; font-weight: 700; }
.lede { margin: 0 0 30px; max-width: 56ch; color: var(--muted); font-size: 18px; }

/* ---------- resume note ---------- */
.resume { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; margin: 0 0 22px; padding: 10px 14px; background: var(--paper); border-left: 3px solid var(--red); font-size: 15px; }
.resume button { background: none; border: 0; padding: 0; color: var(--red-deep); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }

/* ---------- step rail: a real sequence, so the numbered/linked treatment earns its place ---------- */
.rail { margin: 0 0 30px; }
.rail ol { list-style: none; margin: 0; padding: 0; display: flex; }
.rail li { flex: 1; position: relative; }
.rail li::before { content: ""; position: absolute; top: 8px; left: -50%; right: 50%; height: 2px; background: var(--line); }
.rail li:first-child::before { display: none; }
.rail li.done::before, .rail li.cur::before { background: var(--red); }
.rail li button { all: unset; display: block; width: 100%; padding-top: 26px; position: relative; text-align: center; font-size: 13px; color: var(--muted); cursor: default; }
.rail li button:not([disabled]) { cursor: pointer; }
.rail li button:not([disabled]):hover .lbl { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.rail li button:focus-visible .dot { box-shadow: 0 0 0 3px var(--focus); }
.rail .dot { position: absolute; top: 0; left: 50%; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; background: var(--paper); border: 2px solid var(--line-strong); z-index: 1; }
.rail li.done .dot { background: var(--red); border-color: var(--red); }
.rail li.done .dot::after { content: ""; position: absolute; left: 4px; top: 1px; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.rail li.cur .dot { border-color: var(--red); }
.rail li.cur .dot::after { content: ""; position: absolute; left: 3px; top: 3px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.rail li.cur button { color: var(--ink); font-weight: 700; }
@media (max-width: 479px) { .rail .lbl { display: none; } .rail li button { padding-top: 18px; } }

/* ---------- steps ---------- */
.stepno { margin: 0 0 4px; font-size: 14px; color: var(--muted); }
.step h2 { font-size: 27px; line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 6px; font-weight: 700; outline: none; }
.hint { margin: 0 0 22px; color: var(--muted); max-width: 56ch; }
h3.sub { font-size: 19px; margin: 30px 0 4px; font-weight: 700; }
.row { display: grid; gap: 14px; grid-template-columns: 1fr; margin-bottom: 16px; }
.row.two { grid-template-columns: 1fr 1fr; }
.row.nr { grid-template-columns: 1fr 104px; }
.row.plz { grid-template-columns: 116px 1fr; }
@media (max-width: 520px) { .row.two { grid-template-columns: 1fr; } }

/* ---------- fields ---------- */
.f { min-width: 0; }
.f > label { display: block; font-size: 15px; font-weight: 700; margin-bottom: 5px; }
.opt { color: var(--muted); font-weight: 400; margin-left: 6px; }
.help { margin: 5px 0 0; font-size: 14px; color: var(--muted); }
.help.ok { color: var(--ok); }
input[type=text], input[type=email], input[type=tel], input[type=url], input[type=password], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--line-strong); border-radius: 4px; padding: 11px 13px; min-height: 48px; outline: none; margin: 0;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
input[type=text], input[type=email], input[type=tel], input[type=url], input[type=password], textarea { -webkit-appearance: none; appearance: none; }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px var(--focus); }
.f.err input, .f.err select, .f.err textarea { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); background: var(--red-tint); }
.f.err input:focus, .f.err select:focus, .f.err textarea:focus { box-shadow: 0 0 0 1px var(--red), 0 0 0 4px var(--focus); }
.msg { display: block; margin: 6px 0 0; font-size: 14px; font-weight: 700; color: var(--red-deep); }
.msg:empty { display: none; }
.rowmsg { margin: -8px 0 16px; }

/* password with show/hide instead of a repeat field */
.pw { position: relative; }
.pw input { padding-right: 104px; }
.pw button { position: absolute; right: 6px; top: 6px; height: 36px; padding: 0 12px; border: 0; border-radius: 3px; background: var(--ground); color: var(--ink); font-size: 14px; font-weight: 700; cursor: pointer; }
.pw button:hover { background: var(--line); }
.pw button:focus-visible { outline: 3px solid var(--focus); }

/* ---------- segmented choice ---------- */
.seg { display: flex; max-width: 440px; margin-bottom: 20px; border: 1px solid var(--line-strong); border-radius: 4px; overflow: hidden; background: var(--paper); }
.seg label { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 8px 14px; text-align: center; font-weight: 700; cursor: pointer; border-right: 1px solid var(--line-strong); }
.seg label:last-child { border-right: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg input:checked + label { background: var(--ink); color: #fff; }
.seg input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: -3px; }

/* ---------- plain checkbox line ---------- */
.check { display: flex; gap: 12px; align-items: flex-start; margin: 2px 0 18px; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--red); flex: none; }

/* ---------- consent boxes (AGB, SEPA-Mandat): framed, so their state cannot be missed ---------- */
.consent { display: grid; grid-template-columns: 22px 1fr; gap: 2px 14px; align-items: start; padding: 14px 16px; margin: 0 0 16px; background: var(--paper); border: 1px solid var(--line-strong); border-radius: 4px; cursor: pointer; transition: border-color .15s, box-shadow .15s, background-color .15s; }
.consent input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--red); }
.consent .t { display: block; font-weight: 700; }
.consent .sub { display: block; grid-column: 2; font-size: 14px; color: var(--muted); }
.consent .msg { grid-column: 2; }
.consent:focus-within { border-color: var(--red); box-shadow: 0 0 0 3px var(--focus); }
.consent.err { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); background: var(--red-tint); }
.consent.err:focus-within { box-shadow: 0 0 0 1px var(--red), 0 0 0 4px var(--focus); }

/* ---------- "more" disclosure ---------- */
details.more { margin: -2px 0 18px; }
details.more summary { display: inline-block; list-style: none; cursor: pointer; color: var(--red-deep); font-size: 15px; text-decoration: underline; text-underline-offset: 2px; }
details.more summary::-webkit-details-marker { display: none; }
details.more[open] summary { margin-bottom: 14px; }

/* ---------- address autocomplete ---------- */
.acw { position: relative; }
.acw ul { position: absolute; z-index: 5; left: 0; right: 0; top: 100%; margin: 4px 0 0; padding: 4px 0; list-style: none; background: var(--paper); border: 1px solid var(--line-strong); border-radius: 4px; box-shadow: 0 10px 28px rgba(0, 0, 0, .14); max-height: 260px; overflow: auto; }
.acw li { padding: 9px 13px; cursor: pointer; font-size: 16px; }
.acw li small { color: var(--muted); margin-left: 6px; font-size: 14px; }
.acw li:hover, .acw li.sel { background: var(--ground); }

/* ---------- summary sheet ---------- */
.sheet { background: var(--paper); border: 1px solid var(--line); border-radius: 4px; padding: 16px 20px 4px; margin: 26px 0 20px; }
.sheet h3 { margin: 0 0 6px; font-size: 19px; }
.sheet dl { margin: 0; display: grid; grid-template-columns: 126px 1fr auto; gap: 0 14px; }
.sheet dt, .sheet dd, .sheet .edit { padding: 9px 0; border-top: 1px solid var(--line); }
.sheet dt { color: var(--muted); font-size: 15px; }
.sheet dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.sheet .edit { font-size: 14px; }
@media (max-width: 479px) {
  .sheet dl { grid-template-columns: 1fr auto; }
  .sheet dt { grid-column: 1 / -1; padding-bottom: 0; }
  .sheet dd, .sheet .edit { border-top: 0; padding-top: 2px; }
}

/* ---------- buttons ---------- */
.nav { display: flex; align-items: center; gap: 22px; margin-top: 30px; }
button.primary { font-weight: 700; font-size: 17px; color: #fff; background: var(--red); border: 0; border-radius: 4px; padding: 0 28px; min-height: 52px; cursor: pointer; }
button.primary:hover { background: var(--red-deep); }
button.primary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
button.primary[disabled] { opacity: .6; cursor: progress; }
button.back { background: none; border: 0; padding: 0; color: var(--ink); font-size: 16px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
button.back:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.steperr, .formerr { margin: 12px 0 0; color: var(--red-deep); font-weight: 700; }
button.link { background: none; border: 0; padding: 0; color: var(--red-deep); font-weight: 400; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
button.link:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.steperr:empty, .formerr:empty { display: none; }
@media (max-width: 520px) { button.primary { flex: 1; } }

/* ---------- done ---------- */
.done h2 { font-size: clamp(26px, 6vw, 32px); line-height: 1.1; letter-spacing: -0.01em; margin: 0 0 18px; outline: none; }
.next { list-style: none; margin: 0 0 26px; padding: 0; counter-reset: n; }
.next li { position: relative; padding: 0 0 14px 44px; counter-increment: n; max-width: 56ch; }
.next li::before { content: counter(n); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: center; }
.next b { font-weight: 700; overflow-wrap: anywhere; }
.done .ref { color: var(--muted); font-size: 14px; }

/* ---------- footer ---------- */
footer { margin-top: 64px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 4px 18px; }
footer a { color: inherit; }

/* ---------- honeypot ---------- */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- motion: only as an answer to an action ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.step.enter { animation: rise .2s ease-out; }
.shake { animation: shake .32s ease-in-out; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
