:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --ink: #1c2431;
  --muted: #667085;
  --line: #e3e8ef;
  --brand: #2f5bea;
  --brand-dark: #2447c0;
  --ismi: #cc2028;
  --ok: #16a34a;
  --err: #dc2626;
  --warn: #d97706;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.08), 0 6px 24px rgba(16, 24, 40, 0.06);
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}

a { color: var(--brand); }

.wrap { max-width: 960px; margin: 0 auto; padding: 24px 16px; }
.wrap-narrow { max-width: 440px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}

h1 { font-size: 1.5rem; margin: 0 0 4px; }
h2 { font-size: 1.15rem; margin: 0 0 12px; }
h3 { font-size: 1rem; margin: 0 0 8px; }
.subtitle { color: var(--muted); margin: 0 0 20px; }

label { display: block; font-weight: 600; font-size: .9rem; margin: 14px 0 6px; }

input, textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--brand); border-color: var(--brand); }
textarea { min-height: 90px; resize: vertical; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--brand); color: #fff; border: none;
  padding: 10px 18px; border-radius: 8px; font-size: 1rem; font-weight: 600;
  cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--brand-dark); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-secondary { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn-secondary:hover { background: #f8fafc; }
.btn-danger { background: var(--err); }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 6px 10px; font-size: .85rem; }
.btn-block { width: 100%; justify-content: center; }

.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row-between { justify-content: space-between; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.msg { padding: 10px 14px; border-radius: 8px; margin: 12px 0; font-size: .92rem; display: none; }
.msg.show { display: block; }
.msg.error { background: #fef2f2; color: var(--err); border: 1px solid #fecaca; }
.msg.ok { background: #f0fdf4; color: var(--ok); border: 1px solid #bbf7d0; }
.msg.info { background: #eff6ff; color: var(--brand-dark); border: 1px solid #bfdbfe; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.badge.gray { background: #eef1f6; color: var(--muted); }
.badge.green { background: #dcfce7; color: var(--ok); }
.badge.blue { background: #dbeafe; color: var(--brand-dark); }
.badge.amber { background: #fef3c7; color: var(--warn); }
.badge.red { background: #fee2e2; color: var(--err); }

table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; }

/* Prüfungs-Layout */
.exam-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--card); border-bottom: 1px solid var(--line);
  padding: 12px 16px; display: flex; justify-content: space-between; align-items: center;
}
.timer { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.timer.warn { color: var(--warn); }
.timer.danger { color: var(--err); }

.question {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.q-num { color: var(--muted); font-size: .85rem; font-weight: 600; }
.q-text { font-weight: 600; margin: 6px 0 14px; }
.option {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px;
  cursor: pointer; transition: background .1s, border-color .1s;
}
.option:hover { background: #f8fafc; }
.option.selected { border-color: var(--brand); background: #eef3ff; }
.option input { width: auto; margin-top: 3px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; flex-wrap: wrap; }
.tab {
  padding: 10px 16px; cursor: pointer; border: none; background: none;
  font-size: .95rem; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent;
}
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }

.hidden { display: none !important; }

.center-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }

/* ISMI-Branding */
.brand-logo { height: 56px; width: auto; max-width: 100%; display: block; }
.brand-logo-sm { height: 34px; width: auto; }
.brand-strip { height: 4px; background: var(--ismi); border-radius: 4px 4px 0 0; margin: -24px -24px 20px; }
.login-logo { display: flex; justify-content: center; margin-bottom: 18px; color: var(--ink); }

.code-pill {
  font-family: ui-monospace, monospace; font-weight: 700; letter-spacing: .08em;
  background: #eef1f6; padding: 3px 8px; border-radius: 6px;
}

/* ============================================================
   Elegante Anmeldeseite (warmes Creme, Serifen, Implantat-Emblem)
   ============================================================ */
body.page-login { background: #efe9dd; }

.auth-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 30px 16px; }
.auth-card {
  width: 100%; max-width: 520px; text-align: center; position: relative; overflow: hidden;
  background: #faf7f0; border: 1px solid #e7ddc9; border-radius: 16px;
  box-shadow: 0 1px 2px rgba(60,50,30,.06), 0 22px 55px rgba(60,45,20,.12);
  padding: 46px 50px 40px;
}
.auth-topbar { position: absolute; left: 0; right: 0; top: 0; height: 5px;
  background: linear-gradient(90deg, #c8102e, #9d0f18); }

.auth-logo { margin: 2px auto 0; }
.auth-logo img { height: 44px; width: auto; max-width: 100%; display: block; margin: 0 auto; }
.auth-divider { width: 56px; margin: 20px auto 2px; border: 0; border-top: 1.5px solid #c7ac6e; }
.auth-divider::after { content: ""; display: block; width: 56px; margin: 3px auto 0; border-top: 1.5px solid #c7ac6e; }

.auth-emblem { margin: 20px auto 4px; }
.auth-emblem img { height: 158px; width: auto; display: block; margin: 0 auto; }

.auth-eyebrow { text-transform: uppercase; letter-spacing: .34em; padding-left: .34em;
  font-size: .74rem; font-weight: 600; color: #a99f8c; margin: 16px 0 3px; }
.auth-title { font-family: var(--serif); font-size: 2.5rem; font-weight: 700; color: #232323; line-height: 1.08; margin: 8px 0 2px; }
.auth-year { font-family: var(--serif); letter-spacing: .3em; padding-left: .3em; font-size: 1.1rem; font-weight: 600; color: #9a7b3f; margin: 0 0 14px; }
.auth-rule { width: 120px; height: 2px; background: #b9932f; border: 0; margin: 0 auto 22px; }
.auth-subtitle { font-family: var(--serif); font-size: 1.1rem; color: #4a463d; max-width: 40ch; margin: 0 auto 30px; }

.auth-form { text-align: left; }
.auth-form label { display: block; text-transform: uppercase; letter-spacing: .14em;
  font-size: .72rem; font-weight: 700; color: #8a8272; margin: 0 0 8px; }
.auth-input {
  width: 100%; padding: 15px 16px; font-size: 1.05rem; color: #2b2b2b;
  border: 1px solid #d9cdb4; border-radius: 10px; background: #fffdf8;
  font-family: inherit; letter-spacing: .1em; text-transform: uppercase;
}
.auth-input::placeholder { letter-spacing: .05em; color: #b6ab95; text-transform: none; }
.auth-input:focus { outline: none; border-color: #c8102e; box-shadow: 0 0 0 3px rgba(200,16,46,.13); }

.auth-btn {
  width: 100%; margin-top: 22px; padding: 16px; border: 0; border-radius: 10px;
  background: #7d1420; color: #fbefe0; font-size: 1.05rem; font-weight: 600; letter-spacing: .02em;
  font-family: inherit; cursor: pointer; transition: background .15s, transform .05s;
}
.auth-btn:hover { background: #661019; }
.auth-btn:active { transform: translateY(1px); }

.auth-msg { display: none; margin: 0 0 16px; padding: 11px 14px; border-radius: 10px; font-size: .92rem; text-align: left; }
.auth-msg.show { display: block; }
.auth-msg.error { background: #fdecec; color: #a01019; border: 1px solid #f3c9cc; }

.auth-note { text-align: left; font-size: .86rem; color: #8a8272; line-height: 1.6; margin: 30px 0 0;
  padding-top: 22px; border-top: 1px solid #ece3d1; }
.auth-foot { margin: 18px 0 0; font-size: .82rem; color: #b6ab95; }
.auth-foot a { color: #9a7b3f; text-decoration: none; }
.auth-foot a:hover { text-decoration: underline; }

@media (max-width: 560px) {
  .auth-card { padding: 34px 24px 30px; }
  .auth-title { font-size: 2.1rem; }
}

/* ============================================================
   Durchgängiges warmes Erscheinungsbild (Prüfung, Kommission)
   ============================================================ */
body.page-warm { background: #efe9dd; }
body.page-warm .card {
  background: #faf7f0; border-color: #e7ddc9;
  box-shadow: 0 1px 2px rgba(60,50,30,.05), 0 12px 34px rgba(60,45,20,.08);
}
body.page-warm h1, body.page-warm h2, body.page-warm h3 { font-family: var(--serif); color: #232323; }
body.page-warm .subtitle { color: #6a6456; }
body.page-warm a { color: #9a7b3f; }
body.page-warm .btn { background: #7d1420; }
body.page-warm .btn:hover { background: #661019; }
body.page-warm .btn-ismi { background: #c8102e; }
body.page-warm .btn-ismi:hover { background: #a5101a; }
body.page-warm .btn-secondary { background: #fffdf8; color: #2b2b2b; border: 1px solid #e0d6c2; }
body.page-warm .btn-secondary:hover { background: #f3ecdd; }
body.page-warm .btn-danger { background: #b02a2a; }
body.page-warm input, body.page-warm textarea, body.page-warm select { background: #fffdf8; border-color: #d9cdb4; }
body.page-warm input:focus, body.page-warm textarea:focus, body.page-warm select:focus { outline: 2px solid #c8102e; border-color: #c8102e; }
body.page-warm .option { border-color: #e0d6c2; }
body.page-warm .option:hover { background: #f6efe1; }
body.page-warm .option.selected { border-color: #c8102e; background: #faf0ec; }
body.page-warm .brand-strip { background: #c8102e; }
body.page-warm .exam-header { background: #faf7f0; border-bottom-color: #e7ddc9; }
body.page-warm .timer { color: #232323; }
body.page-warm .msg.info { background: #f4f0e6; color: #7a6a3a; border-color: #e6dcc4; }
body.page-warm .tabs { border-bottom-color: #e7ddc9; }
body.page-warm .tab.active { color: #c8102e; border-bottom-color: #c8102e; }
body.page-warm .code-pill { background: #f0e9da; }
body.page-warm th { color: #8a8272; }
body.page-warm th, body.page-warm td { border-bottom-color: #ece3d1; }

/* Markenleiste oben auf den Prüfungsseiten */
.brandbar { display: flex; justify-content: center; padding: 22px 16px 4px; }
.brandbar img { height: 40px; width: auto; }

/* ============================================================
   Sprachumschalter (Flaggen DE/EN)
   ============================================================ */
.lang-switch { display: inline-flex; gap: 4px; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 5px; line-height: 1;
  padding: 5px 9px; border: 1px solid #e0d6c2; background: #fffdf8;
  border-radius: 8px; cursor: pointer; font-size: .78rem; font-weight: 700; color: #8a8272;
  font-family: inherit;
}
.lang-btn svg { border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.08); display: block; }
.lang-btn:hover { background: #f3ecdd; }
.lang-btn.active { border-color: #c8102e; color: #232323; background: #fff; }
.auth-lang { position: absolute; top: 14px; right: 16px; }
.lang-fixed { position: fixed; top: 12px; right: 14px; z-index: 30; }
@media (max-width: 560px) { .auth-lang { top: 10px; right: 10px; } .lang-btn span { display: none; } }
