/* ─── KHA Drive One · Prüfungsfit Theorie ─── */
:root {
  --navy: #0A0E1A;
  --navy2: #111827;
  --navy3: #1a2a5e;
  --gold: #C9A84C;
  --gold2: #E8C96A;
  --green: #3CB371;
  --orange: #F47C20;
  --red: #E74C3C;
  --white: #ffffff;
  --muted: rgba(255,255,255,0.55);
  --card: rgba(255,255,255,0.06);
  --border: rgba(255,255,255,0.1);
  --radius: 13px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  background: #060a14;
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--white);
  overscroll-behavior: none;
}

/* ─── APP SHELL ─────────────────────────────── */
#app {
  max-width: 430px;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* ─── SCREENS ───────────────────────────────── */
.screen {
  display: none;
  flex-direction: column;
  min-height: 100dvh;
  animation: fadeIn 0.3s ease;
}
.screen.active { display: flex; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideQ {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes correct {
  0%,100% { transform: scale(1); }
  50%      { transform: scale(1.02); }
}

/* ─── SHARED NAV ────────────────────────────── */
.nav-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 12px;
  flex-shrink: 0;
}
.nav-back {
  background: rgba(255,255,255,0.08);
  border: none;
  color: var(--white);
  border-radius: 50%;
  width: 34px; height: 34px;
  cursor: pointer;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}
.nav-back:hover { background: rgba(255,255,255,0.15); }
.nav-title { color: var(--white); font-size: 16px; font-weight: 700; flex: 1; }

/* ─── PROGRESS BAR ──────────────────────────── */
.prog-wrap { padding: 0 20px; flex-shrink: 0; }
.prog-bar { height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px; }
.prog-fill { height: 100%; background: var(--gold); border-radius: 2px; transition: width 0.5s ease; }

/* ─── BUTTONS ───────────────────────────────── */
.btn-gold {
  background: var(--gold); color: var(--navy);
  border: none; border-radius: var(--radius);
  padding: 16px; font-size: 16px; font-weight: 800;
  cursor: pointer; width: 100%;
  transition: background 0.2s, transform 0.1s;
  letter-spacing: 0.3px;
}
.btn-gold:hover { background: var(--gold2); }
.btn-gold:active { transform: scale(0.98); }

.btn-orange {
  background: var(--orange); color: var(--white);
  border: none; border-radius: var(--radius);
  padding: 14px 18px; font-size: 15px; font-weight: 800;
  cursor: pointer; display: flex; align-items: center; justify-content: space-between;
  transition: background 0.2s, transform 0.1s;
}
.btn-orange:hover { background: #e06010; }
.btn-orange:active { transform: scale(0.98); }

.btn-ghost {
  background: var(--card); border: 1px solid var(--border);
  color: var(--white); border-radius: var(--radius);
  padding: 13px; font-size: 14px; font-weight: 600;
  cursor: pointer; text-align: center;
  transition: background 0.2s;
}
.btn-ghost:hover { background: rgba(255,255,255,0.1); }

.btn-weiter {
  background: var(--gold); color: var(--navy);
  border: none; border-radius: var(--radius);
  padding: 15px; font-size: 15px; font-weight: 800;
  cursor: pointer; width: 100%;
  opacity: 0.3; pointer-events: none;
  transition: opacity 0.25s, background 0.2s, transform 0.1s;
}
.btn-weiter.on { opacity: 1; pointer-events: all; }
.btn-weiter.on:hover { background: var(--gold2); }
.btn-weiter.on:active { transform: scale(0.98); }

.btn-weiter-tr {
  background: var(--orange); color: var(--white);
  border: none; border-radius: var(--radius);
  padding: 14px; font-size: 15px; font-weight: 800;
  cursor: pointer; width: 100%; display: none;
  transition: background 0.2s, transform 0.1s;
}
.btn-weiter-tr.show { display: block; }
.btn-weiter-tr:active { transform: scale(0.98); }

/* ─── LANDING SCREEN ────────────────────────── */
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.6} }
@keyframes shimmer { 0%{background-position:-200% center} 100%{background-position:200% center} }

#splash { padding: 0; justify-content: flex-start; overflow-y: auto; }

