/* =====================================================================
   PNdoc – Basis-Stylesheet (Frontend + gemeinsame Komponenten)
   ===================================================================== */

/* ---------- Schrift: Exo 2 (lokal) ---------- */
@font-face { font-family: 'Exo 2'; font-style: normal; font-weight: 300; font-display: swap;
  src: url('/fonts/exo-2-v20-latin-ext_latin-300.woff2') format('woff2'), url('/fonts/exo-2-v20-latin-ext_latin-300.woff') format('woff'); }
@font-face { font-family: 'Exo 2'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/fonts/exo-2-v20-latin-ext_latin-regular.woff2') format('woff2'), url('/fonts/exo-2-v20-latin-ext_latin-regular.woff') format('woff'); }
@font-face { font-family: 'Exo 2'; font-style: italic; font-weight: 400; font-display: swap;
  src: url('/fonts/exo-2-v20-latin-ext_latin-italic.woff2') format('woff2'), url('/fonts/exo-2-v20-latin-ext_latin-italic.woff') format('woff'); }
@font-face { font-family: 'Exo 2'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('/fonts/exo-2-v20-latin-ext_latin-500.woff2') format('woff2'), url('/fonts/exo-2-v20-latin-ext_latin-500.woff') format('woff'); }
@font-face { font-family: 'Exo 2'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('/fonts/exo-2-v20-latin-ext_latin-600.woff2') format('woff2'), url('/fonts/exo-2-v20-latin-ext_latin-600.woff') format('woff'); }
@font-face { font-family: 'Exo 2'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('/fonts/exo-2-v20-latin-ext_latin-700.woff2') format('woff2'), url('/fonts/exo-2-v20-latin-ext_latin-700.woff') format('woff'); }
@font-face { font-family: 'Exo 2'; font-style: normal; font-weight: 800; font-display: swap;
  src: url('/fonts/exo-2-v20-latin-ext_latin-800.woff2') format('woff2'), url('/fonts/exo-2-v20-latin-ext_latin-800.woff') format('woff'); }

/* ---------- Design-Tokens ---------- */
:root {
  --primary: #ffa300;
  --primary-600: #e69200;
  --primary-700: #c77e00;
  --primary-50: #fff6e5;
  --primary-100: #ffe9bf;
  --accent: #932e24;
  --ink: #1f1f1f;
  --ink-2: #3c3c3b; 
  --muted: #6b6f76;
  --line: #e4e6ea;
  --line-2: #eef0f3;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --ok: #1f8a4c;
  --ok-50: #e7f6ee;
  --warn: #b26a00;
  --warn-50: #fff4e0;
  --danger: #c0352b;
  --danger-50: #fdecea;
  --info: #2d5e8a;
  --info-50: #e9f1f9;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(20, 20, 20, .05);
  --shadow: 0 1px 3px rgba(20, 20, 20, .06), 0 6px 24px rgba(20, 20, 20, .06);
  --font: 'Exo 2', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.55; color: var(--ink);
  background: var(--bg); -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--ink-2); text-decoration-color: var(--primary); text-underline-offset: 3px; }
