/* Fabulous Hosting – App, Login, Doku, Rechtsseiten. Gleiche Formensprache wie die Landingpage:
   Schwarz/Weiß, Space Grotesk, Haarlinien, Pill-Buttons, Code als schwarzes Terminal.
   Farbe gibt es nur für Fehler und Lösch-Aktionen. Keine externen Ressourcen. */
@font-face {
  font-family: "Space Grotesk";
  src: url("/assets/fonts/space-grotesk.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  --black: #000;
  --white: #fff;
  --grey: #6e6e6e;
  --soft: #f4f4f4;
  --line: #e4e4e4;
  --field: #d2d2d2;
  --red: #c4141c;
  --sans: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --gutter: clamp(20px, 4vw, 48px);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.55 var(--sans);
  color: var(--black);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
a { color: inherit; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
img, svg { max-width: 100%; }
:focus-visible { outline: 2px solid var(--black); outline-offset: 2px; }

/* ---------------------------------------------------------------- Typografie */
h1 { font-size: clamp(30px, 3.6vw, 46px); line-height: 1.04; letter-spacing: -0.035em; font-weight: 600; margin: 0 0 18px; text-wrap: balance; }
h2 { font-size: 21px; line-height: 1.2; letter-spacing: -0.02em; font-weight: 600; margin: 44px 0 14px; }
h3 { font-size: 17px; letter-spacing: -0.01em; font-weight: 600; margin: 24px 0 8px; }
p { margin: 0 0 12px; }
main > p, .prose p, .prose li { max-width: 72ch; }
.muted { color: var(--grey); }
.small { font-size: 14px; }
code { font-family: var(--mono); font-size: .86em; background: var(--soft); padding: .12em .4em; border-radius: 6px; word-break: break-word; }
pre {
  font: 13.5px/1.65 var(--mono);
  background: var(--black); color: var(--white);
  border-radius: 16px; padding: 20px 22px; margin: 14px 0;
  overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere;
}
pre code { background: none; padding: 0; color: inherit; }
pre.source { max-height: 70vh; white-space: pre-wrap; word-break: break-all; }

/* ---------------------------------------------------------------- Wortmarke */
.wordmark { font-weight: 700; font-size: 15.5px; letter-spacing: 0.04em; text-decoration: none; display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.wordmark i { width: 13px; height: 13px; background: var(--black); transform: rotate(45deg); display: inline-block; }

/* ---------------------------------------------------------------- Öffentliche Seiten */
body.public { display: flex; flex-direction: column; }
.pub-head { display: flex; align-items: center; justify-content: space-between; padding: 18px var(--gutter); border-bottom: 1px solid var(--line); }
.pub-head nav { display: flex; gap: 28px; font-size: 15px; }
.pub-head nav a { text-decoration: none; }
.pub-head nav a:hover, .pub-head nav a[aria-current] { text-decoration: underline; }
body.public main { flex: 1; width: 100%; max-width: 1040px; margin: 0 auto; padding: clamp(32px, 6vh, 72px) var(--gutter) 64px; }
body.public main.narrow { max-width: 480px; display: flex; flex-direction: column; justify-content: center; }
body.public main.narrow h1 { font-size: clamp(32px, 5vw, 44px); }
body.public main.prose { max-width: 820px; }

/* ---------------------------------------------------------------- App-Rahmen (eingeloggt) */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100dvh; }
.side {
  position: sticky; top: 0; height: 100dvh;
  padding: 22px 16px; display: flex; flex-direction: column;
}
.side-top { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 22px; }
.menu-toggle { display: none; }
.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side-nav > a { text-decoration: none; padding: 9px 14px; border-radius: 999px; font-size: 15px; }
.side-nav > a:hover { background: var(--soft); }
.side-nav > a[aria-current] { background: var(--black); color: var(--white); }
.side-user { margin-top: auto; padding: 16px 14px 0; border-top: 1px solid var(--line); font-size: 13px; color: var(--grey); display: flex; flex-direction: column; gap: 6px; }
.side-user span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user form { margin: 0; }
.content { display: flex; flex-direction: column; min-width: 0; border-left: 1px solid var(--line); }
.content main { flex: 1; width: 100%; max-width: 1400px; padding: clamp(28px, 5vh, 56px) var(--gutter) 64px; }

/* ---------------------------------------------------------------- Footer */
.foot { display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; padding: 16px var(--gutter); border-top: 1px solid var(--line); font-size: 13px; color: var(--grey); }
.foot nav { display: flex; gap: 6px 20px; flex-wrap: wrap; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--black); text-decoration: underline; }

/* ---------------------------------------------------------------- Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 500 15px/1 var(--sans); text-decoration: none; white-space: nowrap;
  padding: 13px 22px; border-radius: 999px; cursor: pointer;
  background: var(--black); color: var(--white); border: 1.5px solid var(--black);
}
.btn:hover { background: #2b2b2b; border-color: #2b2b2b; }
.btn.secondary { background: var(--white); color: var(--black); }
.btn.secondary:hover { background: var(--black); color: var(--white); }
.btn.danger { background: var(--white); color: var(--red); border-color: var(--red); }
.btn.danger:hover { background: var(--red); color: var(--white); }
.btn.small { padding: 8px 14px; font-size: 13.5px; }
.btn.full { width: 100%; }
.btn[disabled] { opacity: .55; cursor: progress; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--black); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------------------------------------------------------------- Formulare */
.stack { display: flex; flex-direction: column; gap: 18px; }
/* Buttons nicht auf volle Breite ziehen – außer in schmalen Layouts (Login, 2FA) */
main:not(.narrow) .stack > .btn, main:not(.narrow) .stack > button { align-self: flex-start; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > label { flex: 1 1 220px; }
.inline { display: inline-flex; gap: 8px; align-items: center; margin: 0; flex-wrap: wrap; }
/* Labels als Block: so bleiben eingebettete Links/Code im Fließtext (kein Flex-Zerreißen) */
label { display: block; font-size: 14px; font-weight: 500; }
label > input:not([type=checkbox]):not([type=radio]), label > select, label > textarea { display: block; margin-top: 7px; }
label.check { position: relative; padding-left: 30px; font-weight: 400; font-size: 15px; line-height: 1.45; }
label.check > input { position: absolute; left: 0; top: 1px; margin: 0; }
input, select, textarea {
  font: 16px/1.4 var(--sans); color: var(--black); background: var(--white);
  border: 1px solid var(--field); border-radius: 12px; padding: 12px 14px; width: 100%;
  transition: border-color .12s, box-shadow .12s;
}
textarea { resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: #a8a8a8; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--black); box-shadow: 0 0 0 3px rgb(0 0 0 / .08); }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; flex: none; accent-color: var(--black); }
input[type=file] { padding: 10px; background: var(--soft); border-style: dashed; font-size: 14px; }
input[type=file]::file-selector-button { font: 500 14px/1 var(--sans); padding: 10px 16px; margin-right: 14px; border-radius: 999px; border: 1.5px solid var(--black); background: var(--white); color: var(--black); cursor: pointer; }
input[type=file]::file-selector-button:hover { background: var(--black); color: var(--white); }
fieldset { border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px 22px; margin: 0; display: flex; flex-direction: column; gap: 14px; }
legend { font-weight: 600; font-size: 15px; padding: 0 8px; margin-left: -8px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------------------------------------------------------------- Flächen */
.card { border: 1px solid var(--line); border-radius: 18px; padding: 22px 24px; margin: 16px 0; background: var(--white); }
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.card h2 { font-size: 18px; margin: 0 0 10px; }
.card.highlight { border: 1.5px solid var(--black); }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid .card { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.grid .card h2 a { text-decoration: none; }
.grid .card h2 a:hover { text-decoration: underline; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; margin: 8px 0 24px; }
.stats > div { padding: 18px 22px; border-left: 1px solid var(--line); color: var(--grey); font-size: 14px; }
.stats > div:first-child { border-left: 0; }
.stats strong { display: block; font-size: 34px; letter-spacing: -0.03em; color: var(--black); font-weight: 600; line-height: 1.1; }
.stats a { text-decoration: none; }
.subnav { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 28px; }
.subnav a { text-decoration: none; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); font-size: 14px; }
.subnav a:hover { border-color: var(--black); }

/* ---------------------------------------------------------------- Meldungen */
.flash { border-radius: 14px; padding: 14px 18px; margin: 0 0 22px; font-size: 15px; border: 1px solid var(--black); }
.flash.ok::before { content: "✓  "; font-weight: 700; }
.flash.err { border-color: var(--red); color: var(--red); }
.flash.warn { border-style: dashed; }
.flash.small { font-size: 14px; }
.warnings { list-style: none; padding: 0; margin: 10px 0; display: flex; flex-direction: column; gap: 10px; }
.warnings li { border-left: 3px solid var(--black); background: var(--soft); border-radius: 0 12px 12px 0; padding: 12px 16px; font-size: 15px; }
.warnings li p { margin: 6px 0 0; color: var(--grey); font-size: 14px; }
.legal-placeholder { background: var(--soft); border: 1px dashed var(--black); padding: 0 6px; border-radius: 6px; font-weight: 600; font-size: .92em; }

/* ---------------------------------------------------------------- Tags & Status */
.tag { display: inline-block; font-size: 12.5px; line-height: 1; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
h1 .tag { font-size: 13px; letter-spacing: 0; font-weight: 500; vertical-align: .35em; margin-left: 6px; }
.status-active { background: var(--black); color: var(--white); border-color: var(--black); }
.status-review { border: 1px dashed var(--black); }
.status-blocked, .status-suspended { border-color: var(--red); color: var(--red); }

/* ---------------------------------------------------------------- Tabellen */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 18px; margin: 12px 0; }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-weight: 500; color: var(--grey); font-size: 13px; background: #fafafa; }
tr:last-child td { border-bottom: 0; }
tr.revoked td { color: var(--grey); text-decoration: line-through; }
tr.revoked td:last-child { text-decoration: none; }
td.actions { white-space: nowrap; }
td form { margin: 0; }
td code { white-space: nowrap; word-break: normal; }
dl { margin: 0 0 12px; display: grid; grid-template-columns: minmax(120px, 200px) 1fr; gap: 6px 18px; }
dt { color: var(--grey); font-size: 14px; }
dd { margin: 0; }
.pre { white-space: pre-wrap; }

/* ---------------------------------------------------------------- Kopieren */
.copy-wrap { position: relative; }
.copy-wrap pre { padding-top: 52px; }
.copy-wrap .btn { position: absolute; top: 12px; right: 12px; background: var(--white); color: var(--black); border-color: var(--white); }
.copy-wrap .btn:hover { background: #e9e9e9; }
code.secret { display: block; font-size: 15px; padding: 14px 16px; background: var(--black); color: var(--white); border-radius: 12px; word-break: break-all; }
.copyable + .btn { margin-top: 10px; }

details summary { cursor: pointer; font-size: 14px; color: var(--grey); }

/* ---------------------------------------------------------------- Formular-Builder */
[data-fields] { gap: 10px; }
.field-row { display: grid; grid-template-columns: 2fr 1.3fr auto auto; gap: 12px; align-items: end; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fafafa; }
.field-row label.check { margin-bottom: 13px; font-size: 14px; }
.field-row .opts { grid-column: 1 / -1; }
.field-row [data-remove] { margin-bottom: 4px; }

/* ---------------------------------------------------------------- Zweispaltige Formularseiten (z. B. Missbrauch melden) */
.split { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(32px, 6vw, 80px); align-items: start; }
.split-intro { padding-top: 8px; }
.split-intro h1 { margin-bottom: 14px; }
.split .card { margin: 0; padding: 22px 26px; }
.split .stack { gap: 13px; }
.split-foot { align-items: center; justify-content: space-between; flex-wrap: nowrap; }
.split-foot p { margin: 0; max-width: 34ch; }
.split .row > label { flex: 1 1 150px; }
.split .row > label.grow { flex: 1.6 1 200px; }
body.public main:has(.split) { padding-block: clamp(24px, 5vh, 56px) 32px; display: flex; flex-direction: column; justify-content: center; }

/* ---------------------------------------------------------------- Prompt-Builder-Wizard */
.wizard { display: flex; flex-direction: column; gap: 22px; }
.wz-progress { display: none; list-style: none; padding: 0; margin: 4px 0 6px; gap: 6px; flex-wrap: wrap; }
.wz-on .wz-progress { display: flex; }
.wz-progress li { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; border: 1px solid var(--line); font-size: 13.5px; color: var(--grey); cursor: pointer; }
.wz-progress li span { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 600; background: var(--soft); color: var(--black); }
.wz-progress li.done { color: var(--black); }
.wz-progress li.done span { background: var(--black); color: var(--white); }
.wz-progress li.current { border-color: var(--black); color: var(--black); font-weight: 500; }
.wz-progress li.current span { background: var(--black); color: var(--white); }
.wz-step { border: 1px solid var(--line); border-radius: 22px; padding: 26px 28px 28px; }
.wz-step h2 { margin: 0 0 4px; font-size: 24px; }
.wz-step > p.muted { margin-bottom: 20px; }
.wz-nav { display: none; align-items: center; justify-content: space-between; gap: 12px; }
.wz-on .wz-nav { display: flex; }
.wizard:not(.wz-on) .wz-nav { display: flex; justify-content: flex-end; }
.wizard:not(.wz-on) [data-prev], .wizard:not(.wz-on) [data-next], .wizard:not(.wz-on) [data-step-label] { display: none; }
.choice-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.choice-grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.choice-grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.choice { position: relative; display: block; cursor: pointer; font-weight: 500; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice > span { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 14px 16px; border: 1px solid var(--field); border-radius: 14px; font-size: 15px; line-height: 1.35; transition: border-color .12s, background .12s; }
.choice > span small { color: var(--grey); font-weight: 400; font-size: 13.5px; line-height: 1.45; }
.choice:hover > span { border-color: var(--black); }
.choice input:checked + span { border-color: var(--black); background: var(--black); color: var(--white); }
.choice input:checked + span small { color: #cfcfcf; }
.choice input:focus-visible + span { outline: 2px solid var(--black); outline-offset: 2px; }
.choice.big > span { padding: 18px 20px; }
.choice.big b { font-size: 17px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 18px; }
.steps-list { padding-left: 22px; margin: 0 0 18px; line-height: 1.8; }

/* ---------------------------------------------------------------- Tarife */
.plans { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 20px 0; }
.plan { border: 1px solid var(--line); border-radius: 20px; padding: 22px 20px 20px; display: flex; flex-direction: column; min-width: 0; }
.plan.current { border: 1.5px solid var(--black); }
.plan-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; }
.plan-head h2 { margin: 0; font-size: 18px; }
.price { display: flex; align-items: baseline; gap: 6px; margin: 14px 0 2px; }
.price strong { font-size: 36px; letter-spacing: -0.03em; font-weight: 600; line-height: 1; }
.price span { color: var(--grey); font-size: 14px; }
.plan-sub { color: var(--grey); font-size: 13px; margin: 0 0 16px; }
.checks { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.checks li { position: relative; padding-left: 24px; font-size: 14.5px; line-height: 1.4; }
.checks li::before { content: ""; position: absolute; left: 2px; top: 4px; width: 12px; height: 7px; border-left: 2px solid var(--black); border-bottom: 2px solid var(--black); transform: rotate(-45deg); }
.plan .btn.full { white-space: normal; }
.btn.disabled { pointer-events: none; opacity: .55; }
.plan-note { margin: 0; }
.order { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.order .card { margin: 0; }
.order-summary .price { margin-bottom: 16px; }
.order-facts { grid-template-columns: 110px 1fr; margin: 4px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14.5px; }
label.check.small { font-size: 13.5px; line-height: 1.5; color: var(--grey); }
@media (max-width: 1100px) { .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .order { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .plans { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- Bestätigungs-Modal */
dialog.modal { border: 0; padding: 0; background: transparent; max-width: min(440px, calc(100vw - 32px)); width: 100%; }
dialog.modal::backdrop { background: rgb(0 0 0 / .42); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.modal-card { background: var(--white); border-radius: 22px; padding: 26px 26px 22px; box-shadow: 0 30px 80px -20px rgb(0 0 0 / .45); }
.modal-title { font-size: 22px; letter-spacing: -0.02em; margin: 0 0 8px; }
.modal-text { color: var(--grey); margin: 0 0 22px; line-height: 1.5; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
dialog.modal[open] .modal-card { animation: modal-in .16s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { dialog.modal[open] .modal-card { animation: none; } }
@media (max-width: 520px) { .modal-actions { flex-direction: column-reverse; } .modal-actions .btn { width: 100%; } }

/* ---------------------------------------------------------------- Doku & Rechtstexte */
.prose h1 { margin-bottom: 24px; }
.prose h2 { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); }
.prose h2:first-of-type { border-top: 0; padding-top: 0; }
.prose ul { padding-left: 20px; }
.prose li { margin: 6px 0; }
.prose table { font-size: 14px; }

/* ---------------------------------------------------------------- Mobil */
@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; gap: 20px; }
  .split-foot { flex-wrap: wrap; }
  .shell { grid-template-columns: 1fr; }
  .side { position: sticky; top: 0; z-index: 20; height: auto; padding: 0; background: var(--white); border-bottom: 1px solid var(--line); }
  .content { border-left: 0; }
  .side-top { padding: 14px var(--gutter); }
  .js .menu-toggle {
    display: inline-flex; font: 500 14px/1 var(--sans); padding: 9px 16px; border-radius: 999px;
    border: 1px solid var(--black); background: var(--white); color: var(--black); cursor: pointer;
  }
  .js .menu-toggle[aria-expanded="true"] { background: var(--black); color: var(--white); }
  .side-nav { padding: 0 var(--gutter) 16px; }
  .js .side-nav:not(.open) { display: none; }
  .side-user { margin-top: 10px; }
  .field-row { grid-template-columns: 1fr 1fr; }
  .field-row label:first-child { grid-column: 1 / -1; }
  dl { grid-template-columns: 1fr; gap: 2px; }
  dd { margin-bottom: 8px; }
  .pub-head nav { gap: 18px; }
  .foot { justify-content: center; text-align: center; }
  .foot nav { justify-content: center; }
}
@media (max-width: 520px) {
  .codes { grid-template-columns: 1fr; }
  .card { padding: 18px; }
  pre { font-size: 12.5px; padding: 16px; border-radius: 14px; }
  .btn { padding: 12px 18px; }
}
