/* ============================================================
   SachkundeTOGO Lehrbuch – Theme „Modern App"
   ------------------------------------------------------------
   Klar, app-mäßig, viel Weißraum, runde Karten, frische Akzente.
   ANPASSEN: die wichtigsten Werte stehen oben in :root.
   ============================================================ */

:root {
  /* —— Markenfarbe / Akzent: Petrol (pro Themengebiet per JS überschrieben) —— */
  --accent: #1C44D8;            /* 34A Royal-Blau (Marken-Logo) */
  --accent-2: #122E96;          /* dunkleres Blau (Text/Hover) */
  --accent-soft: #E7ECFD;       /* helle Akzentfläche (Blau) */
  --accent-ink: #ffffff;
  --brand: #1C44D8;             /* feste Markenfarbe (Chrome), unabhängig vom Thema */

  /* —— Flächen (hell & clean) —— */
  --bg: #F4F6FC;                /* fast weiß, leicht blaustichig */
  --bg-page: #FFFFFF;
  --bar: #FFFFFF;

  /* —— Text (tiefes Slate) —— */
  --text: #12242B;
  --text-muted: #5B6C74;
  --bar-ink: #12242B;

  /* —— Linien / Schatten / Rundungen (flach & dezent, kein „Floaty") —— */
  --line: #E2E8EA;
  --shadow: 0 1px 2px rgba(16, 40, 48, .05), 0 6px 18px rgba(16, 40, 48, .06);
  --shadow-lg: 0 14px 40px rgba(16, 40, 48, .12);
  --radius: 18px;
  --radius-sm: 12px;
  --maxw: 760px;

  /* —— Schrift: durchgehend Inter (app-typisch) —— */
  --font-head: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --font-step: 1;
}

[data-theme="dark"] {
  --accent: #6486FF;                 /* helleres Blau für Dunkelmodus */
  --accent-2: #1C44D8;
  --accent-soft: #18213f;
  --accent-ink: #ffffff;
  --brand: #6486FF;
  --bg: #0E1417;
  --bg-page: #151c20;
  --bar: #121a1e;
  --text: #EAF0F1;
  --text-muted: #8FA0A6;
  --bar-ink: #EAF0F1;
  --line: #233037;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 18px rgba(0, 0, 0, .35);
  --shadow-lg: 0 14px 40px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.no-select {
  -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none;
  -webkit-touch-callout: none;
}
.no-select input { -webkit-user-select: text; user-select: text; }

.view { min-height: 100%; }
[hidden] { display: none !important; }

/* ===================== LOGIN / ONBOARDING ===================== */
.login-view {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(760px 420px at 50% -12%, var(--accent-soft), transparent 64%),
    var(--bg);
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bar);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 34px 28px 26px;
  text-align: center;
}
.login-logo {
  width: 104px; height: 104px; object-fit: contain;
  display: block; margin: 0 auto 14px;
}
.brand { display: flex; flex-direction: column; gap: 3px; margin-bottom: 18px; }
.brand-mark { font-size: 19px; font-weight: 700; letter-spacing: .2px; color: var(--text); }
.brand-mark strong { color: var(--accent); }
.brand-sub { font-size: 11px; text-transform: uppercase; letter-spacing: 2.5px; color: var(--text-muted); }
.login-title { font-family: var(--font-head); font-weight: 800; font-size: 22px; line-height: 1.25; margin: 6px 0 6px; color: var(--text); }
.login-hint { color: var(--text-muted); font-size: 14px; margin: 0 0 20px; }
.code-input {
  width: 100%;
  font-size: 17px;
  font-weight: 600;
  text-align: center;
  letter-spacing: 1px;
  padding: 15px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  margin-bottom: 12px;
  text-transform: uppercase;
  transition: border-color .15s, box-shadow .15s;
}
.code-input::placeholder { color: var(--text-muted); font-weight: 500; letter-spacing: .5px; }
.code-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.btn-primary {
  width: 100%; font-size: 16px; font-weight: 700;
  padding: 15px; border: none; border-radius: var(--radius-sm);
  background: var(--accent); color: var(--accent-ink); cursor: pointer;
  box-shadow: 0 10px 22px color-mix(in srgb, var(--accent) 32%, transparent);
  transition: transform .08s, filter .15s;
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: .6; cursor: default; box-shadow: none; }
.btn-ghost {
  width: 100%; margin-top: 11px; font-size: 14px; font-weight: 700;
  padding: 13px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: transparent; color: var(--accent); cursor: pointer;
  transition: border-color .15s, background .15s;
}
.btn-ghost:hover { border-color: var(--accent); background: var(--accent-soft); }
.btn-ghost:active { transform: translateY(1px); }
.login-error { color: #d23f31; font-size: 14px; margin: 13px 0 0; }
[data-theme="dark"] .login-error { color: #ff8f7e; }
.login-foot { color: var(--text-muted); font-size: 12px; margin: 18px 0 0; }

/* ===================== WASSERZEICHEN ===================== */
.watermark {
  position: fixed; inset: 0; z-index: 50;
  pointer-events: none; background-repeat: repeat; display: none;
}
