/* ═══════════════════════════════════════════════════════════════
   Der Internet-Führerschein — „Amtlich, aber herzlich“
   Prüfungsbogen-Ästhetik: warmes Papier, Verkehrsschild-Blau,
   Stempel, große Schrift. Body: Atkinson Hyperlegible (für
   Sehschwäche entworfen), Display: Fraunces.
   ═══════════════════════════════════════════════════════════════ */

:root {
  --paper: #f8f1e0;
  --paper-deep: #f1e6cd;
  --card: #fffdf6;
  --ink: #2b3a42;
  --ink-soft: #5d6b72;
  --blue: #1c5bb8;
  --blue-deep: #12407f;
  --amber: #e8930c;
  --amber-soft: #fdeed2;
  --green: #2e7d32;
  --green-soft: #e7f3e7;
  --red: #c22f2f;
  --red-soft: #fbeaea;
  --line: #d9cba8;
  --shadow: 0 2px 0 #e6d9ba, 0 12px 28px -12px rgba(90, 70, 30, .35);
  --radius: 14px;
  --font-body: "Atkinson Hyperlegible", "Trebuchet MS", sans-serif;
  --font-display: "Fraunces", Georgia, serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 1.25rem;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--paper);
  /* Papierstruktur: feines Punktraster + warmer Verlauf */
  background-image:
    radial-gradient(circle at 15% 10%, rgba(255, 255, 255, .7), transparent 45%),
    radial-gradient(circle at 90% 85%, rgba(232, 147, 12, .08), transparent 40%),
    radial-gradient(rgba(90, 70, 30, .06) 1px, transparent 1px);
  background-size: auto, auto, 22px 22px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

.container { max-width: 60rem; margin: 0 auto; padding: 0 1.25rem; }

::selection { background: var(--amber); color: #fff; }

h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; }

button { font-family: inherit; cursor: pointer; }

:focus-visible {
  outline: 4px solid var(--blue);
  outline-offset: 3px;
  border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ═══════════════ Kopfleiste ═══════════════ */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .75rem 1.25rem;
  background: var(--card);
  border-bottom: 3px solid var(--blue);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  text-decoration: none;
  color: var(--ink);
}

.brand-sign {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--blue);
  border: 4px solid #fff;
  box-shadow: 0 0 0 2px var(--blue), 0 3px 6px rgba(0, 0, 0, .25);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.brand-text {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1rem;
  line-height: 1.1;
}

.textsize {
  display: flex;
  align-items: center;
  gap: .4rem;
}

.textsize-label { font-size: .95rem; color: var(--ink-soft); }

.textsize button {
  min-width: 3rem;
  min-height: 2.75rem;
  font-size: 1.05rem;
  font-weight: 700;
  border: 2px solid var(--blue);
  background: var(--card);
  color: var(--blue);
  border-radius: 10px;
  transition: background .15s, color .15s, transform .1s;
}

.textsize button:hover { background: var(--blue); color: #fff; }
.textsize button:active { transform: scale(.94); }

/* ═══════════════ Bildschirm-Wechsel ═══════════════ */

.screen { display: none; }
.screen.active { display: block; animation: screenIn .45s ease both; }

@keyframes screenIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ═══════════════ Startbildschirm ═══════════════ */

.hero {
  text-align: center;
  padding: 3.5rem 1.25rem 3rem;
  max-width: 52rem;
  margin: 0 auto;
}

.reveal { animation: revealUp .7s cubic-bezier(.2, .7, .3, 1) both; }
.reveal:nth-child(1) { animation-delay: .05s; }
.reveal:nth-child(2) { animation-delay: .18s; }
.reveal:nth-child(3) { animation-delay: .3s; }
.reveal:nth-child(4) { animation-delay: .42s; }
.reveal:nth-child(5) { animation-delay: .54s; }
.reveal:nth-child(6) { animation-delay: .66s; }

@keyframes revealUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: none; }
}

.hero-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin-bottom: 1.25rem;
}

.badge-ring {
  display: grid;
  place-items: center;
  width: 7.5rem;
  height: 7.5rem;
  border-radius: 50%;
  background: var(--blue);
  border: 6px solid #fff;
  box-shadow: 0 0 0 3px var(--blue), 0 10px 24px -8px rgba(18, 64, 127, .5);
  animation: badgeFloat 4s ease-in-out infinite;
}

