/* =====================================================================
   X-NRW Datentransfer – Gestaltung angelehnt an www.x-nrw.de
   Farben/Schrift aus dem Designsystem der Website (--red, --anth, …)
   ===================================================================== */

@font-face { font-family: "xerox-sans"; src: url("../fonts/xeroxsans-light.ttf") format("truetype"); font-weight: 300; font-display: swap; }
@font-face { font-family: "xerox-sans"; src: url("../fonts/neu_xeroxsans_reg.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "xerox-sans"; src: url("../fonts/xeroxsans-bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "xerox-sans"; src: url("../fonts/xeroxsans-extrabold.ttf") format("truetype"); font-weight: 800; font-display: swap; }

:root {
  --red: #d61727;
  --red-dark: #b40505;
  --red-soft: rgba(214, 23, 39, .08);
  --red-line: rgba(214, 23, 39, .2);
  --anth: #2d2d2d;
  --dark: #111;
  --text: #222;
  --mid: #555;
  --muted: #6b6b6b;
  --light: #f5f5f5;
  --footer: #f1f1f1;
  --socket: #333;
  --border: #e0e0e0;
  --input: #ccc;
  --surface: #fff;
  --ok: #1e7f4f;
  --ok-soft: #e7f4ec;
  --warn: #8a5a00;
  --warn-soft: #fff5e1;
  --radius: 8px;
  --radius-btn: 5px;
  --font: "xerox-sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--light);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--red); text-decoration: none; }
a:hover { color: var(--red-dark); text-decoration: underline; }

h1, h2, h3, h4 { font-weight: 800; color: var(--dark); letter-spacing: -.01em; }
h1 { font-size: 2rem; margin: 0 0 .6rem; line-height: 1.2; }
h1 span, h2 span { color: var(--red); }
h2, .h3 { font-size: 1.2rem; margin: 0 0 .9rem; line-height: 1.3; }
.h3, .h4 { font-weight: 800; color: var(--dark); }
summary.h3 { margin: 0; }
details[open] > summary.h3 { margin-bottom: 1.25rem; }
.h4 { font-size: 1.02rem; margin: 1.75rem 0 .6rem; }
p { margin: 0 0 .8rem; }
code, .mono { font-family: Consolas, "Cascadia Mono", monospace; font-size: .88em; }
strong { font-weight: 700; }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.inline { display: inline; }

/* Kicker (wie .pld-teaser-fallback-kicker auf x-nrw.de) */
.eyebrow {
  display: flex; gap: .5rem; align-items: center; flex-wrap: wrap;
  font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--red); margin: 0 0 .6rem;
}

/* ---------- Kopfzeile ---------- */

.site-header {
  background: #fff;
  border-top: 4px solid var(--red);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.header-inner {
  max-width: 1200px; margin: 0 auto; padding: .6rem 1.25rem;
  display: flex; align-items: center; gap: 2rem; flex-wrap: wrap; min-height: 72px;
}
.brand { display: flex; align-items: center; gap: .9rem; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-logo { height: 48px; width: auto; display: block; }
.brand-product {
  font-size: 1.05rem; font-weight: 700; color: var(--anth);
  padding-left: .9rem; border-left: 2px solid var(--border); line-height: 1.2;
}
.mainnav { display: flex; gap: 1.6rem; flex-wrap: wrap; align-self: stretch; }
.mainnav a {
  color: var(--anth); font-weight: 700; font-size: .95rem; text-decoration: none;
  display: flex; align-items: center; border-bottom: 3px solid transparent; padding-top: 3px;
}
.mainnav a:hover { color: var(--red); }
.mainnav a.active { color: var(--red); border-bottom-color: var(--red); }
.usermenu { margin-left: auto; display: flex; gap: 1rem; align-items: center; }
.usermenu-name { color: var(--anth); font-weight: 700; }
.usermenu-name.active, .usermenu-name:hover { color: var(--red); }
.header-contact { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.header-contact-label { font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.header-contact a { color: var(--anth); font-weight: 700; }

@media (max-width: 900px) {
  .header-inner { gap: .75rem 1.25rem; }
  .mainnav { order: 3; width: 100%; gap: 1.1rem; overflow-x: auto; }
  .mainnav a { padding: .4rem 0; white-space: nowrap; }
  .brand-logo { height: 40px; }
}
@media (max-width: 520px) {
  .header-contact { display: none; }
  .brand-product { font-size: .95rem; }
}

/* ---------- Layout ---------- */

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 2rem 1.25rem 3rem; flex: 1; }
.container.narrow { max-width: 720px; padding-top: 3.5rem; }

/* Öffentliche Seiten: heller Verlauf + dezente Diagonale aus dem X-Logo */
body.public {
  background: radial-gradient(circle at 50% 30%, #ffffff 0%, #f5f6f8 70%);
  position: relative; overflow-x: hidden;
}
body.public::before, body.public::after {
  content: ""; position: fixed; z-index: -1; pointer-events: none;
  width: 34px; height: 160vh; background: var(--red); opacity: .05;
  transform: rotate(35deg); top: -30vh;
}
body.public::before { right: 12vw; }
body.public::after { right: calc(12vw + 90px); width: 14px; opacity: .04; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.6rem; margin-bottom: 1.5rem;
}
.public .card {
  padding: 2.5rem; border-top: 4px solid var(--red);
  box-shadow: 0 12px 40px rgba(17, 17, 17, .06);
}
@media (max-width: 600px) { .public .card { padding: 1.6rem 1.25rem; } }
.hero { text-align: center; }
.hero .eyebrow, .hero .actions { justify-content: center; }
.lead { font-size: 1.1rem; color: var(--mid); }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head h1 { margin-bottom: .2rem; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.5rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 1.5rem; }
.grid-2.align-start { gap: 1.5rem; align-items: start; margin-bottom: 1.5rem; }
.grid-2.align-start > .card { margin-bottom: 0; }
.align-end { align-self: end; }
@media (max-width: 760px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.message {
  white-space: pre-line; background: var(--light); border-left: 4px solid var(--red);
  padding: 1rem 1.2rem; border-radius: 0 var(--radius) var(--radius) 0; margin: 1.25rem 0 1.5rem;
}

/* ---------- Buttons (wie x-nrw.de: rot, fett, Radius 5px) ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .7rem 1.4rem; border-radius: var(--radius-btn); border: 2px solid var(--anth);
  background: #fff; color: var(--anth); font: inherit; font-size: .95rem; font-weight: 700;
  text-decoration: none; cursor: pointer; white-space: nowrap; line-height: 1.2;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn:hover { background: var(--red); border-color: var(--red); color: #fff; text-decoration: none; }
.btn:focus-visible { outline: 3px solid var(--red-line); outline-offset: 2px; }
.btn:disabled { opacity: .5; cursor: default; background: #fff; color: var(--anth); border-color: var(--anth); }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); border-color: var(--red-dark); color: #fff; }
.btn-primary:disabled { background: var(--red); border-color: var(--red); color: #fff; }
.btn-outline { border-width: 1px; border-color: var(--border); color: var(--anth); }
.btn-danger { color: var(--red); border-color: var(--red-line); }
.btn-danger:hover { background: var(--red); border-color: var(--red); color: #fff; }
.btn-small { padding: .35rem .8rem; font-size: .82rem; border-width: 1px; }
.btn-block { width: 100%; }
.btn-lg { padding: .9rem 1.8rem; font-size: 1.02rem; }
.linkbutton { background: none; border: 0; padding: 0; font: inherit; color: var(--red); cursor: pointer; }
.linkbutton:hover { text-decoration: underline; }

/* ---------- Formulare (Unterstrich-Felder wie auf x-nrw.de) ---------- */

.form label { display: flex; flex-direction: column; gap: .25rem; margin-bottom: 1.25rem; font-weight: 700; font-size: .9rem; color: var(--anth); }
.form-wide { max-width: 900px; }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=date], input[type=search], input:not([type]) {
  font: inherit; font-size: 1rem; font-weight: 400; color: var(--dark);
  padding: .55rem .1rem; width: 100%;
  border: 0; border-bottom: 1px solid var(--input); border-radius: 0; background: transparent;
  transition: border-color .15s, box-shadow .15s;
}
select, textarea {
  font: inherit; font-size: 1rem; font-weight: 400; color: var(--dark);
  padding: .6rem .75rem; width: 100%;
  border: 1px solid var(--input); border-radius: var(--radius-btn); background: #fff;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 1px 0 0 var(--red); }
select:focus, textarea:focus { box-shadow: 0 0 0 1px var(--red); }
input:disabled { color: var(--muted); border-bottom-style: dashed; }
textarea { resize: vertical; }
label.checkbox, .form label.checkbox { flex-direction: row; align-items: center; gap: .6rem; font-weight: 400; font-size: .95rem; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--red); margin: 0; }
.hint { font-size: .82rem; color: var(--muted); font-weight: 400; }
.field-error { color: var(--red); font-size: .85rem; font-weight: 400; }
.form-actions { display: flex; gap: .6rem; margin-top: .5rem; flex-wrap: wrap; }
.form-inline { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; margin-bottom: .9rem; }
.form-inline input { max-width: 280px; }

.filterbar {
  display: flex; gap: .9rem 1.25rem; flex-wrap: wrap; align-items: center;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: .8rem 1.1rem; margin-bottom: 1.25rem;
}
.filterbar input[type=search] { max-width: 320px; flex: 1 1 220px; }
.filterbar select { width: auto; padding: .45rem .6rem; }
.filterbar label.checkbox { margin: 0; }

/* ---------- Hinweise / Badges (Tag-Stil von x-nrw.de) ---------- */

.alert { padding: .9rem 1.1rem; border-radius: var(--radius); margin-bottom: 1.25rem; border: 1px solid transparent; border-left-width: 4px; }
.alert p:last-child { margin-bottom: 0; }
.alert-ok { background: var(--ok-soft); border-color: #bfe0cc; border-left-color: var(--ok); color: #144a2f; }
.alert-warn { background: var(--warn-soft); border-color: #f0d9a8; border-left-color: #d99a00; color: #5e3f00; }
.alert-error { background: var(--red-soft); border-color: var(--red-line); border-left-color: var(--red); color: #7d0f18; }
.alert-error:empty { display: none; }
.alert ul { margin: 0; padding-left: 1.2rem; }

.badge {
  display: inline-block; font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  padding: .2rem .6rem; border-radius: 999px; border: 1px solid var(--border); background: var(--light); color: var(--mid);
  white-space: nowrap;
}
.badge-ok { background: var(--ok-soft); border-color: #bfe0cc; color: var(--ok); }
.badge-warn { background: var(--warn-soft); border-color: #f0d9a8; color: var(--warn); }
.badge-muted { background: var(--light); color: var(--muted); }
.badge-down { background: var(--red-soft); border-color: var(--red-line); color: var(--red); }
.badge-up { background: #2d2d2d; border-color: #2d2d2d; color: #fff; }

.ok-text { color: var(--ok); }
.warn-text { color: var(--warn); }
.error-text { color: var(--red); }

/* ---------- Tabellen ---------- */

.table-wrap { overflow-x: auto; }
.internal .table-wrap:not(.card .table-wrap) { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); background: var(--light); border-bottom: 1px solid var(--border);
}
.table th, .table td { padding: .7rem .8rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafafa; }
.table td a strong { color: var(--dark); }
.table td a:hover strong { color: var(--red); }
.table-compact td { padding: .45rem .7rem; font-size: .88rem; }
.row-muted td { color: var(--muted); }
.empty { padding: 3rem 1rem; text-align: center; background: #fff; border: 1px dashed var(--input); border-radius: var(--radius); }
.hash-short { color: var(--muted); }

/* ---------- Link-Box ---------- */

.linkbox { display: flex; gap: .6rem; margin-bottom: 1rem; align-items: stretch; }
.linkbox input {
  flex: 1; min-width: 0; border: 1px solid var(--input); border-radius: var(--radius-btn);
  padding: .6rem .8rem; background: var(--light); font-size: .92rem;
}
@media (max-width: 600px) { .linkbox { flex-wrap: wrap; } }

details > summary { cursor: pointer; }
details > summary::marker { color: var(--red); }
.mail-details { margin-top: .75rem; }
.mail-details > summary { font-weight: 700; color: var(--red); }
.mail-options { margin-top: 1rem; }

/* ---------- Kunden-Downloadliste ---------- */

.file-cards { list-style: none; margin: 1.5rem 0; padding: 0; display: flex; flex-direction: column; gap: .8rem; }
.file-card {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.file-card:hover { border-color: var(--red-line); box-shadow: 0 4px 16px rgba(214, 23, 39, .06); }
.file-icon {
  flex: 0 0 44px; height: 44px; border-radius: var(--radius); display: grid; place-items: center;
  background: var(--red-soft); color: var(--red);
}
.file-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.file-name { font-weight: 700; color: var(--dark); word-break: break-all; }
.file-meta { color: var(--muted); font-size: .88rem; }
.hash summary { font-size: .78rem; color: var(--muted); margin-top: .2rem; }
.hash code { font-size: .74rem; word-break: break-all; color: var(--muted); }
@media (max-width: 560px) {
  .file-card { flex-wrap: wrap; }
  .file-card .btn { width: 100%; }
}

.plain-list { padding-left: 1.2rem; margin: 0 0 1rem; }
.plain-list li::marker { color: var(--red); }

.meta-line { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; color: var(--muted); font-size: .88rem; border-top: 1px solid var(--border); padding-top: 1rem; margin-top: 1.5rem; }
.meta-line span { display: inline-flex; align-items: center; gap: .35rem; }
.meta-line svg { color: var(--red); }
.meta-line + p { margin-top: .75rem; }

/* ---------- Uploader ---------- */

.uploader { margin: 1.25rem 0; }
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: .3rem;
  border: 2px dashed var(--input); border-radius: var(--radius); padding: 2.25rem 1rem;
  background: #fff; cursor: pointer; text-align: center; transition: background .15s, border-color .15s;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--red); background: var(--red-soft); }
.dropzone:focus { outline: none; border-color: var(--red); }
.dropzone-icon {
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: var(--red); color: #fff; margin-bottom: .5rem;
}
.dropzone-title { font-weight: 800; font-size: 1.1rem; color: var(--dark); }
.dropzone-sub { color: var(--muted); }
.dropzone-sub u { color: var(--red); text-decoration: none; font-weight: 700; }

.upload-list { list-style: none; padding: 0; margin: 1rem 0; display: flex; flex-direction: column; gap: .6rem; }
.upload-item { border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem 1rem; background: #fff; }
.upload-item.is-done { border-color: #bfe0cc; }
.upload-item.is-error { border-color: var(--red-line); }
.upload-row { display: flex; gap: .75rem; align-items: baseline; }
.upload-name { font-weight: 700; flex: 1; word-break: break-all; }
.upload-size { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.upload-remove { text-decoration: none; color: var(--muted); }
.upload-remove:hover { color: var(--red); text-decoration: none; }
.progress { height: 6px; background: var(--light); border-radius: 999px; overflow: hidden; margin: .5rem 0 .35rem; }
.progress-bar { height: 100%; width: 0; background: var(--red); transition: width .2s linear; }
.is-done .progress-bar { background: var(--ok); }
.uploader-actions { display: flex; gap: .6rem; margin-bottom: 1rem; flex-wrap: wrap; }
.note-field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: 1rem; font-weight: 700; font-size: .9rem; }

/* ---------- 2FA ---------- */

.qr { display: block; width: 200px; height: 200px; image-rendering: pixelated; border: 1px solid var(--border); border-radius: var(--radius); margin: .5rem 0 1rem; }
.steps { padding-left: 1.2rem; margin: 0 0 .5rem; }
.steps li::marker { color: var(--red); font-weight: 800; }

/* ---------- Fußzeile (wie x-nrw.de: hellgrau + dunkler Socket) ---------- */

.site-footer { margin-top: auto; font-size: .9rem; }
.footer-main { background: var(--footer); color: var(--text); border-top: 1px solid var(--border); }
.footer-socket { background: var(--socket); color: #eee; font-size: .82rem; }
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 2rem 1.25rem; display: flex; gap: 2rem 3.5rem; flex-wrap: wrap; }
.footer-socket .footer-inner { padding: .9rem 1.25rem; justify-content: space-between; align-items: center; gap: .75rem 2rem; }
.footer-brand { flex: 1 1 260px; }
.footer-brand p { color: var(--mid); margin-top: .8rem; max-width: 280px; }
.footer-logo { height: 40px; width: auto; display: block; }
.footer-col { flex: 0 1 280px; color: var(--mid); }
.footer-col p { margin: 0 0 .4rem; }
.footer-heading { font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--dark) !important; margin-bottom: .6rem !important; }
.socket-links { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.socket-links a { color: #eee; }
.socket-links a:hover { color: #fff; }
.internal .footer-main { display: none; }
