/* ============================================================
   DHBW Deltaprüfung 2027 – Das große Übungsbuch
   ============================================================ */

:root {
  --red: #b02128;
  --red-dark: #8e1a20;
  --red-soft: #fbeeee;
  --ink: #19191c;
  --ink-soft: #4b4b52;
  --paper: #faf9f7;
  --white: #ffffff;
  --line: #e7e4df;
  --green: #1d7a3e;
  --green-soft: #e9f6ee;
  --radius: 16px;
  --shadow: 0 2px 6px rgba(20, 20, 25, 0.06), 0 16px 40px rgba(20, 20, 25, 0.08);
  --shadow-big: 0 8px 24px rgba(20, 20, 25, 0.14), 0 32px 80px rgba(20, 20, 25, 0.18);
  --font: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 { line-height: 1.18; letter-spacing: -0.02em; margin: 0 0 0.6em; font-weight: 800; }
h1 { font-size: clamp(2rem, 5vw, 3.3rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--red); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--red-dark); }

.small { font-size: 0.85rem; }
.muted { color: var(--ink-soft); }
.center { text-align: center; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 13px 26px;
  border-radius: 999px;
  border: 2px solid transparent;
  font-weight: 700;
  font-size: 1rem;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--red);
  color: #fff;
  box-shadow: 0 6px 18px rgba(176, 33, 40, 0.32);
}
.btn-primary:hover { background: var(--red-dark); color: #fff; transform: translateY(-2px); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn-ghost:hover { background: var(--ink); color: #fff; }
.btn-large { padding: 16px 34px; font-size: 1.06rem; }
.btn-small { padding: 8px 18px; font-size: 0.9rem; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 249, 247, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav {
  max-width: 1180px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.06rem; color: var(--ink); text-decoration: none;
  letter-spacing: -0.01em;
}
.brand-mark {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--red); color: #fff; font-weight: 800; font-size: 1.15rem;
}
.nav-menu {
  display: flex; align-items: center; gap: 26px;
  list-style: none; margin: 0; padding: 0;
}
.nav-menu a:not(.btn) {
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.95rem;
}
.nav-menu a:not(.btn):hover { color: var(--red); }
.nav-toggle { display: none; }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(1100px 500px at 85% -10%, var(--red-soft), transparent 60%),
    linear-gradient(180deg, #fff 0%, var(--paper) 100%);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.hero-inner {
  max-width: 1180px; margin: 0 auto; padding: 72px 24px 84px;
  display: grid; grid-template-columns: 1.25fr 1fr; gap: 56px; align-items: center;
}
.eyebrow {
  display: inline-block;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--red);
  background: var(--red-soft);
  padding: 6px 14px; border-radius: 999px;
  margin-bottom: 18px;
}
.hero h1 em { font-style: normal; color: var(--red); }
.hero-sub { font-size: 1.13rem; color: var(--ink-soft); max-width: 56ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin: 28px 0 22px; }
.hero-badges {
  display: flex; flex-wrap: wrap; gap: 8px 22px;
  list-style: none; margin: 0; padding: 0;
  font-size: 0.92rem; font-weight: 600; color: var(--ink-soft);
}
.hero-cover { display: flex; justify-content: center; }
.hero-cover img {
  width: min(380px, 70vw);
  border-radius: 8px;
  box-shadow: var(--shadow-big);
  transform: rotate(2.5deg);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.hero-cover img:hover { transform: rotate(0deg) scale(1.025); }

/* ---------- Stats ---------- */
.stats { background: var(--ink); color: #fff; }
.stats-inner {
  max-width: 1180px; margin: 0 auto; padding: 34px 24px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; text-align: center;
}
.stat strong { display: block; font-size: 1.9rem; font-weight: 800; color: #fff; letter-spacing: -0.02em; }
.stat span { font-size: 0.88rem; color: #c9c9cf; }

/* ---------- Sections ---------- */
.section { padding: 84px 0; }
.section-alt { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-inner { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.section-inner.narrow { max-width: 780px; }
.section-lead { font-size: 1.12rem; color: var(--ink-soft); max-width: 64ch; margin-bottom: 2em; }
.section h2 { max-width: 26ch; }
.center h2, .center .section-lead { margin-left: auto; margin-right: auto; }
.section h2 em { font-style: normal; color: var(--red); }

/* ---------- Cards ---------- */
.cards {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; margin-bottom: 44px;
}
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
}
.card-icon { font-size: 1.7rem; margin-bottom: 12px; }
.card p { margin-bottom: 0; color: var(--ink-soft); }

/* ---------- Aufgabentypen ---------- */
.types-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.type {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.type:hover { border-color: var(--red); transform: translateY(-3px); }
.type h3 { color: var(--red); margin-bottom: 6px; font-size: 1.02rem; }
.type p { margin: 0; font-size: 0.93rem; color: var(--ink-soft); }

/* ---------- Test-CTA ---------- */
.test-cta {
  background:
    radial-gradient(800px 400px at 50% 120%, var(--red-soft), transparent 70%);
}

/* ---------- Prose / SEO-Text ---------- */
.prose { max-width: 820px; }
.prose h3 { margin-top: 1.8em; }
.prose p { color: var(--ink-soft); }
.prose strong { color: var(--ink); }

/* ---------- FAQ ---------- */
.faq-item {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
}
.faq-item summary {
  cursor: pointer;
  padding: 18px 22px;
  font-weight: 700;
  list-style: none;
  position: relative;
  padding-right: 52px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  position: absolute; right: 20px; top: 50%;
  transform: translateY(-50%);
  font-size: 1.4rem; font-weight: 400; color: var(--red);
  transition: transform 0.2s ease;
}
.faq-item[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq-item p { padding: 0 22px 18px; margin: 0; color: var(--ink-soft); }

/* ---------- Kontaktformular ---------- */
.contact-form { max-width: 640px; }
.form-row { margin-bottom: 18px; }
.form-row label { display: block; font-weight: 700; font-size: 0.92rem; margin-bottom: 6px; }
.form-row input,
.form-row textarea {
  width: 100%;
  padding: 13px 16px;
  font: inherit;
  color: var(--ink);
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-row input:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(176, 33, 40, 0.14);
}
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px; overflow: hidden;
}
.form-status { font-weight: 600; min-height: 1.4em; margin-top: 12px; }
.form-status.ok { color: var(--green); }
.form-status.err { color: var(--red); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink); color: #c9c9cf;
  padding: 52px 24px 28px;
  margin-top: 0;
}
.footer-inner {
  max-width: 1180px; margin: 0 auto;
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 36px;
}
.footer-brand { color: #fff; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.footer-col a { display: block; color: #c9c9cf; text-decoration: none; margin-bottom: 10px; }
.footer-col a:hover { color: #fff; }
.footer-copy { max-width: 1180px; margin: 36px auto 0; border-top: 1px solid #333; padding-top: 20px; }

/* ============================================================
   Quiz
   ============================================================ */
.quiz-page h1 { font-size: clamp(1.8rem, 4.5vw, 2.7rem); }
.rules { margin-top: 8px; }
.rules-title { font-size: 1.1rem; }
.rules-list { margin: 0 0 26px; padding-left: 20px; color: var(--ink-soft); }
.rules-list li { margin-bottom: 8px; }

.quiz-head { margin-bottom: 22px; }
.quiz-progress-label { font-weight: 700; font-size: 0.9rem; margin-bottom: 8px; color: var(--ink-soft); }
.quiz-progress {
  height: 10px; border-radius: 999px; background: var(--line); overflow: hidden;
}
.quiz-progress-fill {
  height: 100%; width: 10%;
  background: linear-gradient(90deg, var(--red), var(--red-dark));
  border-radius: 999px;
  transition: width 0.3s ease;
}

.question-card { padding: 34px; }
.q-type {
  display: inline-block;
  font-size: 0.74rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--red); background: var(--red-soft);
  padding: 4px 12px; border-radius: 999px; margin-bottom: 14px;
}
.q-text { font-size: 1.12rem; font-weight: 700; margin-bottom: 6px; }
.q-hint { font-size: 0.88rem; color: var(--ink-soft); margin-bottom: 18px; }
.q-sequence {
  font-variant-numeric: tabular-nums;
  font-size: 1.25rem; font-weight: 700; letter-spacing: 0.02em;
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px 20px; margin-bottom: 20px; text-align: center;
  overflow-x: auto; white-space: nowrap;
}
.q-equation {
  font-variant-numeric: tabular-nums;
  font-size: 1.3rem; font-weight: 700; text-align: center;
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
  padding: 18px 20px; margin-bottom: 20px;
  overflow-x: auto;
}
.q-equation .op-slot { color: var(--red); }

.q-input {
  width: 100%; max-width: 240px;
  padding: 13px 16px; font: inherit; font-weight: 700; font-size: 1.1rem;
  border: 1.5px solid var(--line); border-radius: 10px; background: #fff;
}
.q-input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(176, 33, 40, 0.14); }

.q-options { display: grid; gap: 10px; margin-top: 6px; }
.q-option {
  display: flex; align-items: center; gap: 12px;
  border: 1.5px solid var(--line); border-radius: 12px;
  background: #fff; padding: 13px 16px;
  cursor: pointer; font-weight: 600;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.q-option:hover { border-color: var(--red); }
.q-option input { accent-color: var(--red); width: 18px; height: 18px; flex-shrink: 0; }
.q-option.selected { border-color: var(--red); background: var(--red-soft); }

.op-selects { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.op-select-group { text-align: center; }
.op-select-group label { display: block; font-size: 0.8rem; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; }
.op-select {
  font: inherit; font-weight: 800; font-size: 1.15rem; text-align: center;
  padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff;
  cursor: pointer;
}
.op-select:focus { outline: none; border-color: var(--red); }

.gap-group { margin-bottom: 18px; }
.gap-group > p { font-weight: 700; margin-bottom: 8px; }

/* Matrix */
.matrix-wrap { display: grid; gap: 26px; margin-top: 6px; }
.matrix-grid-svg { justify-self: center; max-width: 340px; width: 100%; }
.matrix-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.matrix-option {
  position: relative;
  border: 2px solid var(--line); border-radius: 12px; background: #fff;
  padding: 8px; cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.matrix-option:hover { border-color: var(--red); }
.matrix-option.selected { border-color: var(--red); background: var(--red-soft); }
.matrix-option input { position: absolute; opacity: 0; pointer-events: none; }
.matrix-option .letter {
  display: block; text-align: center; font-weight: 800; font-size: 0.9rem; margin-top: 4px;
}
.matrix-option svg { width: 100%; height: auto; }

.quiz-nav { display: flex; justify-content: space-between; gap: 14px; margin-top: 24px; }

/* Ergebnis */
.result-card { padding: 40px 34px; }
.result-score { font-size: clamp(2.4rem, 7vw, 3.6rem); font-weight: 800; letter-spacing: -0.03em; margin-bottom: 4px; }
.result-score .of { font-size: 0.45em; color: var(--ink-soft); font-weight: 700; }
.result-verdict { font-size: 1.25rem; font-weight: 800; margin-bottom: 10px; }
.result-verdict.pass { color: var(--green); }
.result-verdict.fail { color: var(--red); }
.result-bar { height: 14px; border-radius: 999px; background: var(--line); overflow: hidden; margin: 18px 0 8px; position: relative; }
.result-bar::after {
  content: ""; position: absolute; left: 70%; top: 0; bottom: 0; width: 2px; background: var(--ink);
}
.result-bar-fill { height: 100%; border-radius: 999px; transition: width 0.8s ease; }
.result-bar-fill.pass { background: var(--green); }
.result-bar-fill.fail { background: var(--red); }

.result-list { list-style: none; margin: 22px 0; padding: 0; display: grid; gap: 8px; }
.result-list li {
  display: flex; align-items: center; gap: 12px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px; font-size: 0.94rem; font-weight: 600;
}
.result-list .mark { font-weight: 800; flex-shrink: 0; width: 1.4em; text-align: center; }
.result-list .ok .mark { color: var(--green); }
.result-list .nok .mark { color: var(--red); }

.result-cta {
  background: var(--red-soft); border: 1px solid #efd3d4; border-radius: var(--radius);
  padding: 26px; margin: 26px 0;
}
.result-cta h3 { margin-bottom: 8px; }
.result-cta p { color: var(--ink-soft); }
.result-cta .btn { margin-top: 6px; }

/* ---------- Animationen ---------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
  .reveal.visible { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .hero-inner { grid-template-columns: 1fr; padding: 48px 24px 56px; gap: 40px; }
  .hero-cover { order: -1; }
  .hero-cover img { width: min(280px, 62vw); }
  .cards { grid-template-columns: 1fr; }
  .types-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-inner { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 760px) {
  .nav-toggle {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 44px; height: 44px; padding: 10px;
    background: none; border: none; cursor: pointer;
  }
  .nav-toggle span { display: block; height: 2.5px; width: 100%; background: var(--ink); border-radius: 2px; transition: transform 0.2s ease, opacity 0.2s ease; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }
  .nav-menu {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--white); border-bottom: 1px solid var(--line);
    padding: 12px 24px 20px;
    box-shadow: var(--shadow);
  }
  .nav-menu.open { display: flex; }
  .nav-menu li { padding: 8px 0; }
  .section { padding: 60px 0; }
  .types-grid { grid-template-columns: 1fr; }
  .matrix-options { grid-template-columns: repeat(2, 1fr); }
  .question-card { padding: 24px 18px; }
  .quiz-nav { flex-direction: column-reverse; }
  .quiz-nav .btn { width: 100%; }
}

@media (max-width: 400px) {
  h1 { font-size: 1.72rem; }
  .q-equation { font-size: 1.1rem; }
}
