:root {
  --accent: #4F46E5;
  --bg: #f6f7f9;
  --card: #ffffff;
  --ink: #1f2430;
  --muted: #6b7280;
  --line: #e5e7eb;
  --ok: #138a4e;
  --warn: #b45309;
  --err: #c0362c;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.1);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

/* layout utilities (CSP-safe replacements for inline styles) */
.auth-card { max-width: 440px; margin: 8px auto; }
.wrap-narrow { max-width: 760px; }
.link-sm { font-size: 13px; }
.flex2 { flex: 2; }
.noflex { flex: 0 0 auto; min-width: 0; }
.mt16 { margin-top: 16px; }
.mt14 { margin-top: 14px; }
.mt12 { margin-top: 12px; }
.m0 { margin: 0; }
.row.vcenter { align-items: center; }
.hrow { display: flex; align-items: center; }
.logo-preview { max-height: 40px; border-radius: 6px; }
body {
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink); background: var(--bg);
}
a { color: var(--accent); }
.hidden { display: none !important; }

/* top bar */
header.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px; background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: baseline; gap: 7px; font-weight: 700; }
.brand .sl { font-size: 13px; color: var(--muted); font-weight: 600; }
.brand .biz { font-size: 18px; color: var(--accent); }
.spacer { flex: 1; }
.hdr-email { color: var(--muted); font-size: 14px; }

.wrap { max-width: 920px; margin: 0 auto; padding: 24px 20px 64px; }

/* cards */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px;
}
.card h2 { margin: 0 0 4px; font-size: 16px; }
.card .sub { color: var(--muted); font-size: 13px; margin: 0 0 16px; }

/* forms */
label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 5px; }
input[type=text], input[type=email], input[type=password], textarea, input[type=color] {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px;
  font: inherit; color: var(--ink); background: #fff;
}
input[type=color] { height: 42px; padding: 4px; }
textarea { resize: vertical; min-height: 90px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 160px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 4px; }