a:hover { color: var(--primary-700); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); }
h2 { font-size: 1.2rem; }
p { margin: 0 0 .75rem; }
small { font-size: .82rem; }
.block { display: block; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: .9em; }
.big { font-size: 1.25rem; font-weight: 600; letter-spacing: .04em; }
.break { word-break: break-all; }
.nowrap { white-space: nowrap; }
.label { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 .15rem; font-weight: 600; }
.hint { font-size: .85rem; color: var(--muted); margin: .5rem 0 0; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

.icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.icon.flip { transform: rotate(180deg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: inherit; font-weight: 600; font-size: .95rem; line-height: 1;
  padding: .75rem 1.15rem; border-radius: 999px; border: 1.5px solid transparent;
  cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #1b1300; box-shadow: 0 2px 8px rgba(255, 163, 0, .3); }
.btn-primary:hover { background: var(--primary-600); color: #1b1300; }
.btn-ghost { background: var(--surface); color: var(--ink-2); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--primary); color: var(--ink); background: var(--primary-50); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: #f1c4bf; }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-sm { padding: .5rem .85rem; font-size: .85rem; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.inline-form { display: inline-flex; align-items: center; gap: .5rem; margin: 0; }

/* ---------- Topbar (Frontend) ---------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar::before { content: ''; display: block; height: 4px; background: linear-gradient(90deg, var(--primary), var(--primary) 70%, var(--accent)); }
.topbar-inner { max-width: 1100px; margin: 0 auto; padding: .8rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.topbar-inner.narrow, .page.narrow, .footer-inner.narrow { max-width: 860px; }
.brand { display: flex; align-items: center; gap: .9rem; text-decoration: none; color: var(--ink); min-width: 0; }
.brand-logo { height: 24px; width: auto; }
.brand-app { font-weight: 300; font-size: 1.3rem; letter-spacing: .02em; color: var(--ink-2); padding-left: .9rem; border-left: 1px solid var(--line); line-height: 1; }
.brand-app b { font-weight: 700; color: var(--primary); }
.topbar-actions { display: flex; align-items: center; gap: .6rem; }
.who { display: inline-flex; align-items: center; gap: .35rem; color: var(--muted); font-size: .88rem; max-width: 220px; }
.who-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.lang-switch { display: inline-flex; background: var(--bg); border-radius: 999px; padding: 3px; border: 1px solid var(--line); }
.lang-switch a { text-decoration: none; font-weight: 600; font-size: .8rem; padding: .35rem .7rem; border-radius: 999px; color: var(--muted); }
.lang-switch a.active { background: var(--ink-2); color: #fff; }

/* ---------- Seite ---------- */
.page { max-width: 1100px; margin: 0 auto; padding: 2rem 1.25rem 3rem; display: flex; flex-direction: column; gap: 1.25rem; }
/* Sticky Footer: Footer bei wenig Inhalt immer am unteren Bildschirmrand */
body.public { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
body.public > .page { flex: 1 0 auto; width: 100%; }
body.public > .footer { flex-shrink: 0; }
.footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner { max-width: 1100px; margin: 0 auto; padding: 1.25rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem; font-size: .85rem; color: var(--muted); }
.footer-links { display: flex; gap: 1rem; }
.footer-links a { color: var(--muted); }

/* ---------- Karten ---------- */
.card, .hero-card, .auth-card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem;
  border: 1px solid var(--line-2);
}
.card-title { display: flex; align-items: center; gap: .55rem; font-size: 1.1rem; margin-bottom: 1rem; }
.card-title .icon { color: var(--primary-600); }

.hero-card { padding: 2rem; position: relative; overflow: hidden; }
.hero-card::after {
  content: ''; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 163, 0, .16), rgba(255, 163, 0, 0) 70%); pointer-events: none;
}
.hero-card.center { text-align: center; display: flex; flex-direction: column; align-items: center; }
.hero-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.hero-head h1 { margin: 0; }
.hero-icon {
  width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; flex: none;
  background: var(--primary-50); color: var(--primary-700); margin-bottom: .25rem;
}
.hero-icon .icon { width: 28px; height: 28px; }
.hero-icon-danger { background: var(--danger-50); color: var(--danger); }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 700; color: var(--primary-700); margin: 0 0 .2rem; }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 560px; }
.description { font-size: 1.05rem; color: var(--ink-2); white-space: pre-line; margin-bottom: 1.25rem; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .75rem; margin: 0; }
.fact { display: flex; gap: .75rem; align-items: flex-start; background: var(--bg); border-radius: var(--radius-sm); padding: .9rem 1rem; }
.fact > .icon { color: var(--primary-600); margin-top: .2rem; }
.fact dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.fact dd { margin: 0; font-weight: 600; font-size: 1.05rem; }
.fact-locked { background: repeating-linear-gradient(-45deg, var(--bg), var(--bg) 8px, #eceef1 8px, #eceef1 16px); }
.fact-locked dd { color: var(--muted); font-weight: 500; font-size: .9rem; }
.fact-locked > .icon { color: var(--muted); }

/* ---------- Hinweis Login ---------- */
.notice {
  display: flex; gap: 1rem; align-items: flex-start; padding: 1.25rem 1.5rem; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary-50), #fff); border: 1px solid var(--primary-100);
}
.notice > .icon { width: 28px; height: 28px; color: var(--primary-700); flex: none; }
.notice p { margin-bottom: .75rem; }
.notice-warn { background: var(--warn-50); border-color: #f4d9a8; }

/* ---------- Dokumentliste ---------- */
.doc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.doc { display: flex; align-items: center; gap: 1rem; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-sm); transition: border-color .15s, box-shadow .15s; }
.doc:hover { border-color: var(--primary-100); box-shadow: var(--shadow-sm); }
.doc-icon {
  width: 44px; height: 52px; border-radius: 8px; flex: none; display: grid; place-items: center;
  background: var(--accent); color: #fff; font-weight: 800; font-size: .72rem; letter-spacing: .05em;
  clip-path: polygon(0 0, 72% 0, 100% 20%, 100% 100%, 0 100%);
}
.doc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.doc-title { font-weight: 600; color: var(--ink); text-decoration: none; word-break: break-word; }
.doc-meta { font-size: .82rem; color: var(--muted); }
.doc-actions { display: flex; gap: .4rem; flex: none; }
.badge-lock { display: inline-flex; color: var(--primary-700); margin-left: .25rem; }

.link-list { list-style: none; margin: 0; padding: 0; }
.link-list li + li { border-top: 1px solid var(--line-2); }
.link-list a { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem .25rem; text-decoration: none; }
.link-list a span { display: flex; flex-direction: column; }
.link-list small { color: var(--muted); }
.link-list a:hover strong { color: var(--primary-700); }

/* ---------- Formulare ---------- */
.form { display: flex; flex-direction: column; gap: 1rem; }
.field { display: flex; flex-direction: column; gap: .35rem; flex: 1; min-width: 0; }
.field > span { font-size: .85rem; font-weight: 600; color: var(--ink-2); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
  font: inherit; font-size: .95rem; width: 100%; padding: .7rem .85rem; border-radius: var(--radius-sm);
  border: 1.5px solid var(--line); background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(255, 163, 0, .18); }
input[type=file] { font: inherit; font-size: .9rem; }
.field-invalid input, .field-invalid textarea, input.invalid, textarea.invalid { border-color: var(--danger); }

/* ---------- Alerts ---------- */
.alert { display: flex; gap: .75rem; align-items: flex-start; padding: .9rem 1.1rem; border-radius: var(--radius-sm); border: 1px solid; font-size: .95rem; }
.alert > .icon { margin-top: .15rem; }
.alert ul { margin: .35rem 0 0; padding-left: 1.1rem; }
.alert-error { background: var(--danger-50); border-color: #f5c6c1; color: #8a231b; }
.alert-success { background: var(--ok-50); border-color: #bfe5cf; color: #155f35; }
.alert-info { background: var(--info-50); border-color: #c6dbef; color: #1f4466; }

/* ---------- Auth ---------- */
.auth-card { max-width: 440px; width: 100%; margin: 1rem auto; padding: 2rem; }
.auth-card h1 { font-size: 1.5rem; display: flex; align-items: center; gap: .6rem; }
.auth-card h1 .icon { color: var(--primary-600); }
.auth-links { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.25rem; font-size: .9rem; }
.auth-links a { display: inline-flex; align-items: center; gap: .3rem; }

/* ---------- Tags ---------- */
.tag { display: inline-flex; align-items: center; gap: .25rem; font-size: .72rem; font-weight: 700; letter-spacing: .03em; padding: .2rem .55rem; border-radius: 999px; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.tag .icon { width: .95em; height: .95em; }
.tag-primary { background: var(--primary-100); color: #6b4300; }
.tag-ok { background: var(--ok-50); color: var(--ok); }
.tag-off { background: var(--danger-50); color: var(--danger); }
.tag-warn { background: var(--warn-50); color: var(--warn); }
.tag-muted { background: var(--line-2); color: var(--muted); }
.tag-lock { background: var(--primary-50); color: var(--primary-700); }

/* ---------- Responsiv ---------- */
@media (max-width: 640px) {
  .page { padding: 1.25rem .9rem 2rem; }
  .hero-card, .card, .auth-card { padding: 1.2rem; }
  .brand-logo { height: 18px; }
  .brand-app { font-size: 1.05rem; padding-left: .6rem; }
  .who, .topbar-actions .btn span { display: none; }
  .doc { flex-wrap: wrap; }
  .doc-actions { width: 100%; }
  .doc-actions .btn { flex: 1; }
  .hero-head { align-items: flex-start; }
}

/* ---------- Impressum / Datenschutz ---------- */
.legal { padding: 2rem 2.25rem; line-height: 1.65; }
.legal h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin: 0 0 1.25rem; }
.legal h2 { font-size: 1.25rem; margin: 2rem 0 .6rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.legal h1 + h2 { border-top: 0; padding-top: 0; margin-top: 0; }
.legal h3 { font-size: 1.05rem; margin: 1.4rem 0 .4rem; }
.legal p, .legal ul, .legal ol { margin: 0 0 .85rem; }
.legal ul, .legal ol { padding-left: 1.3rem; }
.legal a { color: var(--accent); word-break: break-word; }
@media (max-width: 640px) { .legal { padding: 1.25rem 1.1rem; } }
