/* ROCK your BABY corporate identity, as on rock-your-baby.de ("Familienatelier"
   tokens) and in Branding/CI.md:
   Nachtviolett #21173e · Mondgelb #f6c566 · Creme #fce6ba · Mint #62bf9f ·
   Hautrosa #f1b88d. Web roles: paper #fffaf3 background, petrol #21665d for
   actions and links, line #dcd5cc, quiet #595466 for secondary text.
   Font: Nunito, self-hosted (fonts/OFL.txt), no third-party requests.
   admin.css uses --bg --card --text --muted --border --primary --ok(-bg)
   --bad(-bg) --shadow --mono; keep those names. */
@font-face {
  font-family: "Nunito";
  src: url("/fonts/nunito-latin.woff2?v=1") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #21173e;
  --paper: #fffaf3;
  --cream: #fce6ba;
  --gold: #f6c566;
  --mint: #62bf9f;
  --petrol: #21665d;
  --petrol-dark: #174d46;

  --bg: var(--paper);
  --card: #ffffff;
  --text: var(--ink);
  --muted: #595466;
  --border: #dcd5cc;
  --accent: var(--petrol);
  --selection: #e2f3ec;
  --primary: var(--petrol);
  --primary-hover: var(--petrol-dark);
  --primary-text: #ffffff;
  --secondary-bg: var(--paper);
  --ok: var(--petrol);
  --ok-bg: var(--selection);
  --bad: #963f36;
  --bad-bg: #f7e5e1;
  --shadow: 0 4px 16px rgba(33, 23, 62, 0.08);
  --font: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius-card: 22px;
  --radius-control: 10px;
}

/* The website's night palette. Primary actions turn mint with ink text. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #19122e;
    --card: #251b40;
    --text: var(--cream);
    --muted: #d6c9db;
    --border: #594966;
    --accent: #8ed8bb;
    --selection: rgba(142, 216, 187, 0.16);
    --primary: var(--mint);
    --primary-hover: #8ed8bb;
    --primary-text: var(--ink);
    --secondary-bg: transparent;
    --ok: #8ed8bb;
    --ok-bg: rgba(142, 216, 187, 0.16);
    --bad: #f0a493;
    --bad-bg: rgba(150, 63, 54, 0.32);
    --shadow: none;
  }
}

* { box-sizing: border-box; }

/* The `hidden` attribute must always win, even over rules like `.modal` or
   `.admin-login` that set `display`. Without this, hidden overlays (the device
   modal, the login view) stay visible and can't be dismissed. */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; }

a { color: var(--accent); text-underline-offset: 0.18em; }

:is(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.mono { font-family: var(--mono); }

.wrap {
  max-width: 580px;
  margin: 0 auto;
  padding: 28px 16px 40px;
  min-height: calc(100vh - 73px);
  display: flex;
  flex-direction: column;
}

/* Full-width header bar as on rock-your-baby.de: brand left, language
   switch right (DE first), sticky, paper with a thin line below. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  max-width: 1248px;
  min-height: 72px;
  margin: 0 auto;
  padding: 0 clamp(16px, 5vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.logo {
  width: 46px;
  height: 46px;
  display: block;
  flex: none;
}
.brand-name { font-weight: 800; font-size: 1.05rem; letter-spacing: -0.01em; line-height: 1.25; }
.brand-sub { color: var(--muted); font-size: 0.875rem; line-height: 1.3; }

/* Language switcher, right end of the header bar (segmented, as on the website). */
.lang-switch {
  flex: none;
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 999px;
}
.lang-btn {
  appearance: none;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 400;
  min-width: 32px;
  height: 32px;
  padding: 0 7px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.lang-btn:hover:not(.is-active) { color: var(--accent); }
.lang-btn.is-active {
  background: var(--selection);
  color: var(--accent);
  font-weight: 850;
}

.screen {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  padding: clamp(24px, 6vw, 36px) clamp(18px, 5vw, 32px);
  text-align: center;
  animation: fade 0.25s ease;
}
@keyframes fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .screen { animation: none; }
}

h1 {
  font-size: clamp(1.55rem, 1.35rem + 1vw, 2rem);
  font-weight: 850;
  line-height: 1.12;
  letter-spacing: -0.035em;
  text-wrap: balance;
  margin: 0 0 14px;
}
.lead { font-size: 1.08rem; line-height: 1.52; color: var(--text); margin: 0 auto 24px; max-width: 42ch; }
.fineprint { color: var(--muted); font-size: 0.9rem; line-height: 1.45; margin: 16px auto 0; max-width: 44ch; }
.status { color: var(--muted); min-height: 1.4em; margin-top: 16px; }

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.25;
  padding: 0.7em 1.3em;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.05s, opacity 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-lg { min-height: 52px; padding: 0.8em 1.7em; font-size: 1.08rem; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-secondary { background: var(--secondary-bg); color: var(--accent); border-color: var(--accent); font-weight: 750; }
.btn-secondary:hover:not(:disabled) { background: var(--selection); }
.link-btn {
  background: none; border: none; color: var(--accent); text-decoration: underline;
  text-underline-offset: 0.18em; cursor: pointer; font: inherit; font-weight: 700; padding: 0;
}

.badge {
  width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 2rem; font-weight: 800; margin: 0 auto 16px;
}
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }

.support-list { list-style: none; padding: 0; margin: 20px auto; max-width: 320px; text-align: left; }
.support-item {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-control); margin-bottom: 8px;
}
.ok { color: var(--ok); font-weight: 700; }
.bad { color: var(--bad); font-weight: 700; }

.versions {
  display: flex; align-items: stretch; justify-content: center; gap: 12px;
  margin: 8px 0 20px; flex-wrap: wrap;
}
.version-box {
  border: 1px solid var(--border); border-radius: 14px; padding: 14px 18px; min-width: 140px;
}
.version-box-new { border-color: var(--accent); background: var(--selection); }
.version-label { color: var(--muted); font-size: 0.75rem; font-weight: 850; text-transform: uppercase; letter-spacing: 0.075em; }
.version-value { font-size: 1.05rem; margin-top: 4px; word-break: break-all; }
.version-arrow { display: grid; place-items: center; color: var(--muted); font-size: 1.4rem; }

.progress {
  height: 12px; background: var(--border); border-radius: 999px; overflow: hidden; margin: 24px 0 8px;
}
.progress-bar {
  height: 100%; width: 0; background: var(--primary); border-radius: 999px;
  transition: width 0.4s ease;
}

.fallback-steps {
  text-align: left;
  margin: 20px auto 24px;
  max-width: 44ch;
  padding-left: 1.4em;
}
.fallback-steps li { margin-bottom: 10px; }

.error-details { text-align: left; margin: 12px auto 20px; max-width: 44ch; }
.error-details summary { cursor: pointer; color: var(--muted); font-size: 0.9rem; }
.error-details pre {
  white-space: pre-wrap; word-break: break-word; background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius-control); padding: 10px; font-size: 0.85rem;
}

.consent {
  background: var(--card); border-bottom: 1px solid var(--border);
  padding: 10px 16px; font-size: 0.85rem; color: var(--muted);
  display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap;
}

.foot {
  margin-top: auto; padding-top: 28px; text-align: center;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px;
}
.foot a { color: var(--muted); font-size: 0.85rem; text-decoration: none; }
.foot a:hover { color: var(--accent); text-decoration: underline; }
.foot-version { flex-basis: 100%; color: var(--muted); font-size: 0.8rem; opacity: 0.8; }