.ls-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 24px 0; flex-shrink: 0;
}
.ls-brand-badge { display: flex; align-items: center; gap: 8px; }
.ls-brand-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold); animation: pulse 2s ease-in-out infinite;
}
.ls-brand-text {
  color: var(--gold); font-size: 11px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
}
.ls-module-tag { color: var(--muted); font-size: 11px; letter-spacing: 1px; }

.ls-hero { flex: 1; padding: 24px 26px 0; }

.ls-congrats {
  color: var(--gold); font-size: 12px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 14px;
}
.ls-headline {
  color: var(--white); font-size: 26px; font-weight: 800;
  line-height: 1.18; letter-spacing: -0.3px; margin-bottom: 16px;
}
.ls-headline-gold {
  background: linear-gradient(90deg, var(--gold), var(--gold2), var(--gold));
  background-size: 200% auto;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s linear infinite;
}
.ls-subline {
  color: var(--muted); font-size: 14px; line-height: 1.55; margin-bottom: 22px;
}
.ls-subline strong { color: rgba(255,255,255,0.85); font-weight: 600; }

.ls-stats { display: flex; gap: 8px; margin-bottom: 22px; }
.ls-stat {
  flex: 1; background: var(--card);
  border: 0.5px solid var(--border);
  border-radius: 11px; padding: 10px 10px; text-align: center;
}
.ls-stat-num {
  color: var(--gold); font-size: 17px; font-weight: 800; display: block;
}
.ls-stat-label { color: var(--muted); font-size: 10px; margin-top: 2px; display: block; line-height: 1.3; }

