/* Lizenzportal – Farben wie website/style.css */
:root {
  --bg: #f7f5f1;
  --bg-alt: #efebe4;
  --surface: #ffffff;
  --text: #1d1b19;
  --muted: #5f5a54;
  --line: #ddd7ce;
  --accent: #b4442b;
  --accent-ink: #ffffff;
  --accent-soft: #f6e3dc;
  --ok: #2f7a45;
  --ok-soft: #e1f1e5;
  --warn: #8a6200;
  --warn-soft: #f7ecd0;
  --bad: #b3261e;
  --bad-soft: #f9e0de;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 8px 24px rgba(40,30,20,.08);
  --radius: 14px;
  --max: 1080px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151413; --bg-alt: #1c1b19; --surface: #23211f; --text: #f1ede7; --muted: #a9a29a;
    --line: #36332f; --accent: #e0694d; --accent-ink: #1a0d09; --accent-soft: #3a221b;
    --ok: #7fcf95; --ok-soft: #1d3324; --warn: #e6c060; --warn-soft: #3a3016; --bad: #f08a80; --bad-soft: #3d1f1c;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.3);
  }
}
:root[data-theme="dark"] {
  --bg: #151413; --bg-alt: #1c1b19; --surface: #23211f; --text: #f1ede7; --muted: #a9a29a;
  --line: #36332f; --accent: #e0694d; --accent-ink: #1a0d09; --accent-soft: #3a221b;
  --ok: #7fcf95; --ok-soft: #1d3324; --warn: #e6c060; --warn-soft: #3a3016; --bad: #f08a80; --bad-soft: #3d1f1c;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.3);
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--accent); }
h1 { font-size: 28px; line-height: 1.2; margin: 0 0 16px; letter-spacing: -.01em; }
h2 { font-size: 20px; margin: 0 0 12px; }
h3 { font-size: 16px; margin: 20px 0 8px; }
p { margin: 0 0 12px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; width: 100%; }
.main { flex: 1; padding-top: 28px; padding-bottom: 48px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.mono, code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.inline { display: inline; margin: 0; }

/* Kopf und Fuß */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; }
.logo {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  background: radial-gradient(circle, var(--accent) 0 22%, #1b1a1a 23% 100%);
  box-shadow: inset 0 0 0 4px #1b1a1a, inset 0 0 0 5px #444;
}
.nav { margin-left: auto; display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.nav a, .linklike { color: var(--muted); text-decoration: none; font-size: 15px; }
.nav a:hover, .linklike:hover { color: var(--text); }
.nav a[aria-current] { color: var(--text); font-weight: 600; }
.nav a.btn { color: var(--accent-ink); }
.linklike { background: none; border: 0; padding: 0; font: inherit; font-size: 15px; cursor: pointer; }
.who { font-size: 14px; color: var(--muted); margin-bottom: 16px; }
.site-footer { border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.site-footer .wrap { display: flex; gap: 20px; padding-top: 18px; padding-bottom: 18px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }

/* Knöpfe */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent);
  padding: 10px 18px; border-radius: 999px; font: inherit; font-weight: 600; font-size: 15px;
  text-decoration: none; cursor: pointer;
}
.btn:hover { filter: brightness(1.06); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-alt); filter: none; }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-small { padding: 5px 12px; font-size: 14px; }