@keyframes badgeFloat {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50%      { transform: translateY(-8px) rotate(2deg); }
}

.badge-car {
  font-size: 3.2rem;
  transform: scaleX(-1);
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .3));
}

.badge-plate {
  margin-top: -.7rem;
  background: var(--amber);
  color: #fff;
  font-weight: 700;
  font-size: .85rem;
  letter-spacing: .18em;
  padding: .25rem .9rem;
  border-radius: 999px;
  border: 3px solid #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .2);
  z-index: 1;
}

.hero-kicker {
  text-transform: uppercase;
  letter-spacing: .22em;
  font-size: .85rem;
  font-weight: 700;
  color: var(--amber);
  margin-bottom: .6rem;
}

.hero h1 {
  font-size: clamp(2.6rem, 7vw, 4.4rem);
  font-weight: 900;
  color: var(--blue-deep);
  margin-bottom: 1.1rem;
}

.hero-sub {
  max-width: 40rem;
  margin: 0 auto 2rem;
  color: var(--ink);
}

.hero-note {
  margin-top: 1rem;
  font-size: 1rem;
  color: var(--ink-soft);
}

/* ─── Knöpfe ─── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  border: none;
  border-radius: var(--radius);
  font-weight: 700;
  font-family: var(--font-body);
  text-align: center;
  transition: transform .12s ease, box-shadow .12s ease, background .15s;
}

.btn-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 4px 0 var(--blue-deep), 0 10px 20px -8px rgba(18, 64, 127, .55);
}

.btn-primary:hover { background: #2168cf; transform: translateY(-2px); box-shadow: 0 6px 0 var(--blue-deep), 0 14px 24px -8px rgba(18, 64, 127, .55); }
.btn-primary:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--blue-deep); }

.btn-secondary {
  background: var(--card);
  color: var(--blue);
  border: 3px solid var(--blue);
  box-shadow: 0 3px 0 rgba(18, 64, 127, .35);
}

.btn-secondary:hover { background: var(--blue); color: #fff; transform: translateY(-2px); }
.btn-secondary:active { transform: translateY(1px); }

.btn-xl { font-size: 1.45rem; padding: 1.1rem 2.6rem; min-height: 4.2rem; }
.btn-lg { font-size: 1.2rem; padding: .9rem 2rem; min-height: 3.5rem; }

.btn-arrow { display: inline-block; transition: transform .2s; }
.btn:hover .btn-arrow { transform: translateX(5px); }

/* ─── Abschnitte ─── */

.section-title {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: 1.7rem;
  font-weight: 900;
  color: var(--blue-deep);
  margin-bottom: 1.25rem;
}

.sign-square {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  background: var(--amber);
  color: #fff;
  font-family: var(--font-display);
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--amber), 0 3px 6px rgba(0, 0, 0, .2);
  border-radius: 8px;
  transform: rotate(-4deg);
  font-size: 1.4rem;
  flex-shrink: 0;
}

.how { padding: 2rem 1.25rem 1rem; }

.how-steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.25rem;
}

.how-steps li {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.4rem 1.4rem;
  box-shadow: var(--shadow);
  position: relative;
}

.how-num {
  position: absolute;
  top: -1.1rem;
  left: 1.2rem;
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: var(--blue);
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--blue);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.15rem;
}

.how-steps h3 { font-size: 1.25rem; margin: .4rem 0 .5rem; color: var(--blue-deep); }
.how-steps p { font-size: 1.05rem; color: var(--ink-soft); }

/* ─── Prüfungsstoff ─── */

.syllabus { padding: 2.5rem 1.25rem 1rem; }

.syllabus-intro { margin-bottom: 1.25rem; color: var(--ink-soft); }

.topic-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr));
  gap: .75rem;
}

.topic-grid li {
  display: flex;
  align-items: center;
  gap: .7rem;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: .7rem 1rem;
  font-weight: 700;
  font-size: 1.05rem;
  transition: transform .15s ease, border-color .15s ease;
}

.topic-grid li:hover { transform: translateY(-3px) rotate(-.5deg); border-color: var(--amber); }

