/* SPDX-License-Identifier: BUSL-1.1 */
:root {
  --bg: #0f1420;
  --bg-elev: #161d2e;
  --bg-elev2: #1d2740;
  --line: #2a3550;
  --txt: #e6ebf5;
  --txt-dim: #9aa6bf;
  --accent: #4f86ff;
  --accent-2: #8a5bff;
  --green: #2fbf71;
  --radius: 14px;
  --shadow: 0 8px 30px rgba(0, 0, 0, .35);
  --maxw: 1080px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  background:
    radial-gradient(1200px 600px at 80% -10%, #18223a 0%, transparent 60%),
    radial-gradient(900px 500px at 0% 0%, #1a1633 0%, transparent 55%),
    var(--bg);
  color: var(--txt);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0; }

/* ---- Logo ---- */
.logo {
  width: 34px; height: 34px; border-radius: 8px; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; font-weight: 800; color: #fff; font-size: 15px;
}
.logo.small { width: 26px; height: 26px; font-size: 12px; border-radius: 7px; }

/* ---- Header ---- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(16px, 5vw, 40px);
  background: rgba(15, 20, 32, .72);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand-name { font-size: 17px; }
.site-nav { display: flex; align-items: center; gap: clamp(12px, 3vw, 28px); }
.site-nav a { color: var(--txt-dim); font-size: 15px; transition: color .15s; }
.site-nav a:hover { color: var(--txt); }

/* ---- Buttons ---- */
.btn {
  display: inline-block; padding: 11px 20px; border-radius: 10px;
  font-weight: 600; font-size: 15px; cursor: pointer; transition: .18s;
  border: 1px solid transparent;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; box-shadow: 0 6px 20px rgba(79, 134, 255, .35);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(79, 134, 255, .45); }
.btn-ghost { border-color: var(--line); color: var(--txt); background: var(--bg-elev); }
.btn-ghost:hover { border-color: var(--accent); color: #fff; }
.btn-lg { padding: 14px 30px; font-size: 16px; }

/* ---- Sections ---- */
main { display: block; }
.section { max-width: var(--maxw); margin: 0 auto; padding: clamp(56px, 9vw, 110px) clamp(16px, 5vw, 40px); }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 48px; }
.eyebrow {
  display: inline-block; text-transform: uppercase; letter-spacing: .12em;
  font-size: 12px; font-weight: 700; color: var(--accent);
  background: rgba(79, 134, 255, .12); padding: 5px 12px; border-radius: 20px;
}
h2 { font-size: clamp(26px, 4vw, 38px); margin-top: 16px; }
.section-sub { color: var(--txt-dim); font-size: 17px; margin-top: 14px; }

/* ---- Hero ---- */
.hero {
  max-width: 860px; margin: 0 auto; text-align: center;
  padding: clamp(70px, 12vw, 140px) clamp(16px, 5vw, 40px) clamp(40px, 7vw, 80px);
}
.hero h1 { font-size: clamp(38px, 7vw, 68px); font-weight: 800; margin: 22px 0 0; letter-spacing: -.02em; }
.grad {
  background: linear-gradient(120deg, var(--accent), var(--accent-2) 70%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { font-size: clamp(17px, 2.2vw, 21px); color: var(--txt-dim); margin: 26px auto 0; max-width: 660px; }
.lead strong { color: var(--txt); font-weight: 600; }
.lead-sub { font-size: clamp(15px, 1.9vw, 18px); margin-top: 18px; }
.cta-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 36px; }
.cta-row.center { margin-top: 40px; }
.js-trial-btn:disabled { opacity: .7; cursor: progress; }

/* ---- Kontakt-Gate der Online-Demo (modaler Dialog) ----
   Beide CTA-Knoepfe oeffnen denselben Dialog; erst nach dem Absenden legt der
   Broker die Testinstanz an. Der Dialog liegt einmalig am Seitenende und wird
   per [hidden] ein-/ausgeblendet (kein <dialog>, damit auch aeltere Browser
   ohne Polyfill dasselbe Bild liefern). */
.trial-modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; }
.trial-modal[hidden] { display: none; }
.trial-modal .trial-backdrop {
  position: absolute; inset: 0; border: 0; padding: 0; cursor: pointer;
  background: rgba(6, 9, 17, .72); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.trial-dialog {
  position: relative; width: min(560px, 100%);
  max-height: 90vh; max-height: 90dvh; overflow-y: auto;
  text-align: left; background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 26px clamp(18px, 4vw, 30px) 24px;
}
.trial-dialog h3 { font-size: 21px; padding-right: 32px; }
.trial-intro { margin: 8px 0 0; font-size: 14px; color: var(--txt-dim); }
.trial-close {
  position: absolute; top: 12px; right: 12px; width: 32px; height: 32px;
  display: grid; place-items: center; cursor: pointer; font-size: 20px; line-height: 1;
  background: transparent; border: 1px solid transparent; border-radius: 8px;
  color: var(--txt-dim); font-family: inherit;
}
.trial-close:hover { color: var(--txt); border-color: var(--line); }
/* Tabellarischer Formularblock: Beschriftungsspalte + Feldspalte. */
.trial-grid { display: grid; grid-template-columns: minmax(84px, max-content) 1fr; gap: 12px 18px; align-items: center; margin-top: 20px; }
.trial-grid > label { font-size: 14px; color: var(--txt); }
.trial-grid input[type="text"], .trial-grid input[type="email"] {
  width: 100%; padding: 9px 11px; border-radius: 8px; font: inherit;
  background: var(--bg); color: var(--txt); border: 1px solid var(--line);
}
.trial-grid input[type="text"]:focus, .trial-grid input[type="email"]:focus {
  outline: none; border-color: var(--accent);
}
/* Einwilligungen laufen ueber beide Spalten (keine leere Beschriftungsspalte). */
.trial-check {
  grid-column: 1 / -1; display: flex; align-items: flex-start; gap: 9px;
  font-size: 13px; line-height: 1.45; color: var(--txt-dim);
}
.trial-check input { margin-top: 3px; flex: none; accent-color: var(--accent); }
.trial-check a { color: var(--accent); }
.trial-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.trial-actions button[disabled] { opacity: .7; cursor: progress; }
/* Status-Zeile der Online-Demo ("wird vorbereitet …" / Fehlermeldung). */
.trial-status { margin: 14px 0 0; min-height: 1.2em; color: var(--txt-dim); font-size: 14px; }
@media (max-width: 560px) {
  /* Zu schmal fuer zwei Spalten: Beschriftung ueber das Feld. */
  .trial-grid { grid-template-columns: 1fr; gap: 5px; }
  .trial-grid > label { margin-top: 7px; }
  .trial-check { margin-top: 6px; }
}
.hero-meta {
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
  margin-top: 40px; color: var(--txt-dim); font-size: 14px;
}

/* ---- Pillars ---- */
.pillars {
  max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(16px, 5vw, 40px);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.card {
  background: linear-gradient(180deg, var(--bg-elev), var(--bg-elev2));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 24px; box-shadow: var(--shadow);
}
.card-ico {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 11px;
  background: rgba(79, 134, 255, .14); color: var(--accent); font-size: 20px; margin-bottom: 16px;
}
.card h3 { font-size: 19px; margin-bottom: 8px; }
.card p, .feature p { color: var(--txt-dim); font-size: 15px; margin: 0; }
.card em, .feature em { color: var(--txt); font-style: normal; font-weight: 600; }

/* ---- Warum (Schmerz -> Lösung) ---- */
.why-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px;
  max-width: var(--maxw); margin: 0 auto;
}
.why-item {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 22px;
}
.why-pain, .why-fix { font-size: 15px; margin: 0; padding-left: 24px; position: relative; }
.why-pain { color: var(--txt-dim); margin-bottom: 14px; }
.why-pain::before { content: "✕"; position: absolute; left: 0; top: 0; color: #ff6b6b; font-weight: 700; }
.why-fix { color: var(--txt); font-weight: 500; }
.why-fix::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--green); font-weight: 700; }

/* ---- Flow ---- */
.flow { display: flex; align-items: stretch; justify-content: center; gap: 12px; flex-wrap: wrap; }
.flow-step {
  flex: 1 1 240px; max-width: 300px;
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 22px;
}
.flow-num {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-weight: 700; margin-bottom: 14px;
}
.flow-step h4 { font-size: 17px; margin-bottom: 8px; }
.flow-step p { color: var(--txt-dim); font-size: 15px; margin: 0; }
.flow-arrow { display: grid; place-items: center; color: var(--accent); font-size: 24px; }

/* ---- Feature grid ---- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 22px; transition: border-color .18s, transform .18s;
}
.feature:hover { border-color: var(--accent); transform: translateY(-2px); }
.feature h3 { font-size: 18px; margin-bottom: 8px; }

/* ---- Tech ---- */
.section-tech { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tech-list {
  list-style: none; padding: 0; margin: 0 auto; max-width: 720px;
  display: grid; gap: 12px;
}
.tech-list li {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: 11px;
  padding: 14px 18px; color: var(--txt-dim); font-size: 15px;
}
.tech-list strong { color: var(--txt); }
.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .92em; }

/* ---- Closing ---- */
.closing {
  text-align: center; max-width: 700px; margin: 0 auto;
  padding: clamp(60px, 10vw, 120px) clamp(16px, 5vw, 40px);
}
.closing h2 { font-size: clamp(28px, 4.5vw, 44px); }
.closing p { color: var(--txt-dim); font-size: 18px; margin: 18px auto 32px; }
.closing .closing-contact { font-size: 17px; margin: 28px auto 0; }
.closing .closing-contact a { color: var(--accent); font-weight: 600; }
.closing .closing-contact a:hover { text-decoration: underline; }
.closing .closing-note { font-size: 13px; line-height: 1.6; margin: 20px auto 0; max-width: 560px; }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--line); background: var(--bg-elev);
  padding: 32px clamp(16px, 5vw, 40px);
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
}
.foot-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.foot-links { display: flex; gap: 22px; flex-wrap: wrap; }
.foot-links a { color: var(--txt-dim); font-size: 14px; transition: color .15s; }
.foot-links a:hover { color: var(--txt); }
.foot-copy { color: var(--txt-dim); font-size: 13px; margin: 0; width: 100%; text-align: center; padding-top: 8px; }
.foot-disclaimer { color: var(--txt-dim); font-size: 12px; line-height: 1.6; margin: 0; width: 100%; text-align: center; padding-top: 6px; }

