/* Onboarding-Portal. Farben aus den LichtBlick-Brand-Tokens, Schriften selbst gehostet (vendor/fonts). */

@font-face {
  font-family: "Officina Sans";
  src: url("vendor/fonts/OfficinaSansITCPro-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
/* Inter (SIL OFL 1.1, Lizenz in vendor/fonts/Inter-OFL-LICENSE.txt) */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("vendor/fonts/inter-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("vendor/fonts/inter-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("vendor/fonts/inter-latin-ext-600-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("vendor/fonts/inter-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("vendor/fonts/inter-latin-ext-700-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("vendor/fonts/inter-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

:root {
  /* Brand-Tokens */
  --sand-light: #F2EBE4;
  --sand-mid: #C2B8A3;
  --smoke-dark: #2D3D4B;
  --smoke-light: #DCE3EB;
  --aqua-dark: #084465;
  --aqua-mid: #60BAD3;
  --aqua-light: #CEF0F8;
  --orange-light: #FFDDBA;
  --orange-mid: #FCBC67;
  --orange-dark: #DB7922;
  --green-dark: #1A4837;
  --green-mid: #65C293;
  --green-light: #C5EDD8;
  --berry-dark: #9C2D4D;
  --berry-light: #F9E3EA;
  --white: #FFFFFF;

  /* Rollen */
  --bg: var(--sand-light);
  --surface: var(--white);
  --ink: var(--smoke-dark);
  --ink-muted: color-mix(in srgb, var(--smoke-dark) 75%, var(--white));
  --line: color-mix(in srgb, var(--sand-mid) 45%, var(--white));
  --primary: var(--aqua-dark);
  --primary-hover: color-mix(in srgb, var(--aqua-dark) 85%, #000);

  --font-head: "Officina Sans", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-code: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --r-xl: 24px;
  --r-md: 14px;
  --shadow: 0 1px 2px rgb(45 61 75 / 6%), 0 8px 24px rgb(45 61 75 / 7%);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.5;
  font-feature-settings: "zero" 1;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-head); font-weight: 500; line-height: 1.15; margin: 0; letter-spacing: -0.005em; }
h1 { font-size: 1.75rem; }
h1:focus { outline: none; }
p { margin: 0; }
a { color: var(--primary); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--aqua-mid); outline-offset: 2px; border-radius: 8px; }
.offscreen { position: fixed; left: -9999px; top: 0; }

/* ---------- Gerüst ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px;
  padding-top: max(14px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: saturate(1.3) blur(10px);
  -webkit-backdrop-filter: saturate(1.3) blur(10px);
}
.logo { height: 30px; width: auto; display: block; }
.pill {
  font-size: .8125rem; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line);
  padding: 4px 12px; border-radius: 999px;
  max-width: 55vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.stage {
  width: 100%; max-width: 560px; margin: 0 auto;
  padding: 4px 20px calc(40px + env(safe-area-inset-bottom));
}
.view { display: grid; gap: 16px; }
.view.enter { animation: viewIn 320ms var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- Fortschritt ---------- */
.steps {
  list-style: none; margin: 8px 0 22px; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
  counter-reset: step;
}
.steps li { display: grid; gap: 7px; font-size: .75rem; color: var(--ink-muted); }
.steps .dot {
  display: block; height: 6px; border-radius: 999px;
  background: color-mix(in srgb, var(--sand-mid) 55%, var(--white));
  position: relative; overflow: hidden;
}
.steps .dot::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: var(--primary);
  transform: scaleX(0); transform-origin: left;
  transition: transform 450ms var(--ease), background-color 300ms;
}
.steps li.active .dot::after { transform: scaleX(.5); background: var(--orange-dark); }
.steps li.done .dot::after { transform: scaleX(1); background: var(--green-dark); }
.steps li.active { color: var(--ink); font-weight: 600; }
.steps li.done .label::before { content: "✓ "; color: var(--green-dark); }

/* ---------- Karten ---------- */
.card {
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 24px 22px;
  box-shadow: var(--shadow);
  display: grid; gap: 14px;
}
.card.soft { background: color-mix(in srgb, var(--surface) 55%, var(--bg)); box-shadow: none; border: 1px solid var(--line); padding: 18px 20px; gap: 10px; }
.card.center { text-align: center; justify-items: center; }
.card.shake { animation: shake 360ms var(--ease); }
@keyframes shake { 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }

.hero { position: relative; padding: 18px 2px 8px; display: grid; gap: 10px; overflow: hidden; }
.hero h1 { font-size: 2.125rem; max-width: 12ch; position: relative; }
.hero .lead { position: relative; max-width: 30ch; margin-top: 4px; }
.hero-circle {
  position: absolute; right: -44px; top: -40px;
  width: 128px; height: 128px; border-radius: 50%;
  background: var(--orange-mid);
  opacity: .85;
}

.lead { font-size: 1.0625rem; color: var(--ink); }
.hint { font-size: .9375rem; color: var(--ink-muted); }
.hint.center { text-align: center; }
.notice {
  background: var(--orange-light); color: var(--ink);
  border-radius: var(--r-md); padding: 12px 16px; font-size: .9375rem;
}
.error {
  color: var(--berry-dark); background: var(--berry-light);
  border-radius: 10px; padding: 10px 14px; font-size: .9375rem;
}

/* ---------- Eingaben ---------- */
.field-label { font-weight: 600; font-size: .9375rem; }
.code-input, .otp-input, .text-input {
  width: 100%; min-height: 64px;
  border: 2px solid var(--line); border-radius: var(--r-md);
  background: var(--white); color: var(--ink);
  padding: 12px 16px;
  font: 600 1.75rem/1.2 var(--font-code);
  letter-spacing: .12em; text-align: center; text-transform: uppercase;
  transition: border-color 160ms, box-shadow 160ms;
}
.otp-input { letter-spacing: .5em; text-indent: .5em; }
.text-input { font: 400 1.0625rem/1.4 var(--font-body); letter-spacing: 0; text-align: left; text-transform: none; min-height: 56px; }
.code-input::placeholder, .otp-input::placeholder { color: color-mix(in srgb, var(--sand-mid) 70%, var(--white)); }
.code-input:focus, .otp-input:focus, .text-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--aqua-mid) 35%, transparent); }

