/* iPhone-Web-App der Marken: Code-Seite (Einladungscode) – Glas wie android-src/web-lock/lock.css, aber neutral.
   Akzent der Marke: lock.js setzt --acc/--acc2 (+ -rgb), --on-acc und --shade aus lock.json; ohne lock.json bleibt der
   Standard-Verlauf unten stehen. Für große Systemschrift gebaut: Schrift folgt der iOS-Textgröße (-apple-system-body),
   alles in rem/em, keine festen Höhen (nur Mindesthöhen 44 px für Tippziele), Text bricht um, ein Knopf pro Zeile. */
:root {
  --bg: #0A0D24; --surface: #101431; --raised: #161B40;
  --hair: rgba(255, 255, 255, .12); --inner: inset 0 1px 0 rgba(255, 255, 255, .18);
  --t1: #F4F6FF; --t2: #A9B0D0; --t3: #8189B3;
  /* Akzent: --acc2 (hell, oben links) → --acc (Markenfarbe); Standard = Blau → Violett */
  --acc: #A855F7; --acc-rgb: 168, 85, 247;
  --acc2: #3B82F6; --acc2-rgb: 59, 130, 246;
  --accent: linear-gradient(135deg, var(--acc2), var(--acc));
  --on-acc: #fff; --shade: rgba(0, 0, 0, .16);
  --focus: #60A5FA; --bad: #FCA5A5; --warn: #FCD34D; --ok: #86EFAC; --wa: #25D366;
  --font: -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  --sat: env(safe-area-inset-top, 0px); --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; font: 17px/1.45 var(--font); }
/* iPhone: Grundschrift = eingestellte Textgröße (Bedienungshilfen → Größerer Text) */
@supports (font: -apple-system-body) { html { font: -apple-system-body; line-height: 1.45; } }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  padding: calc(var(--sat) + 20px) max(16px, var(--sar)) calc(var(--sab) + 20px) max(16px, var(--sal));
  background: radial-gradient(90% 45% at 88% -8%, rgba(var(--acc2-rgb), .24), transparent 70%),
    radial-gradient(80% 40% at 0% 108%, rgba(var(--acc-rgb), .18), transparent 70%), var(--bg);
  color: var(--t1); -webkit-tap-highlight-color: transparent;
  overflow-wrap: anywhere; hyphens: auto; -webkit-hyphens: auto;
}
/* margin:auto statt align-items:center – bei riesiger Schrift wird oben nichts abgeschnitten, die Seite scrollt */
.card {
  width: 100%; max-width: 30rem; margin: auto;
  display: flex; flex-direction: column; gap: min(1rem, 5vw);
  padding: min(1.5rem, 7vw) min(1.25rem, 5vw);
  text-align: center;
  background: rgba(16, 20, 49, .72); border: 1px solid var(--hair); border-radius: 24px;
  box-shadow: var(--inner), 0 24px 60px rgba(0, 0, 0, .45);
}
.logo {
  display: block; align-self: center; width: min(6rem, 30vw); height: auto; aspect-ratio: 1;
  border-radius: 22%; box-shadow: 0 10px 30px rgba(0, 0, 0, .5), 0 0 0 1px var(--hair);
}
.logo[hidden] { display: none; }
.brand { margin: 0 0 -.5rem; color: var(--t2); font-weight: 700; letter-spacing: .02em; }
.brand[hidden] { display: none; }
h1 { margin: 0; font-size: min(1.6rem, 9.5vw); line-height: 1.15; font-weight: 800; letter-spacing: -.01em; }
.lead, .or, .hint { margin: 0; color: var(--t2); }
.more { display: flex; flex-direction: column; gap: min(1rem, 5vw); margin-top: .25rem; }
.more[hidden], .form[hidden], .lead[hidden], .hint[hidden] { display: none; }
.hint { color: var(--t1); }
.form { display: flex; flex-direction: column; gap: .75rem; margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Eingabe: nie unter 16 px (sonst zoomt Safari), Code in fester Breite – BM-XXXX-XXXX passt auch bei großer Schrift */
.field {
  display: block; width: 100%; min-height: 44px; margin: 0;
  padding: .65em .7em; border-radius: 14px;
  font: 700 max(16px, min(1.3rem, 7.2vw))/1.2 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: .06em; text-align: center; text-transform: uppercase;
  color: var(--t1); caret-color: var(--focus); background: rgba(10, 13, 36, .85);
  border: 1.5px solid rgba(255, 255, 255, .22); outline: none;
  -webkit-appearance: none; appearance: none; -webkit-user-select: text; user-select: text;
}
.field::placeholder { color: var(--t3); opacity: 1; font-weight: 600; }
.field:focus { border-color: var(--focus); box-shadow: 0 0 0 3px rgba(var(--acc2-rgb), .35); }
.field[aria-invalid="true"] { border-color: #F87171; }
.msg { margin: 0; color: var(--bad); font-weight: 600; }
.msg:empty { display: none; }

/* Knöpfe: volle Breite, eine Zeile pro Knopf, Höhe wächst mit der Schrift, Text bricht um */
.btn {
  display: flex; align-items: center; justify-content: center; gap: .5em;
  width: 100%; min-height: 44px; margin: 0; padding: .8em 1em;
  border: 0; border-radius: 14px;
  font: inherit; font-weight: 700; line-height: 1.25; text-align: center; text-decoration: none; white-space: normal;
  color: var(--on-acc); cursor: pointer; touch-action: manipulation; -webkit-appearance: none; appearance: none;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  /* Akzent-Verlauf, leicht abgedunkelt (helle Markenfarbe: dunkle Schrift, nicht abgedunkelt – siehe lock.js) */
  background: linear-gradient(var(--shade), var(--shade)), var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 8px 24px rgba(var(--acc-rgb), .35);
  transition: transform .12s ease-out, filter .12s ease-out;
}
.btn:active { transform: scale(.98); filter: brightness(.92); }
.btn:disabled { cursor: default; opacity: .65; transform: none; }
.btn:focus-visible, .field:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.btn.wa { background: rgba(37, 211, 102, .1); color: var(--t1); border: 1.5px solid rgba(37, 211, 102, .65); box-shadow: none; }
.btn.wa svg { flex: none; width: 1.3em; height: 1.3em; color: var(--wa); }
.btn[hidden] { display: none; }

/* Hinweis beim Laden (gesperrt / anderes Gerät / schon freigeschaltet / App nicht freigeschaltet) */
.note {
  margin: 0; padding: .8em 1em; border-radius: 14px; text-align: left;
  background: rgba(245, 158, 11, .12); border: 1px solid rgba(245, 158, 11, .45); color: var(--warn);
}
.note[hidden] { display: none; }
.note b { display: block; font-weight: 700; }
.note span { display: block; margin-top: .25em; color: var(--t2); }
.note.bad { background: rgba(239, 68, 68, .12); border-color: rgba(239, 68, 68, .5); color: var(--bad); }
.note.ok { background: rgba(34, 197, 94, .12); border-color: rgba(34, 197, 94, .5); color: var(--ok); }
.note a { display: block; margin-top: .6em; color: var(--t1); font-weight: 700; min-height: 44px; padding: .6em 0; }

@media (prefers-reduced-motion: reduce) { .btn { transition: none; } .btn:active { transform: none; } }