.topic-icon { font-size: 1.5rem; }

/* ─── Häufige Fragen ─── */

.faq { padding: 2.5rem 1.25rem 1rem; }

.faq-item {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 12px;
  margin-bottom: .75rem;
  overflow: hidden;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 1.15rem;
  padding: 1rem 1.25rem;
  list-style: none;
  display: flex;
  align-items: center;
  gap: .75rem;
  transition: background .15s;
}

.faq-item summary::before {
  content: "+";
  display: grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  flex-shrink: 0;
  transition: transform .2s;
}

.faq-item[open] summary::before { content: "−"; transform: rotate(180deg); }

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary:hover { background: var(--amber-soft); }

.faq-item p { padding: 0 1.25rem 1.25rem; color: var(--ink-soft); }

.family-hint {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-top: 2rem;
  background: var(--amber-soft);
  border: 2px dashed var(--amber);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
}

.family-hint-icon { font-size: 2rem; }

/* ═══════════════ Prüfung ═══════════════ */

.quiz-container { padding: 2rem 1.25rem 3rem; max-width: 46rem; }

/* ─── Fortschritts-Straße ─── */

.road {
  position: relative;
  height: 3.4rem;
  background: #4a5560;
  border-radius: 999px;
  margin-bottom: 1.5rem;
  overflow: hidden;
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, .4);
}

.road-line {
  position: absolute;
  inset: 50% 0 auto 0;
  height: 4px;
  transform: translateY(-50%);
  background-image: linear-gradient(90deg, #fff 0 55%, transparent 55% 100%);
  background-size: 2.2rem 4px;
  opacity: .85;
}

.road-progress {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, rgba(46, 125, 50, .55), rgba(46, 125, 50, .8));
  transition: width .7s cubic-bezier(.3, .8, .3, 1);
}

.road-car {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-10%, -50%) scaleX(-1);
  font-size: 2.1rem;
  transition: left .7s cubic-bezier(.3, .8, .3, 1);
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .5));
  z-index: 2;
}

.road-goal {
  position: absolute;
  top: 50%;
  right: .6rem;
  transform: translateY(-50%);
  font-size: 1.6rem;
}

.quiz-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.quiz-counter {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.2rem;
  color: var(--blue-deep);
}

.quiz-topic {
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  padding: .35rem 1rem;
  border-radius: 999px;
}

/* ─── Prüfungsbogen ─── */

.exam-card {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem 1.75rem;
  position: relative;
  animation: cardIn .45s cubic-bezier(.2, .7, .3, 1) both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: none; }
}

.exam-card::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  pointer-events: none;
}