/* ---- Responsive ---- */
@media (max-width: 860px) {
  .pillars, .grid, .why-grid { grid-template-columns: 1fr; }
  .flow { flex-direction: column; align-items: center; }
  .flow-step { width: 100%; max-width: 360px; }
  .flow-arrow { transform: rotate(90deg); }
  .site-nav a:not(.btn) { display: none; }
}

/* ---- Legal pages (Impressum / Datenschutz) ---- */
.legal { max-width: 760px; margin: 0 auto; }
.legal h2 { font-size: clamp(24px, 4vw, 34px); }
.legal h3 { font-size: 19px; margin: 30px 0 10px; }
.legal h4 { font-size: 16px; margin: 22px 0 8px; }
.legal p, .legal li { color: var(--txt-dim); font-size: 15px; }
.legal ul { padding-left: 20px; }
.legal a { color: var(--accent); }
.legal address { font-style: normal; color: var(--txt); }
.legal .back { display: inline-block; margin-bottom: 22px; color: var(--txt-dim); font-size: 14px; }
.legal .back:hover { color: var(--txt); }
.legal table {
  border-collapse: collapse; width: 100%; margin: 14px 0; font-size: 14px;
  display: block; overflow-x: auto;
}
.legal th, .legal td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: top; }
.legal th { background: var(--bg-elev2); color: var(--txt); }
.legal td { color: var(--txt-dim); }
.todo {
  color: #ffb454; font-weight: 600;
  background: rgba(255, 180, 84, .12); padding: 1px 7px; border-radius: 6px;
}
.legal-note {
  border: 1px solid #6a4a1a; background: rgba(255, 180, 84, .08);
  border-radius: 11px; padding: 14px 18px; margin: 0 0 28px; font-size: 14px;
}