button {
  font: inherit; font-weight: 600; cursor: pointer; border-radius: 9px;
  padding: 10px 16px; border: 1px solid transparent; background: var(--accent); color: #fff;
}
button.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
button.danger { background: #fff; color: var(--err); border-color: #f3c9c4; }
button.sm { padding: 6px 11px; font-size: 13px; }
button:disabled { opacity: .55; cursor: default; }
.actions { display: flex; gap: 10px; align-items: center; margin-top: 16px; flex-wrap: wrap; }

/* tabs */
.tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.tabs button { background: #eef0f3; color: var(--ink); border: none; }
.tabs button.active { background: var(--accent); color: #fff; }

/* storage bar */
.bar { height: 8px; background: #eceef1; border-radius: 6px; overflow: hidden; }
.bar > div { height: 100%; background: var(--accent); width: 0; transition: width .3s; }

/* folder list */
.folder {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; background: #fff;
}
.folder .fi { width: 38px; height: 38px; border-radius: 9px; background: color-mix(in srgb, var(--accent) 14%, #fff);
  display: flex; align-items: center; justify-content: center; color: var(--accent); font-size: 19px; }
.folder .meta { flex: 1; min-width: 0; }
.folder .meta b { display: block; }
.folder .meta small { color: var(--muted); }

/* doc / upload rows */
.item {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  border: 1px solid var(--line); border-radius: 9px; margin-bottom: 8px; background: #fff;
}
.item .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item small { color: var(--muted); }
.dropzone {
  border: 2px dashed var(--line); border-radius: 11px; padding: 22px; text-align: center;
  color: var(--muted); cursor: pointer; background: #fcfcfd;
}
.dropzone.drag { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, #fff); }

.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill.trial { background: #fef3c7; color: var(--warn); }
.pill.active { background: #dcfce7; color: var(--ok); }
.pill.off { background: #fee2e2; color: var(--err); }

.linkbox { display: flex; gap: 8px; align-items: center; }
.linkbox input { font-size: 13px; color: var(--muted); }

/* modal */
.modal-bg {
  position: fixed; inset: 0; background: rgba(16,24,40,.45);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50;
}
.modal { background: #fff; border-radius: 14px; max-width: 460px; width: 100%; padding: 24px; box-shadow: 0 20px 48px rgba(0,0,0,.25); }
.modal h3 { margin: 0 0 8px; }
.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 18px;
  letter-spacing: 1px; background: #f3f4f6; border: 1px solid var(--line); border-radius: 9px;
  padding: 14px; text-align: center; margin: 14px 0; word-break: break-all;
}

/* toast */
#toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: #1f2430; color: #fff; padding: 11px 18px; border-radius: 10px;
  box-shadow: var(--shadow); z-index: 60; font-size: 14px;
}
.msg { font-size: 13px; margin-top: 10px; min-height: 18px; }
.msg.err { color: var(--err); }
.msg.ok { color: var(--ok); }

/* landing hero */
.hero { max-width: 760px; margin: 30px auto 4px; text-align: center; }
.hero h1 { font-size: 27px; line-height: 1.25; margin: 0 0 10px; }
.hero p { color: var(--muted); font-size: 16px; max-width: 580px; margin: 0 auto; }
.hero-feats { display: flex; gap: 14px; margin: 22px auto 0; flex-wrap: wrap; }
.hero-feats > div { flex: 1; min-width: 200px; background: var(--card); border: 1px solid var(--line); border-radius: 11px; padding: 14px 16px; text-align: left; box-shadow: var(--shadow); }
.hero-feats b { display: block; margin-bottom: 3px; }
.hero-feats span { color: var(--muted); font-size: 13px; }

/* recipient page */
.rhead { background: var(--card); border-bottom: 1px solid var(--line); }
.rhead a.slref { text-decoration: none; }
.rhead a.slref:hover { text-decoration: underline; color: var(--accent); }
.rhead .inner { max-width: 760px; margin: 0 auto; padding: 22px 20px; display: flex; align-items: center; gap: 16px; }
.rhead img.logo { max-height: 52px; max-width: 200px; border-radius: 6px; }
.rhead .btxt b { font-size: 20px; display: block; }
.rhead .btxt span { color: var(--muted); }
.rhead .slref { margin-left: auto; font-size: 12px; color: var(--muted); }
.instruction { white-space: pre-wrap; }

/* ===================== landing (logged-out) ===================== */
.eyebrow {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 11%, #fff); padding: 4px 11px; border-radius: 999px; margin-bottom: 12px;
}
.hero-cta { margin-top: 20px; display: flex; flex-direction: column; align-items: center; gap: 9px; }
.btn-primary {
  display: inline-block; background: var(--accent); color: #fff; font-weight: 600;
  padding: 12px 24px; border-radius: 10px; text-decoration: none; border: none; cursor: pointer; font: inherit; font-weight: 600;
}
.btn-primary:hover { filter: brightness(1.06); }
.hero-note { color: var(--muted); font-size: 13px; }

.lp { max-width: 720px; margin: 46px auto 0; text-align: center; }
.lp-h { font-size: 22px; margin: 0 0 10px; }
.lp-h.center { text-align: center; max-width: 720px; margin: 46px auto 4px; }
.lp-lead { color: var(--muted); font-size: 15px; line-height: 1.65; }

.steps { display: flex; gap: 16px; max-width: 900px; margin: 26px auto 0; flex-wrap: wrap; }
.step { flex: 1; min-width: 220px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; box-shadow: var(--shadow); text-align: left; }
.step-n { display: inline-flex; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; align-items: center; justify-content: center; font-weight: 700; margin-bottom: 10px; }
.step b { display: block; margin-bottom: 4px; }
.step span { color: var(--muted); font-size: 13px; }

.shots { display: flex; gap: 22px; max-width: 940px; margin: 18px auto 0; flex-wrap: wrap; align-items: flex-start; }
.shot { flex: 1; min-width: 300px; margin: 0; }
.shot-bar { display: flex; align-items: center; gap: 6px; background: #e9ebef; border: 1px solid var(--line); border-bottom: none; border-radius: 11px 11px 0 0; padding: 9px 12px; }
.shot-bar .dot { width: 10px; height: 10px; border-radius: 50%; background: #c4c8cf; }
.shot-url { margin-left: 8px; font-size: 11px; color: var(--muted); background: #fff; border-radius: 6px; padding: 3px 10px; flex: 1; text-align: left; }
.shot-body { border: 1px solid var(--line); border-radius: 0 0 11px 11px; background: var(--bg); padding: 14px; box-shadow: var(--shadow); }
.shot-body .card { margin-bottom: 0; }
.shot figcaption { color: var(--muted); font-size: 13px; margin-top: 11px; text-align: center; line-height: 1.5; }

/* recipient mini-replica (teal brand) */
.demo-teal { --accent: #0D9488; }
.rc-head { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.rc-logo { width: 34px; height: 34px; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.rc-btxt b { display: block; font-size: 14px; } .rc-btxt span { color: var(--muted); font-size: 11px; }
.rc-ref { margin-left: auto; font-size: 10px; color: var(--muted); text-align: right; }
.rc-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.rc-card.docs { border-left: 4px solid #4F46E5; } .rc-card.returns { border-left: 4px solid #0891b2; }
.rc-title { font-size: 14px; } .rc-instr { color: var(--muted); font-size: 12px; margin: 6px 0 0; }
.rc-h { font-weight: 600; font-size: 13px; margin-bottom: 8px; }
.rc-row { display: flex; justify-content: space-between; align-items: center; font-size: 12px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 6px; background: #fff; }
.rc-dl { color: var(--accent); font-weight: 600; }
.rc-field { font-size: 11px; font-weight: 600; margin: 6px 0 3px; }
.rc-input { height: 30px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.rc-drop { border: 2px dashed var(--line); border-radius: 9px; padding: 14px; text-align: center; color: var(--muted); font-size: 12px; margin-top: 9px; }

/* static Mappe color helpers (replica only; the live app sets these via CSSOM) */
.mappe.c0 { border-left-color: #0D9488; } .mappe.c0 .mappe-head { background: #eaf6f4; } .mappe.c0 .mi { color: #0D9488; }
.mappe.c1 { border-left-color: #7c3aed; } .mappe.c1 .mappe-head { background: #f3eefc; } .mappe.c1 .mi { color: #7c3aed; }

/* price strip + feature grid */
.lp-price { display: flex; align-items: center; gap: 22px; max-width: 760px; margin: 36px auto 8px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px 26px; box-shadow: var(--shadow); flex-wrap: wrap; }
.lp-price-fig { text-align: center; flex: 0 0 auto; }
.lp-price-fig b { font-size: 30px; display: block; color: var(--accent); line-height: 1.1; }
.lp-price-fig span { color: var(--muted); font-size: 12px; }
.lp-price-txt { flex: 1; min-width: 200px; text-align: left; }
.lp-price-txt b { display: block; } .lp-price-txt span { color: var(--muted); font-size: 13px; }
.lp-feats { margin-top: 24px; }

/* legal page (AGB / Datenschutz / Impressum) */
.brand-link { text-decoration: none; }
.legal-nav { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 18px; }
.legal-nav a { text-decoration: none; background: #eef0f3; color: var(--ink); font-size: 13px; font-weight: 600; padding: 7px 14px; border-radius: 999px; }
.legal-nav a:hover { background: color-mix(in srgb, var(--accent) 14%, #fff); color: var(--accent); }
.legal h1 { font-size: 22px; margin: 0 0 4px; }
.legal h3 { font-size: 15px; margin: 20px 0 6px; }
.legal h3.legal-hl { color: var(--accent); border-left: 3px solid var(--accent); padding-left: 10px; margin-left: -13px; }
.legal p { font-size: 14px; line-height: 1.6; margin: 0 0 10px; color: #2c313c; }
.legal-stand { color: var(--muted); font-size: 12px; }
.legal-foot { text-align: center; color: var(--muted); font-size: 12px; margin: 8px 0 0; }

/* landing footer */
.lp-footer { max-width: 760px; margin: 34px auto 0; padding-top: 18px; border-top: 1px solid var(--line); display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; align-items: center; }
.lp-footer a { color: var(--muted); text-decoration: none; font-size: 13px; }
.lp-footer a:hover { color: var(--accent); }
.lp-footer .copy { color: var(--muted); font-size: 12px; }
.signup-terms { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; color: var(--muted); margin: 10px 0 2px; line-height: 1.45; }
.signup-terms input[type=checkbox] { width: auto; margin-top: 2px; flex: 0 0 auto; }
.note-soft { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; border-radius: 9px; padding: 9px 12px; font-size: 12.5px; margin-top: 10px; }

/* AVV (Auftragsverarbeitung) */
.avv .party { background: #f7f8fa; border: 1px solid var(--line); border-radius: 9px; padding: 12px 14px; }
.fill { display: inline-block; min-width: 180px; border-bottom: 1px solid #9aa1ac; height: 1.2em; vertical-align: bottom; }
.fill-wide { min-width: 280px; max-width: 100%; }
.fill-block { display: block; border: 1px dashed #9aa1ac; border-radius: 8px; height: 70px; margin-top: 6px; }
.avv-tbl { width: 100%; border-collapse: collapse; margin: 6px 0 4px; }
.avv-tbl th, .avv-tbl td { border: 1px solid var(--line); padding: 8px 10px; font-size: 13px; text-align: left; vertical-align: top; }
.avv-tbl th { background: #f3f4f6; width: 180px; font-weight: 600; }
.sig-wrap { display: flex; gap: 28px; margin-top: 26px; flex-wrap: wrap; }
.sig-col { flex: 1; min-width: 220px; }
.sig-line { border-bottom: 1px solid var(--ink); height: 34px; }
.sig-line.sig-gap { margin-top: 26px; }
.sig-cap { font-size: 12px; color: var(--muted); margin: 4px 0 0; }

/* print: clean A4-ish document, hide app chrome */
@media print {
  @page { margin: 18mm 16mm; }
  body { background: #fff; color: #000; }
  .noprint { display: none !important; }
  .wrap { max-width: none; margin: 0; padding: 0; }
  .card { box-shadow: none; border: none; border-radius: 0; padding: 0; margin: 0 0 14px; }
  .legal h1 { font-size: 18pt; } .legal h2 { font-size: 15pt; } .legal h3 { font-size: 12pt; }
  .legal p, .avv-tbl th, .avv-tbl td { font-size: 10.5pt; color: #000; }
  .annex { break-before: page; }
  .avv .party { background: transparent; }
  .avv-tbl th { background: #eee; }
  a { color: #000; text-decoration: none; }
}

/* identity-request options (admin) */
.fv-check { display: flex; align-items: center; gap: 8px; font-weight: 600; margin: 14px 0 0; }
.fv-check.sm { font-weight: 500; margin: 4px 0; }
.fv-check input[type=checkbox] { width: auto; }
.askbox {
  border-left: 3px solid color-mix(in srgb, var(--accent) 45%, #fff);
  background: #fafbff; border-radius: 0 9px 9px 0; padding: 12px 14px; margin: 12px 0 4px;
}
.askbox input[type=text] { background: #fff; }
.askbox-intro { margin: 0 0 8px; }
.askbox-l { font-weight: 500; margin: 10px 0 4px; }

/* subtle colored section segments, to separate "Dokumente" from "Rücksendungen" */
.card.seg-docs { border-left: 4px solid #4F46E5; }
.card.seg-returns { border-left: 4px solid #0891b2; }

/* returned files grouped per person into a "Mappe" (collapsible) */
.mappe {
  border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: 9px; margin-bottom: 10px; background: #fff; overflow: hidden;
}
.mappe-head { display: flex; align-items: center; gap: 12px; padding: 11px 14px; cursor: pointer; user-select: none; }
.mappe-head .mi { font-size: 18px; line-height: 1; }
.mappe-meta { flex: 1; min-width: 0; }
.mappe-meta b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mappe-meta small { color: var(--muted); }
.mappe-head .chev { color: var(--muted); transition: transform .15s; font-size: 12px; }
.mappe.collapsed .chev { transform: rotate(-90deg); }
.mappe-body { padding: 2px 12px 10px; }
.mappe.collapsed .mappe-body { display: none; }
.item.sub { background: #fcfcfd; margin-bottom: 6px; }