/* Karten, Raster */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-bottom: 20px; }
.narrow { max-width: 480px; margin-left: auto; margin-right: auto; }
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr)); }
.grid > .card { margin-bottom: 0; min-width: 0; }
.grid + section, .grid + .card, .grid { margin-bottom: 20px; }
.hero { padding: 24px 0 28px; max-width: 640px; }
.hero h1 { font-size: 34px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.row-between h2 { margin: 0; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 4px 0; font-size: 14px; }
ul.tiers { padding-left: 18px; }
.price { color: var(--accent); font-weight: 600; white-space: nowrap; }

/* Formulare */
.form { max-width: 480px; margin-left: auto; margin-right: auto; }
.grid .form { max-width: none; margin: 0; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 14px; font-weight: 600; margin-bottom: 5px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.field-row { display: grid; grid-template-columns: minmax(90px, 1fr) 2.5fr; gap: 12px; }
.card-attention { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }
.locked { background: var(--bg-alt); border: 1px dashed var(--line); border-radius: 10px; padding: 14px 16px; font-size: 15px; }
textarea.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; line-height: 1.45; }
.sig-preview { width: 100%; height: 340px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.sig-text { white-space: pre-wrap; background: var(--bg-alt); border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-size: 13px; margin: 0; overflow-wrap: anywhere; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; margin: 4px 0 16px; }
.check input { margin-top: 4px; }
.search { display: flex; gap: 8px; }
.search input { width: 260px; max-width: 100%; padding: 6px 12px; }
.error { background: var(--bad-soft); color: var(--bad); padding: 10px 14px; border-radius: 10px; font-size: 14px; }

/* Hinweise */
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 15px; border: 1px solid transparent; }
.flash-ok { background: var(--ok-soft); color: var(--ok); }
.flash-error { background: var(--bad-soft); color: var(--bad); }
.flash-info { background: var(--accent-soft); color: var(--text); }

/* Lizenzen */
.license-head { display: flex; align-items: center; gap: 12px; justify-content: space-between; flex-wrap: wrap; margin-bottom: 8px; }
.license-head h1, .license-head h2 { margin: 0; }
.product-head { font-size: 18px; margin: 22px 0 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
h1 + .product-head { margin-top: 0; }

/* Bestellen: erst Produkt, dann Lizenz */
.order { margin-top: 28px; }
.order fieldset { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.order legend { font-weight: 600; font-size: 15px; margin-bottom: 10px; padding: 0; }
.choices { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice-body { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); transition: border-color .12s, box-shadow .12s; }
.choice:hover .choice-body { border-color: var(--muted); }
.choice input:focus-visible + .choice-body { outline: 2px solid var(--accent); outline-offset: 2px; }
.choice input:checked + .choice-body { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); background: var(--surface); }
.choice-title { font-weight: 700; font-size: 17px; }
.choice-meta { font-size: 14px; color: var(--muted); }
.choice-price { margin-top: 6px; font-size: 20px; font-weight: 700; color: var(--accent); }
.js .tier-group[hidden], .js .order-rest[hidden] { display: none; }
.order-foot { display: flex; gap: 16px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.order-foot p { flex: 1 1 320px; margin: 0; }

.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Bezahlen */
.pay-group { margin-top: 6px; }
.pay-options { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.pay-option { border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: var(--bg); display: flex; flex-direction: column; gap: 8px; }
.pay-option h3 { margin: 0; font-size: 16px; }
.pay-option p { margin: 0; }
.pay-option .btn { align-self: flex-start; margin-top: auto; }
.pay-paypal .check { margin: 0; }
#paypal-buttons { min-height: 48px; }
#paypal-buttons.is-locked { opacity: .45; pointer-events: none; }
#pp-status:empty { display: none; }
#pp-status.is-error { color: var(--bad); }
details.pending > summary { cursor: pointer; }
details.pending[open] > summary { margin-bottom: 10px; }

/* Einklappbare Lizenz-Panels */
details.license { padding: 0; }
details.license > summary { list-style: none; cursor: pointer; padding: 18px 22px; margin: 0; flex-wrap: nowrap; border-radius: var(--radius); }
details.license > summary::-webkit-details-marker { display: none; }
details.license > summary:hover { background: var(--bg-alt); }
details.license > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
details.license[open] > summary { border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; }
.license-title { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.license-title .h2 { font-size: 20px; font-weight: 700; }
.license-meta { font-size: 14px; color: var(--muted); }
.chevron { width: 10px; height: 10px; flex: none; margin-left: 4px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; }
details.license[open] .chevron { transform: rotate(-135deg); }
.license-body { padding: 4px 22px 22px; }
@media (max-width: 640px) {
  details.license > summary { padding: 14px 16px; }
  .license-body { padding: 4px 16px 16px; }
  .license-title .h2 { font-size: 18px; }
}
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 12px 20px; margin: 14px 0 18px; }
.facts dt { font-size: 13px; color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.label { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.keybox { display: flex; gap: 10px; align-items: center; background: var(--bg-alt); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.keybox code { flex: 1; font-size: 13px; overflow-wrap: anywhere; word-break: break-all; }
.keybox .btn { flex: none; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--bg-alt); color: var(--muted); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.empty { text-align: center; padding: 32px; }

/* Tabellen */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); padding: 8px 10px 8px 0; }
.table td { border-bottom: 1px solid var(--line); padding: 10px 10px 10px 0; vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }

/* Kennzahlen */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat-num { display: block; font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 13px; color: var(--muted); }

@media (max-width: 640px) {
  h1, .hero h1 { font-size: 24px; }
  .card { padding: 16px; }
  .table thead { display: none; }
  .table tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; }
  .table td { display: block; border: 0; padding: 2px 0; }
  .table td.right { text-align: left; padding-top: 6px; }
  .keybox { flex-direction: column; align-items: stretch; }
}