/* ---------- Knöpfe ---------- */
.btn {
  appearance: none; border: 0; cursor: pointer;
  min-height: 56px; width: 100%;
  border-radius: var(--r-md);
  font: 600 1.0625rem/1.2 var(--font-body);
  padding: 14px 20px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  transition: background-color 160ms, transform 120ms var(--ease), opacity 160ms;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.98); }
.btn:disabled { cursor: default; opacity: .6; }
.btn.primary { background: var(--primary); color: var(--white); }
.btn.primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn.secondary { background: var(--white); color: var(--primary); border: 2px solid var(--primary); }
.btn.ghost { background: transparent; color: var(--primary); min-height: 48px; text-decoration: underline; text-underline-offset: 3px; }
.btn.light { background: var(--white); color: var(--primary); }
.btn.busy { position: relative; color: transparent; }
.btn.busy::after {
  content: ""; position: absolute; width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid currentColor; border-color: var(--white) var(--white) transparent transparent;
  animation: spin 700ms linear infinite;
}
.btn.secondary.busy::after, .btn.ghost.busy::after, .btn.light.busy::after { border-color: var(--primary) var(--primary) transparent transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 4px solid var(--aqua-light); border-top-color: var(--primary);
  animation: spin 800ms linear infinite; display: inline-block;
}
.loading { display: grid; justify-items: center; gap: 10px; padding: 10px 0; color: var(--ink-muted); }

/* ---------- Status-Symbole ---------- */
.badge-icon {
  width: 72px; height: 72px; border-radius: 50%;
  display: grid; place-items: center;
  font: 600 2rem/1 var(--font-body);
}
.badge-icon.ok { background: var(--green-light); color: var(--green-dark); animation: pop 420ms var(--ease); }
.badge-icon.ok::before { content: "✓"; }
.badge-icon.wait { background: var(--orange-light); color: var(--orange-dark); }
.badge-icon.wait::before { content: "☀"; }
.badge-icon.warn { background: var(--berry-light); color: var(--berry-dark); }
.badge-icon.warn::before { content: "!"; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }

