/* ==========================================================================
   Lernen Bauen Wachsen — Stylesheet
   Self-contained: no external fonts, no CDN, no remote requests.
   (Loading Google Fonts from a German site is itself a GDPR problem — the
   Munich Regional Court awarded damages over it in 2022. Everything here
   ships from our own origin.)
   ========================================================================== */

:root {
  --ink:          #14171c;
  --ink-soft:     #454c57;
  --ink-faint:    #6b7280;
  --line:         #d7dce4;
  --line-soft:    #e8ecf1;
  --paper:        #ffffff;
  --paper-alt:    #f3f5f8;
  --paper-deep:   #171c26;
  --accent:       #24446e;
  --accent-dark:  #1a3455;
  --accent-wash:  #e7edf6;
  --focus:        #b8532a;
  --warn-bg:      #fdf5ec;
  --warn-line:    #e8d3b6;

  --wrap:      1120px;
  --wrap-text: 700px;
  --radius:    2px;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
          Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

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

/* Medium-weight sans with tight tracking — a documentation register, distinct
   from the warm serif and the heavy display sans used on the sister sites. */
h1, h2, h3, h4 {
  font-family: var(--sans);
  line-height: 1.2;
  margin: 0 0 .55em;
  font-weight: 600;
  letter-spacing: -.018em;
}
h1 { font-size: clamp(1.95rem, 1.4rem + 2.4vw, 2.95rem); }
h2 { font-size: clamp(1.45rem, 1.2rem + 1.2vw, 2rem); }
h3 { font-size: 1.09rem; font-weight: 600; letter-spacing: -.008em; }
h4 { font-size: .97rem; font-weight: 600; }

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-dark); }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 1px; }

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

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 22px; }
.wrap--text { max-width: var(--wrap-text); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: #fff; padding: .7rem 1.1rem;
}
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */

.site-header { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 66px; }

.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); }
.brand__mark { width: 28px; height: 28px; flex: none; }
.brand__name { font-size: 1.05rem; font-weight: 600; letter-spacing: -.022em; }

.nav { display: flex; align-items: center; gap: .05rem; }
.nav a {
  color: var(--ink-soft); text-decoration: none; font-size: .9rem; font-weight: 500;
  padding: .5rem .66rem; white-space: nowrap; border-radius: var(--radius);
}
.nav a:hover { color: var(--accent); background: var(--paper-alt); }
.nav .btn { margin-left: .5rem; }
/* `.nav a` (0,1,1) outranks `.btn--primary` (0,1,0), so without these the nav
   CTA inherits --ink-soft on the accent fill — about 2:1 contrast. */
.nav .btn--primary, .nav .btn--primary:hover { color: #fff; background: var(--accent); }
.nav .btn--primary:hover { background: var(--accent-dark); }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--line);
  border-radius: var(--radius); padding: .5rem .6rem; cursor: pointer; color: var(--ink);
}