/* ---- Documentation pages (rendered from Markdown by tools/render_docs.py) ---- */
.doc { max-width: 860px; margin: 0 auto; }
.doc-nav { color: var(--txt-dim); font-size: 14px; margin: 0 0 26px; }
.doc-nav a { color: var(--txt-dim); }
.doc-nav a:hover { color: var(--txt); }
.doc h1 { font-size: clamp(28px, 5vw, 40px); margin: 6px 0 20px; }
.doc h2 {
  font-size: clamp(22px, 3.4vw, 30px); margin: 44px 0 14px;
  padding-top: 14px; border-top: 1px solid var(--line);
}
.doc h3 { font-size: 20px; margin: 30px 0 10px; }
.doc h4 { font-size: 17px; margin: 22px 0 8px; }
.doc p, .doc li { color: var(--txt-dim); font-size: 15.5px; }
.doc a { color: var(--accent); }
.doc a:hover { text-decoration: underline; }
.doc strong { color: var(--txt); }
.doc ul, .doc ol { padding-left: 22px; }
.doc li { margin: 4px 0; }
.doc code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: .9em; background: var(--bg-elev2); border: 1px solid var(--line);
  border-radius: 5px; padding: 1px 6px; color: var(--txt);
}
.doc pre {
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: 10px; padding: 16px 18px; overflow-x: auto; margin: 16px 0;
}
.doc pre code { background: none; border: none; padding: 0; font-size: 13.5px; line-height: 1.55; }
.doc blockquote {
  border-left: 3px solid var(--accent); margin: 18px 0; padding: 2px 16px;
  background: rgba(79, 134, 255, .07); border-radius: 0 8px 8px 0; color: var(--txt-dim);
}
.doc table {
  border-collapse: collapse; width: 100%; margin: 18px 0; font-size: 14.5px;
  display: block; overflow-x: auto;
}
.doc th, .doc td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: top; }
.doc th { background: var(--bg-elev2); color: var(--txt); }
.doc td { color: var(--txt-dim); }
.doc hr { border: none; border-top: 1px solid var(--line); margin: 32px 0; }
.doc img { max-width: 100%; }

/* Documentation landing (index.html) card list */
.doc-index-group { margin: 28px 0; }
.doc-index-group h2 { border: none; padding-top: 0; margin-top: 24px; }
.doc-card-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.doc-card-list a {
  display: block; background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: 11px; padding: 14px 18px; color: var(--txt); transition: border-color .15s;
}
.doc-card-list a:hover { border-color: var(--accent); text-decoration: none; }
.doc-card-list .d { color: var(--txt-dim); font-size: 14px; display: block; margin-top: 3px; }