.pulse { position: relative; width: 84px; height: 84px; display: grid; place-items: center; margin: 4px 0 6px; }
.pulse::before, .pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--orange-mid); }
.pulse::before { content: "✉"; display: grid; place-items: center; font-size: 2.25rem; color: var(--smoke-dark); z-index: 1; }
.pulse::after { animation: ripple 1.8s var(--ease) infinite; opacity: .5; }
@keyframes ripple { from { transform: scale(1); opacity: .5; } to { transform: scale(1.7); opacity: 0; } }

/* ---------- Zugangscode ---------- */
.tap-card {
  background: var(--aqua-dark); color: var(--white);
  text-align: center; justify-items: center;
  position: relative; overflow: hidden;
}
.tap-card::before {
  content: ""; position: absolute; width: 150px; height: 150px; border-radius: 50%;
  right: -70px; bottom: -80px; background: var(--orange-mid); opacity: .9;
}
.tap-card > * { position: relative; }
.tap-card .loading { color: var(--aqua-light); }
.tap-card .spinner { border-color: rgb(255 255 255 / 25%); border-top-color: var(--white); }
.tap-card [data-ref="ready"] { display: grid; gap: 14px; justify-items: center; width: 100%; }
.tap-value {
  display: flex; flex-wrap: nowrap; justify-content: center; gap: 4px; width: 100%;
  font: 600 clamp(1.5rem, 7.5vw, 2.25rem)/1 var(--font-code);
  margin: 6px 0 2px;
  animation: pop 420ms var(--ease);
}
.tap-value .ch {
  flex: 1 1 0; max-width: 1.7em; min-width: 0; padding: 12px 0; text-align: center;
  background: var(--white); color: var(--smoke-dark);
  border-radius: 10px;
}
.tap-value .digit { color: var(--aqua-dark); background: var(--aqua-light); }
.tap-value .symbol { color: var(--berry-dark); background: var(--orange-light); }
.tap-valid { color: var(--aqua-light); font-size: 1rem; }
.btn.copy { background: var(--orange-mid); color: var(--smoke-dark); max-width: 280px; }
.btn.copy.copied { background: var(--green-light); color: var(--green-dark); }
.btn.copy.small { width: auto; min-height: 40px; padding: 8px 14px; font-size: .9375rem; }

.tap-bar {
  position: sticky; top: 64px; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  background: var(--aqua-dark); color: var(--white);
  border-radius: var(--r-md); padding: 8px 8px 8px 16px;
  box-shadow: var(--shadow);
}
.tap-bar-label { font-size: .8125rem; color: var(--aqua-light); }
.tap-bar-value { font: 600 1.25rem/1 var(--font-code); letter-spacing: .06em; flex: 1; overflow-wrap: anywhere; }

/* ---------- Einrichtung ---------- */
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice {
  appearance: none; cursor: pointer;
  display: grid; justify-items: center; gap: 10px;
  padding: 22px 12px; min-height: 132px;
  background: var(--surface); color: var(--ink);
  border: 2px solid transparent; border-radius: var(--r-xl);
  box-shadow: var(--shadow);
  font: 600 1.125rem/1.2 var(--font-body);
  transition: border-color 160ms, transform 120ms var(--ease), background-color 160ms;
  -webkit-tap-highlight-color: transparent;
}
.choice:active { transform: scale(.98); }
.choice svg { width: 48px; height: 48px; fill: var(--smoke-dark); }
.choice svg .outline { fill: none; stroke: var(--smoke-dark); stroke-width: 3.5; }
.choice[aria-pressed="true"] { border-color: var(--primary); background: var(--aqua-light); }
.choice[aria-pressed="true"] svg { fill: var(--primary); }
.choice[aria-pressed="true"] svg .outline { fill: none; stroke: var(--primary); }

.lang {
  justify-self: center;
  display: inline-grid; grid-auto-flow: column; gap: 4px;
  background: var(--surface); border: 1px solid var(--line);
  padding: 4px; border-radius: 999px;
}
.lang button {
  appearance: none; border: 0; cursor: pointer; background: transparent; color: var(--ink);
  min-height: 40px; padding: 6px 18px; border-radius: 999px;
  font: 600 .9375rem/1 var(--font-body);
  transition: background-color 160ms, color 160ms;
}
.lang button[aria-pressed="true"] { background: var(--primary); color: var(--white); }