.question-text {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.answers { display: grid; gap: .9rem; list-style: none; }

.answer-btn {
  display: flex;
  align-items: flex-start;
  gap: .9rem;
  width: 100%;
  text-align: left;
  font-size: 1.15rem;
  line-height: 1.5;
  padding: 1rem 1.1rem;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  transition: border-color .15s, background .15s, transform .12s;
}

.answer-btn:hover:not(:disabled) {
  border-color: var(--blue);
  background: #fff;
  transform: translateX(4px);
}

.answer-letter {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.answer-btn:disabled { cursor: default; opacity: .75; }

.answer-btn.is-correct {
  border-color: var(--green);
  background: var(--green-soft);
  opacity: 1;
  animation: popCorrect .4s ease;
}

.answer-btn.is-correct .answer-letter { background: var(--green); }

.answer-btn.is-wrong {
  border-color: var(--red);
  background: var(--red-soft);
  opacity: 1;
  animation: shakeWrong .4s ease;
}

.answer-btn.is-wrong .answer-letter { background: var(--red); }

@keyframes popCorrect {
  0% { transform: scale(1); }
  45% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

@keyframes shakeWrong {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-7px); }
  55% { transform: translateX(6px); }
  80% { transform: translateX(-3px); }
}

/* ─── „Verdächtiges finden“-Frage (E-Mail-Attrappe) ─── */

.email-mock {
  border: 2px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  margin-bottom: 1.25rem;
  font-size: 1.05rem;
}

.email-mock-bar {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: #e9e2cf;
  padding: .5rem .9rem;
  font-weight: 700;
  font-size: .95rem;
  color: var(--ink-soft);
  border-bottom: 2px solid var(--line);
}

.email-mock-bar::before { content: "📧"; font-size: 1.2rem; }

.email-head { padding: .9rem 1rem .5rem; border-bottom: 1px solid #eee4cd; }

.email-field { margin-bottom: .35rem; }

.email-field-label { color: var(--ink-soft); font-weight: 700; margin-right: .4rem; }

.email-body { padding: 1rem; display: grid; gap: .8rem; }

.clue {
  display: inline-block;
  border: 2px dashed transparent;
  border-radius: 8px;
  padding: .3rem .5rem;
  margin: -.3rem -.2rem;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  font: inherit;
  text-align: left;
  background: transparent;
  color: inherit;
  width: 100%;
}

.clue:hover { border-color: var(--amber); background: var(--amber-soft); }

.clue.marked {
  border-color: var(--amber);
  background: var(--amber-soft);
  position: relative;
}

.clue.marked::after {
  content: "🔍 verdächtig?";
  font-size: .8rem;
  font-weight: 700;
  color: var(--amber);
  margin-left: .5rem;
  white-space: nowrap;
}

.clue.reveal-suspect {
  border-color: var(--red);
  background: var(--red-soft);
}

.clue.reveal-suspect::after {
  content: "⚠️ Warnsignal!";
  font-size: .8rem;
  font-weight: 700;
  color: var(--red);
  margin-left: .5rem;
  white-space: nowrap;
}

.clues-status {
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 1rem;
}

/* Chat-Attrappe (WhatsApp / SMS) */

.mock-chat .email-mock-bar::before { content: "💬"; }

.mock-chat .email-body {
  background: #eae3d6;
  gap: .6rem;
}

.mock-chat .clue {
  width: auto;
  max-width: 88%;
  margin: 0;
  background: #fff;
  border-radius: 4px 16px 16px 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .15);
  padding: .55rem .85rem;
}

.mock-chat .clue:hover,
.mock-chat .clue.marked { background: var(--amber-soft); }

.mock-chat .clue.reveal-suspect { background: var(--red-soft); }

/* Shop-Attrappe (Fake-Angebot) */

.mock-shop .email-mock-bar::before { content: "🌐"; }

.mock-shop .email-body { gap: .55rem; }

.mock-shop .shop-title .clue { font-weight: 700; font-size: 1.2rem; }

.mock-shop .shop-price .clue { color: var(--red); font-weight: 700; font-size: 1.25rem; }

.mock-shop .shop-timer .clue { color: var(--amber); font-weight: 700; }

/* ─── Rückmeldung ─── */

.feedback {
  margin-top: 1.25rem;
  border-radius: var(--radius);
  padding: 1.5rem 1.5rem 1.6rem;
  border: 2px solid;
  animation: feedbackIn .4s cubic-bezier(.2, .7, .3, 1) both;
}

@keyframes feedbackIn {
  from { opacity: 0; transform: translateY(16px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

.feedback.good { background: var(--green-soft); border-color: var(--green); }
.feedback.bad  { background: var(--red-soft); border-color: var(--red); }

.feedback-head {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin-bottom: .6rem;
}

.feedback-icon { font-size: 2rem; animation: iconPop .45s cubic-bezier(.3, 1.6, .5, 1) both; }

@keyframes iconPop {
  from { transform: scale(0) rotate(-30deg); }
  to   { transform: scale(1) rotate(0); }
}

.feedback-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.35rem;
}

.feedback.good .feedback-title { color: var(--green); }
.feedback.bad  .feedback-title { color: var(--red); }

.feedback-text { margin-bottom: 1.25rem; }

/* ═══════════════ Ergebnis ═══════════════ */

.result-container { padding: 2.5rem 1.25rem 3rem; max-width: 46rem; }

.result-card {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.5rem 1.75rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.score-ring {
  width: 11rem;
  height: 11rem;
  margin: 0 auto 1.5rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  background: conic-gradient(var(--ring-color, var(--green)) calc(var(--pct, 0) * 1%), var(--paper-deep) 0);
  animation: ringIn 1s ease both;
}

@keyframes ringIn {
  from { transform: scale(.6); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.score-ring::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: var(--card);
  box-shadow: inset 0 2px 6px rgba(90, 70, 30, .15);
}

.score-num {
  position: relative;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 2.6rem;
  color: var(--blue-deep);
  line-height: 1;
}

.score-of { display: block; font-size: 1rem; font-family: var(--font-body); font-weight: 400; color: var(--ink-soft); margin-top: .2rem; }

.result-verdict {
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  font-weight: 900;
  margin-bottom: .75rem;
}

.result-verdict.pass { color: var(--green); }
.result-verdict.fail { color: var(--amber); }

.result-text { max-width: 34rem; margin: 0 auto 1rem; }

.result-stamp {
  position: absolute;
  top: 1.4rem;
  right: 1.2rem;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.3rem;
  letter-spacing: .12em;
  padding: .4rem 1rem;
  border: 4px double currentColor;
  border-radius: 8px;
  transform: rotate(9deg);
  opacity: .9;
  animation: stampIn .5s cubic-bezier(.3, 1.5, .5, 1) .5s both;
}

.result-stamp.pass { color: var(--green); }
.result-stamp.fail { color: var(--amber); }

@keyframes stampIn {
  from { transform: rotate(9deg) scale(2.4); opacity: 0; }
  to   { transform: rotate(9deg) scale(1); opacity: .9; }
}

.review-list {
  text-align: left;
  margin: 1.5rem auto 0;
  max-width: 34rem;
  background: var(--amber-soft);
  border: 2px dashed var(--amber);
  border-radius: 12px;
  padding: 1.1rem 1.3rem;
}

.review-list h3 { font-size: 1.15rem; margin-bottom: .5rem; color: var(--ink); }

.review-list ul { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; }

.review-list li {
  background: #fff;
  border: 1px solid var(--amber);
  border-radius: 999px;
  padding: .25rem .9rem;
  font-size: 1rem;
  font-weight: 700;
}

.result-actions { text-align: center; margin: 2rem 0; }

.share-hint {
  background: var(--card);
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  text-align: center;
  margin-bottom: 2rem;
}

/* ─── Urkunde ─── */

.certificate-zone { margin-top: 2.5rem; }

.cert-form {
  display: flex;
  flex-wrap: wrap;
  gap: .9rem;
  align-items: center;
  margin-bottom: 1.5rem;
}

.cert-form label { font-weight: 700; width: 100%; }

.cert-form input {
  flex: 1;
  min-width: 14rem;
  font: inherit;
  font-size: 1.2rem;
  padding: .8rem 1rem;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.cert-form input:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(28, 91, 184, .25); }

.certificate { animation: screenIn .5s ease both; }

.cert-inner {
  background: linear-gradient(145deg, #fffdf6, #fbf3dd);
  border: 3px solid var(--amber);
  outline: 2px solid var(--line);
  outline-offset: 6px;
  border-radius: 6px;
  padding: 2.5rem 2rem;
  text-align: center;
  position: relative;
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
}

.cert-seal {
  display: grid;
  place-items: center;
  width: 4.5rem;
  height: 4.5rem;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: var(--blue);
  border: 4px solid #fff;
  box-shadow: 0 0 0 3px var(--blue);
  font-size: 2rem;
}

.cert-kicker { text-transform: uppercase; letter-spacing: .2em; font-size: .8rem; font-weight: 700; color: var(--amber); margin-bottom: .4rem; }

.cert-title { font-size: 2rem; font-weight: 900; color: var(--blue-deep); margin-bottom: 1rem; }

.cert-body { color: var(--ink-soft); max-width: 30rem; margin: 0 auto .5rem; }

.cert-name {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
  color: var(--ink);
  border-bottom: 2px dotted var(--line);
  display: inline-block;
  padding: 0 1.5rem .3rem;
  margin: .5rem 0 .75rem;
}

.cert-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.cert-date { color: var(--ink-soft); font-size: 1rem; }

.cert-stamp {
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: .12em;
  color: var(--green);
  border: 4px double var(--green);
  border-radius: 8px;
  padding: .3rem .9rem;
  transform: rotate(-7deg);
}

/* ═══════════════ Werbung ═══════════════ */

.ad-slot {
  margin: 2.5rem auto;
  text-align: center;
  min-height: 5rem;
}

.ad-label {
  display: block;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .15em;
  color: var(--ink-soft);
  margin-bottom: .4rem;
}

.ad-slot-quiz { margin-top: 2rem; min-height: 0; }

/* Solange Google keine Anzeige liefert (Seite noch nicht freigeschaltet,
   Anzeigenblock unbekannt oder kein Gebot), die Werbefläche samt
   „Werbung“-Beschriftung komplett ausblenden — sonst schweben leere
   Kästen und Beschriftungen auf der Seite. */
ins.adsbygoogle[data-ad-status="unfilled"] { display: none !important; }

.ad-slot:has(ins[data-ad-status="unfilled"]),
.ad-rail:has(ins[data-ad-status="unfilled"]) { display: none !important; }

/* Werbe-Säulen: fest am linken/rechten Rand, nur wenn wirklich Platz ist
   (Breiten in px, damit der Schriftgrößen-Umschalter sie nicht verschiebt) */

.ad-rail {
  display: none;
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 160px;
  z-index: 10;
  text-align: center;
}

.ad-rail .adsbygoogle { min-height: 400px; }

.ad-rail-left { left: 16px; }
.ad-rail-right { right: 16px; }

@media (min-width: 1500px) {
  .ad-rail { display: block; }
}

@media (min-width: 1860px) {
  .ad-rail { width: 300px; }
  .ad-rail-left { left: 24px; }
  .ad-rail-right { right: 24px; }
}

@media print {
  .ad-rail { display: none !important; }
}

/* ═══════════════ Konfetti ═══════════════ */

.confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 100;
}

.confetti-piece {
  position: absolute;
  top: -3vh;
  width: 12px;
  height: 18px;
  border-radius: 3px;
  animation: confettiFall linear both;
}

@keyframes confettiFall {
  from { transform: translateY(0) rotate(0deg); opacity: 1; }
  to   { transform: translateY(110vh) rotate(720deg); opacity: .7; }
}

/* ═══════════════ Fußzeile ═══════════════ */

.footer {
  text-align: center;
  padding: 2rem 1.25rem;
  border-top: 3px solid var(--blue);
  background: var(--card);
  margin-top: 2rem;
}

.footer-small { font-size: .95rem; color: var(--ink-soft); margin-top: .4rem; }

.footer a { color: var(--blue); font-weight: 700; }

/* ═══════════════ Rechtliches (Impressum / Datenschutz) ═══════════════ */

.legal {
  max-width: 44rem;
  padding-top: 2.5rem;
  padding-bottom: 3rem;
}

.legal h1 {
  font-size: 2.4rem;
  font-weight: 900;
  color: var(--blue-deep);
  margin-bottom: 1.5rem;
}

.legal h2 {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--blue-deep);
  margin: 2rem 0 .6rem;
}

.legal p { margin-bottom: 1rem; }

.legal a { color: var(--blue); font-weight: 700; }

.legal-stand { color: var(--ink-soft); font-size: 1rem; }

/* ═══════════════ Kleine Bildschirme ═══════════════ */

@media (max-width: 40rem) {
  body { font-size: 1.15rem; }
  .hero { padding-top: 2.25rem; }
  .exam-card { padding: 1.5rem 1.1rem; }
  .result-stamp { position: static; display: inline-block; margin-bottom: 1rem; }
  .topbar { flex-wrap: wrap; justify-content: center; }
}

/* ═══════════════ Druck: nur die Urkunde ═══════════════ */

/* Die Druck-Ebene existiert nur während des Druckvorgangs (per JS erzeugt) */
#print-layer { display: none; }

/* Ohne Seitenränder druckt der Browser keine Kopf-/Fußzeilen (URL, Datum) */
@page { size: landscape; margin: 0; }

@media print {
  body { background: #fff; }
  .ad-slot, .topbar, .footer, .confetti-layer { display: none !important; }

  body.printing-cert > *:not(#print-layer) { display: none !important; }

  body.printing-cert #print-layer {
    display: grid;
    place-items: center;
    height: 100vh;
    padding: 1.5cm;
    overflow: hidden;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  body.printing-cert #print-layer .cert-inner {
    width: 100%;
    margin: 0;
    box-shadow: none;
  }
}