@media (max-width: 940px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: .4rem 22px 1rem;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: .8rem .3rem; border-bottom: 1px solid var(--line-soft); border-radius: 0; }
  .nav .btn { margin: .75rem 0 0; text-align: center; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: inherit; font-size: .93rem; font-weight: 600;
  padding: .7rem 1.3rem; border-radius: var(--radius);
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: background-color .14s ease, color .14s ease, border-color .14s ease;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-dark); color: #fff; }
.btn--ghost { background: var(--paper); color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { background: var(--paper-alt); border-color: var(--ink-faint); color: var(--ink); }
.btn--block { width: 100%; }
.btn--lg { font-size: .99rem; padding: .84rem 1.65rem; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }

/* ---------- Sections ---------- */

.section { padding: clamp(3rem, 2rem + 4vw, 5.25rem) 0; }
.section--alt { background: var(--paper-alt); border-block: 1px solid var(--line); }
.section--deep { background: var(--paper-deep); color: #cdd5e0; }
.section--deep h2, .section--deep h3 { color: #fff; }
.section--deep .eyebrow { color: #8fb0dd; }
.section--deep .rule { background: #8fb0dd; }

.section__head { max-width: 640px; margin-bottom: 2.5rem; }
.section__head p { color: var(--ink-soft); font-size: 1.03rem; margin-bottom: 0; }
.section--deep .section__head p { color: #aab6c6; }

/* Monospace labels — a small, consistent signal of the technical register. */
.eyebrow {
  display: block; font-family: var(--mono);
  font-size: .74rem; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--accent); margin-bottom: .75rem;
}
.rule { height: 2px; width: 40px; background: var(--accent); margin: 0 0 1.3rem; }

/* ---------- Hero ---------- */

.hero { padding: clamp(2.75rem, 2rem + 4vw, 4.75rem) 0 clamp(2.25rem, 2rem + 2vw, 3.25rem); }
.hero__grid { display: grid; grid-template-columns: 1.12fr .88fr; gap: clamp(2rem, 5vw, 3.75rem); align-items: start; }
@media (max-width: 940px) { .hero__grid { grid-template-columns: 1fr; gap: 2.25rem; } }

.hero__lede { font-size: 1.12rem; color: var(--ink-soft); max-width: 46ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.6rem; }
.hero__note { margin-top: 1.2rem; font-size: .86rem; color: var(--ink-faint); max-width: 50ch; }

/* Spec table — the distinguishing element of this layout. */
.spec { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.spec__row { display: grid; grid-template-columns: 40% 1fr; gap: 1rem; padding: .85rem 1.15rem; border-bottom: 1px solid var(--line-soft); }
.spec__row:last-child { border-bottom: 0; }
.spec__k { font-family: var(--mono); font-size: .73rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint); padding-top: .16rem; }
.spec__v { font-size: .93rem; color: var(--ink); }
@media (max-width: 420px) { .spec__row { grid-template-columns: 1fr; gap: .2rem; } }

/* ---------- Grids & cards ---------- */

.grid { display: grid; gap: 1.1rem; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 940px) { .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; } }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; }
.card p { color: var(--ink-soft); font-size: .93rem; margin-bottom: 0; }
.card__icon { width: 28px; height: 28px; color: var(--accent); margin-bottom: .8rem; }
.section--deep .card { background: rgba(255,255,255,.045); border-color: rgba(255,255,255,.15); }
.section--deep .card p { color: #aab6c6; }

.num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: var(--radius);
  background: var(--accent-wash); color: var(--accent-dark);
  font-family: var(--mono); font-size: .78rem; font-weight: 700;
  margin-bottom: .8rem;
}
.section--deep .num { background: rgba(255,255,255,.12); color: #cfe0f5; }

/* ---------- Modules ---------- */

.module { display: grid; grid-template-columns: 88px 1fr; gap: 1.4rem; padding: 1.6rem 0; border-top: 1px solid var(--line); }
.module:last-child { border-bottom: 1px solid var(--line); }
@media (max-width: 620px) { .module { grid-template-columns: 1fr; gap: .45rem; } }
.module__tag { font-family: var(--mono); font-size: .72rem; letter-spacing: .07em; text-transform: uppercase; color: var(--accent); padding-top: .25rem; }
.module p { color: var(--ink-soft); font-size: .95rem; }
.module ul { margin: .65rem 0 0; padding-left: 1.1rem; color: var(--ink-soft); font-size: .92rem; }
.module li { margin-bottom: .32rem; }

/* ---------- FAQ ---------- */

.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 1.1rem 2.2rem 1.1rem 0; position: relative; font-weight: 600; font-size: .99rem; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: .4rem; top: 1.45rem;
  width: 8px; height: 8px; border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  transform: rotate(45deg); transition: transform .18s ease;
}
.faq details[open] summary::after { transform: rotate(-135deg); }
.faq__body { padding: 0 2.2rem 1.25rem 0; color: var(--ink-soft); font-size: .95rem; }

/* ---------- Callouts ---------- */

.callout {
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  background: var(--paper-alt); border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.1rem 1.3rem; font-size: .92rem; color: var(--ink-soft);
}
.callout strong { color: var(--ink); }
.callout--plain { border-left-color: var(--ink-faint); }
.callout--warn { background: var(--warn-bg); border-color: var(--warn-line); border-left-color: #c08a3e; }
.section--deep .callout { background: rgba(255,255,255,.055); border-color: rgba(255,255,255,.16); border-left-color: #8fb0dd; color: #bcc8d8; }
.section--deep .callout strong { color: #fff; }

/* ---------- Form ---------- */

.form-shell { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.35rem, 1rem + 2vw, 2.15rem); }

.field { margin-bottom: 1.1rem; }
.field label { display: block; font-size: .88rem; font-weight: 600; margin-bottom: .35rem; }
.field .hint { font-size: .81rem; color: var(--ink-faint); font-weight: 400; }

.field input[type="text"], .field input[type="email"], .field select, .field textarea {
  width: 100%; font: inherit; font-size: .95rem; color: var(--ink);
  padding: .66rem .78rem; background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.field textarea { min-height: 112px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent); outline: 2px solid rgba(36, 68, 110, .16); outline-offset: 0;
}
.field [aria-invalid="true"] { border-color: #b4342a; }

.consent { display: grid; grid-template-columns: 19px 1fr; gap: .68rem; align-items: start; }
.consent input { width: 17px; height: 17px; margin-top: 3px; accent-color: var(--accent); }
.consent label { font-size: .86rem; font-weight: 400; color: var(--ink-soft); line-height: 1.55; margin: 0; }

.error-msg { display: none; color: #a62c22; font-size: .83rem; margin-top: .3rem; }
.error-msg.is-shown { display: block; }

/* Honeypot — hidden from humans, catches naive bots. Not a CAPTCHA. */
.hp { position: absolute; left: -5000px; width: 1px; height: 1px; overflow: hidden; }

.form-status { margin-top: 1rem; font-size: .92rem; padding: .8rem 1rem; border-radius: var(--radius); display: none; }
.form-status.is-shown { display: block; }
.form-status--ok  { background: var(--accent-wash); border: 1px solid #c3d3e8; color: var(--accent-dark); }
.form-status--err { background: #fdf0ef; border: 1px solid #f0d2cf; color: #93261d; }

/* ---------- Confirmation modal ---------- */

.modal {
  position: fixed; inset: 0; z-index: 80;
  display: none; align-items: center; justify-content: center;
  padding: 1.25rem; background: rgba(20, 23, 28, .62);
}
.modal.is-open { display: flex; }

.modal__box {
  background: var(--paper); border-radius: var(--radius);
  max-width: 520px; width: 100%; padding: 2rem;
  border-top: 3px solid var(--accent);
  box-shadow: 0 12px 44px rgba(0, 0, 0, .3);
  max-height: 90vh; overflow-y: auto;
  animation: modalIn .18s ease-out;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.modal__check {
  width: 44px; height: 44px; border-radius: var(--radius);
  background: var(--accent-wash); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.1rem;
}
.modal__check svg { width: 23px; height: 23px; }
.modal__box h2 { font-size: 1.35rem; margin-bottom: .6rem; }
.modal__box p { font-size: .95rem; color: var(--ink-soft); }
.modal__list { margin: 1.1rem 0 0; padding-left: 1.1rem; font-size: .9rem; color: var(--ink-soft); }
.modal__list li { margin-bottom: .38rem; }
.modal__actions { margin-top: 1.55rem; display: flex; gap: .6rem; flex-wrap: wrap; }

/* ---------- Prose / legal ---------- */

.prose { font-size: 1rem; }
.prose h2 { font-size: 1.25rem; margin-top: 2.4rem; }
.prose h3 { font-size: 1rem; margin-top: 1.7rem; }
.prose ul, .prose ol { padding-left: 1.25rem; color: var(--ink-soft); }
.prose li { margin-bottom: .42rem; }
.prose table { width: 100%; border-collapse: collapse; font-size: .91rem; margin: 1.2rem 0; }
.prose th, .prose td { text-align: left; padding: .62rem .78rem; border: 1px solid var(--line); vertical-align: top; }
.prose th { background: var(--paper-alt); font-weight: 600; }
.prose code { font-family: var(--mono); font-size: .88em; background: var(--paper-alt); padding: .1em .35em; }
.table-scroll { overflow-x: auto; }

/* Statutory boxes — Widerrufsbelehrung and the Muster-Widerrufsformular must
   be clearly delineated from surrounding text. */
.statute {
  border: 1px solid var(--ink-faint); border-radius: var(--radius);
  padding: 1.4rem 1.5rem; margin: 1.5rem 0; background: var(--paper);
}
.statute h3 { margin-top: 0; }
.statute--form { background: var(--paper-alt); border-style: dashed; }

.page-head { padding: 3rem 0 1.4rem; border-bottom: 1px solid var(--line); margin-bottom: 2.4rem; }
.page-head p { color: var(--ink-faint); font-size: .91rem; margin: .4rem 0 0; }

/* ---------- Footer ---------- */

.site-footer { background: var(--paper-deep); color: #99a4b4; padding: 3.25rem 0 2rem; font-size: .89rem; }
.site-footer__grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 2rem; }
@media (max-width: 760px) { .site-footer__grid { grid-template-columns: 1fr 1fr; } .site-footer__brand { grid-column: 1 / -1; } }
@media (max-width: 460px) { .site-footer__grid { grid-template-columns: 1fr; } }

.site-footer .brand { color: #fff; }
.site-footer h4 { font-family: var(--mono); font-size: .72rem; letter-spacing: .11em; text-transform: uppercase; color: #8fb0dd; margin-bottom: .8rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .44rem; }
.site-footer a { color: #99a4b4; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer__brand p { color: #808c9d; max-width: 36ch; font-size: .87rem; }

.site-footer__legal {
  margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,.13);
  color: #808c9d; font-size: .82rem;
}
.site-footer__legal p { margin-bottom: .6rem; }
.site-footer__legal strong { color: #c3ccd8; }

/* ---------- Cookie banner ---------- */

.cookie-banner {
  position: fixed; inset: auto 0 0 0; z-index: 60;
  background: var(--paper); border-top: 2px solid var(--accent);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, .14);
  padding: 1.1rem 0; display: none;
}
.cookie-banner.is-shown { display: block; }
.cookie-banner__inner { display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap; }
.cookie-banner p { font-size: .87rem; color: var(--ink-soft); margin: 0; flex: 1 1 380px; min-width: 250px; }
.cookie-banner__actions { display: flex; gap: .55rem; flex-wrap: wrap; }
.cookie-banner .btn { font-size: .87rem; padding: .55rem 1.05rem; }

/* ---------- Utilities ---------- */

.center { text-align: center; }
.mx-auto { margin-inline: auto; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.muted { color: var(--ink-faint); }
.small { font-size: .86rem; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