.ls-steps-label {
  color: var(--muted); font-size: 11px; font-weight: 600;
  letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 10px;
}
.ls-steps { display: flex; flex-direction: column; gap: 8px; }
.ls-step {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 0.5px solid var(--border);
  border-radius: 11px; padding: 11px 13px;
}
.ls-step-icon {
  width: 34px; height: 34px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.ls-ic-gold  { background: rgba(201,168,76,0.2); }
.ls-ic-green { background: rgba(62,193,113,0.2); }
.ls-ic-orange{ background: rgba(244,124,32,0.2); }
.ls-step-body { flex: 1; }
.ls-step-title { color: var(--white); font-size: 13px; font-weight: 700; }
.ls-step-sub   { color: var(--muted); font-size: 11px; margin-top: 2px; }
.ls-step-time  { color: var(--muted); font-size: 11px; flex-shrink: 0; }

.ls-cta-wrap { padding: 20px 24px 12px; flex-shrink: 0; }
.ls-cta-btn { font-size: 15px; letter-spacing: 0.2px; }
.ls-no-account {
  color: rgba(255,255,255,0.35); font-size: 11px;
  text-align: center; margin-top: 10px; line-height: 1.4;
}

.ls-footer {
  display: flex; align-items: center; gap: 8px;
  padding: 0 24px 24px; flex-shrink: 0;
}
.ls-footer-logo {
  width: 20px; height: 20px; border-radius: 5px;
  background: var(--gold); display: flex; align-items: center;
  justify-content: center; font-size: 9px; font-weight: 800;
  color: var(--navy); flex-shrink: 0;
}
.ls-footer-text { color: rgba(255,255,255,0.22); font-size: 11px; }

/* ─── HOME ──────────────────────────────────── */
.home-header { padding: 28px 22px 12px; flex-shrink: 0; }
.home-greet { color: var(--muted); font-size: 13px; }
.home-title { color: var(--white); font-size: 22px; font-weight: 800; margin-top: 2px; }
.home-cards { padding: 8px 18px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.home-card {
  background: var(--card); border-radius: var(--radius);
  padding: 16px 18px; display: flex; align-items: center; gap: 14px;
  cursor: pointer; border: 1px solid var(--border);
  transition: border-color 0.2s, background 0.2s;
}
.home-card:hover { border-color: rgba(255,255,255,0.25); background: rgba(255,255,255,0.09); }
.home-card:active { transform: scale(0.99); }
.hc-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.hc-info { flex: 1; }
.hc-title { color: var(--white); font-size: 15px; font-weight: 700; }
.hc-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.hc-arr { color: var(--muted); font-size: 20px; }

/* ─── LERNTYP TEST ──────────────────────────── */
.lt-top { padding: 20px 22px 14px; flex-shrink: 0; }
.q-wrap { flex: 1; padding: 16px 22px 0; overflow-y: auto; }
.q-wrap.slide { animation: slideQ 0.3s ease both; }
.q-text { color: var(--white); font-size: 19px; font-weight: 700; line-height: 1.4; margin-bottom: 24px; }
.opts { display: flex; flex-direction: column; gap: 10px; }
.opt {
  background: var(--card); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  color: var(--white); font-size: 14px; cursor: pointer;
  text-align: left; line-height: 1.45;
  display: flex; align-items: center; gap: 12px;
  transition: border-color 0.15s, background 0.15s;
}
.opt:hover { border-color: rgba(255,255,255,0.3); }
.opt.selected { border-color: var(--gold); background: rgba(201,168,76,0.15); }
.opt-dot {
  width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.25);
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-size: 12px; transition: all 0.2s;
}
.opt.selected .opt-dot { background: var(--gold); border-color: var(--gold); color: var(--navy); font-weight: 800; }
.lt-footer { padding: 16px 22px 32px; flex-shrink: 0; }

/* ─── ERGEBNIS ──────────────────────────────── */
.erg-icon {
  width: 86px; height: 86px; border-radius: 50%;
  background: rgba(201,168,76,0.15);
  margin: 12px auto 16px;
  display: flex; align-items: center; justify-content: center; font-size: 42px;
}
.erg-type { color: var(--white); font-size: 24px; font-weight: 800; text-align: center; }
.erg-desc { color: var(--muted); font-size: 14px; text-align: center; padding: 8px 28px 18px; line-height: 1.55; }
.reco-wrap { padding: 0 20px; flex: 1; }
.reco-label { color: var(--green); font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 10px; }
.reco-item { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 0.5px solid rgba(255,255,255,0.08); }
.reco-check { width: 24px; height: 24px; border-radius: 50%; background: var(--green); display: flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; }
.reco-text { color: var(--white); font-size: 14px; }
.erg-btns { padding: 16px 20px 32px; display: flex; flex-direction: column; gap: 8px; }

/* ─── BOOSTKARTEN LISTE ─────────────────────── */
.karten-list { flex: 1; padding: 6px 16px 24px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.karte {
  border-radius: var(--radius); padding: 15px 16px;
  cursor: pointer; transition: transform 0.15s, opacity 0.15s;
  position: relative;
}
.karte:hover { transform: scale(1.01); }
.karte:active { transform: scale(0.99); }
.karte.green { background: var(--green); }
.karte.orange { background: var(--orange); }
.karte.grey { background: rgba(255,255,255,0.08); border: 1px solid var(--border); }
.karte-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.karte-body { flex: 1; }
.karte-title { color: var(--white); font-size: 15px; font-weight: 700; }
.karte-sub { color: rgba(255,255,255,0.75); font-size: 12px; margin-top: 4px; }
.karte-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.karte-badge { background: rgba(255,255,255,0.22); border-radius: 6px; padding: 3px 8px; font-size: 10px; color: var(--white); font-weight: 700; white-space: nowrap; }
.karte-done {
  width: 24px; height: 24px; border-radius: 6px;
  background: rgba(255,255,255,0.18); border: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--white); cursor: pointer;
  transition: all 0.2s;
}
.karte-done.ok { background: rgba(255,255,255,0.85); color: #333; }

/* ─── KARTE DETAIL ──────────────────────────── */
.kd-body { flex: 1; padding: 16px 22px 8px; overflow-y: auto; }
.kd-cat { font-size: 11px; font-weight: 700; color: var(--green); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 6px; }
.kd-title { color: var(--white); font-size: 24px; font-weight: 800; margin-bottom: 20px; line-height: 1.2; }
.kd-section { margin-bottom: 16px; }
.kd-label { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; margin-bottom: 6px; }
.kd-text { color: var(--white); font-size: 14px; line-height: 1.6; }
.kd-box {
  border-radius: 10px; padding: 13px 15px;
  font-size: 14px; line-height: 1.55;
}
.kd-box.example { background: var(--card); color: rgba(255,255,255,0.85); border-left: 3px solid var(--green); }
.kd-box.merksatz { background: rgba(244,124,32,0.15); color: var(--orange); font-weight: 600; border-left: 3px solid var(--orange); }
.kd-footer { padding: 12px 20px 32px; flex-shrink: 0; }
.btn-verstanden { width: 100%; background: var(--green); color: var(--white); border: none; border-radius: var(--radius); padding: 14px; font-size: 15px; font-weight: 800; cursor: pointer; transition: all 0.2s; }
.btn-verstanden.done { background: rgba(255,255,255,0.15); }
.btn-verstanden:active { transform: scale(0.98); }

/* ─── TRAINING / TEST ───────────────────────── */
.frage-top { padding: 18px 22px 12px; flex-shrink: 0; }
.frage-text { color: var(--white); font-size: 18px; font-weight: 700; line-height: 1.45; padding: 14px 22px 16px; flex-shrink: 0; white-space: pre-line; }
.antworten { padding: 0 18px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.antwort {
  background: var(--card); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 13px 16px;
  color: var(--white); font-size: 14px; cursor: pointer;
  text-align: left; line-height: 1.4; transition: all 0.2s;
}
.antwort:hover:not(.locked) { border-color: rgba(255,255,255,0.3); background: rgba(255,255,255,0.09); }
.antwort.richtig { border-color: var(--green); background: rgba(62,193,113,0.18); animation: correct 0.3s ease; }
.antwort.falsch  { border-color: var(--red);   background: rgba(231,76,60,0.15); }
.antwort.locked  { cursor: default; }
.feedback-box {
  margin: 12px 18px 0; padding: 12px 14px; border-radius: 10px;
  font-size: 13px; line-height: 1.5; display: none;
}
.feedback-box.show { display: block; }
.feedback-box.ok  { background: rgba(62,193,113,0.12); color: var(--green); border-left: 3px solid var(--green); }
.feedback-box.nok { background: rgba(231,76,60,0.10);  color: var(--red);   border-left: 3px solid var(--red); }
.tr-footer { padding: 14px 18px 32px; flex-shrink: 0; }

/* ─── SCORE / TESTERGEBNIS ──────────────────── */
.score-wrap {
  margin: 24px auto 10px;
  position: relative; width: 130px; height: 130px;
}
.score-svg { transform: rotate(-90deg); display: block; }
.score-label {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%); text-align: center;
}
.score-num { color: var(--white); font-size: 30px; font-weight: 800; display: block; }
.score-sub { font-size: 12px; font-weight: 700; display: block; margin-top: 2px; }
.schw-wrap { width: 100%; padding: 0 22px 12px; }
.schw-title { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.schw-item { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; margin-bottom: 6px; }
.schw-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--orange); flex-shrink: 0; }
.score-btns { padding: 8px 20px 32px; display: flex; flex-direction: column; gap: 8px; }

/* ─── INSTALL BANNER ────────────────────────── */
#install-banner {
  display: none;
  position: fixed; bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%; max-width: 430px;
  background: var(--navy2);
  border-top: 1px solid var(--border);
  padding: 14px 20px;
  z-index: 999;
  flex-direction: row; align-items: center; gap: 12px;
}
#install-banner.show { display: flex; }
.install-text { flex: 1; font-size: 13px; color: var(--white); line-height: 1.4; }
.install-text strong { color: var(--gold); }
.btn-install { background: var(--gold); color: var(--navy); border: none; border-radius: 8px; padding: 8px 14px; font-size: 13px; font-weight: 800; cursor: pointer; white-space: nowrap; }
.btn-install-close { background: none; border: none; color: var(--muted); font-size: 20px; cursor: pointer; padding: 0 4px; }

/* ─── SCROLLBAR ─────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

/* ═══ SPRACHUMSCHALTER (v3.2) ═════════════════════════════ */
.lang-bar {
  display: flex;
  gap: 6px;
  padding: 8px 22px 0;
  flex-wrap: wrap;
}
.home-header .lang-bar { padding: 12px 0 0; }
.lang-chip {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.65);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.lang-chip:active { transform: scale(0.95); }
.lang-chip.active {
  background: rgba(201,168,76,0.2);
  border-color: #C9A84C;
  color: #C9A84C;
}

/* ═══ RTL (Arabisch) ══════════════════════════════════════ */
html[dir="rtl"] body { direction: rtl; }
html[dir="rtl"] .nav-back,
html[dir="rtl"] .hc-arr { transform: scaleX(-1); }
html[dir="rtl"] .ls-headline,
html[dir="rtl"] .ls-subline,
html[dir="rtl"] .q-text,
html[dir="rtl"] .frage-text,
html[dir="rtl"] .kd-body,
html[dir="rtl"] .feedback-box { text-align: right; }