.guide { gap: 12px; animation: viewIn 320ms var(--ease); }
.guide-body { display: grid; gap: 12px; overflow-wrap: anywhere; transition: opacity 200ms; }
.guide-body.fading { opacity: .35; }
.guide-body h1, .guide-body h2 { font-size: 1.375rem; }
.guide-body h3, .guide-body h4 { font-size: 1.125rem; }
.guide-body ol, .guide-body ul { margin: 0; padding-left: 1.35em; display: grid; gap: 8px; }
.guide-body img { max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); }
.guide-body table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; font-size: .9375rem; }
.guide-body th, .guide-body td { border-bottom: 1px solid var(--line); padding: 8px; text-align: left; vertical-align: top; }
.guide-body pre, .guide-body code { font-family: var(--font-code); font-size: .9em; background: var(--sand-light); border-radius: 6px; padding: 1px 5px; white-space: pre-wrap; }
.guide-body blockquote { margin: 0; padding: 10px 14px; border-left: 4px solid var(--orange-mid); background: color-mix(in srgb, var(--orange-light) 45%, var(--white)); border-radius: 8px; }

/* ---------- Meldung unten ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 30;
  transform: translate(-50%, 16px); opacity: 0;
  background: var(--smoke-dark); color: var(--white);
  padding: 12px 20px; border-radius: 999px; font-weight: 600; font-size: .9375rem;
  transition: opacity 220ms, transform 220ms var(--ease);
  box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.noscript { padding: 20px; text-align: center; }
.desk-contact { display: block; margin-top: 4px; font-weight: 600; }
.desk-contact a { color: inherit; text-underline-offset: 3px; white-space: nowrap; }
.renew { padding: 6px 12px; }
.renew [data-ref="renew-confirm"] { display: grid; gap: 10px; padding: 10px 6px; }
@media print { .desk-contact a { text-decoration: none; } }

/* ---------- Interne Seiten ---------- */
.internal .stage { max-width: 640px; padding-top: 16px; }
.person { display: flex; align-items: center; gap: 14px; padding: 6px 0; }
.avatar {
  width: 56px; height: 56px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--orange-mid); color: var(--smoke-dark);
  font: 500 1.5rem/1 var(--font-head);
}
.person-name { font: 500 1.375rem/1.2 var(--font-head); }
.toolbar { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Druckblatt: am Bildschirm als Vorschau, im Druck allein auf A4 */
.sheet {
  background: var(--white); color: #000;
  border-radius: 6px; box-shadow: var(--shadow);
  padding: 36px 32px; display: grid; gap: 18px;
}
.sheet-logo { height: 42px; width: auto; }
.sheet-title { font-size: 1.75rem; }
.sheet-lead { font-size: 1.0625rem; }
.sheet-steps { margin: 0; padding-left: 1.4em; display: grid; gap: 14px; font-size: 1.0625rem; }
.sheet-steps li { display: list-item; padding-left: 4px; }
.sheet-steps li::marker { font-weight: 700; color: var(--orange-dark); }
.sheet-url { display: block; margin: 4px 0 2px; font: 600 1.375rem/1.2 var(--font-body); color: var(--aqua-dark); }
.sheet-code {
  display: table; margin-top: 8px;
  font: 700 2.25rem/1 var(--font-code); letter-spacing: .14em;
  border: 3px solid var(--orange-dark); border-radius: 12px;
  padding: 12px 18px;
}
.sheet-qr { width: 170px; height: 170px; justify-self: center; }
.sheet-qr svg { width: 100%; height: 100%; display: block; }
.sheet-valid { font-weight: 600; font-size: 1.0625rem; }
.sheet-foot { color: #444; font-size: .9375rem; }

@media print {
  @page { size: A4; margin: 18mm; }
  body { background: #fff; font-size: 12pt; }
  .topbar, .no-print, .toast { display: none !important; }
  .stage { max-width: none; padding: 0; }
  .view.enter { animation: none; }
  .sheet { box-shadow: none; border-radius: 0; padding: 0; gap: 8mm; }
  .sheet-qr { width: 45mm; height: 45mm; }
  .sheet-title { font-size: 22pt; }
}

/* ---------- Größere Bildschirme ---------- */
@media (min-width: 720px) {
  .stage { padding-top: 24px; }
  .hero h1 { font-size: 2.5rem; max-width: none; }
  .card { padding: 30px 30px; }
  .steps li { font-size: .8125rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
