/* ==========================================================================
   Mandantenportal – Design abgeleitet vom Auftritt der Kanzlei
   (Anthrazit / Weiss / Markenblau). Keine externen Fonts, keine Tracker.
   ========================================================================== */
:root {
  --ink: #16181c; --ink-soft: #2b2f36; --ink-70: #4a4f57; --ink-50: #6b7079;
  --line: #e4e6ea; --line-soft: #eef0f2;
  --bg: #f6f7f9; --karte: #ffffff; --bg-dark: #16181c;
  --accent: #006db0; --accent-ink: #005a91; --accent-hell: #e8f2f9;
  --ok: #1a7f4e; --ok-hell: #e7f4ed; --warn: #b45309; --warn-hell: #fdf4e7;
  --fehler: #b91c1c; --fehler-hell: #fdeaea;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --wrap: 1080px; --radius: 8px; --radius-lg: 14px; --radius-btn: 12px;
  --shadow: 0 1px 2px rgba(22,24,28,.05), 0 10px 26px rgba(22,24,28,.06);
  --focus-ring: 0 0 0 3px rgba(0,109,176,.22);
}
*, *::before, *::after { box-sizing: border-box; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; } }

body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans);
       font-size: 16.5px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
.wrap { width: min(100% - 2.4rem, var(--wrap)); margin-inline: auto; }
h1 { font-size: clamp(1.7rem, 3.6vw, 2.3rem); letter-spacing: -.02em; margin: 0 0 .35em; }
h2 { font-size: 1.22rem; letter-spacing: -.01em; margin: 0 0 .8rem; }
p { margin: 0 0 1em; color: var(--ink-soft); }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
.klein { font-size: .85rem; color: var(--ink-50); }
.lead { font-size: 1.05rem; color: var(--ink-70); max-width: 62ch; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Kopf ------------------------------------------------------------------ */
.kopf { background: var(--bg-dark); color: #fff; }
.kopf-in { display: flex; align-items: center; justify-content: space-between; gap: 1rem;
           min-height: 62px; flex-wrap: wrap; }
.marke { color: #fff; font-weight: 650; display: inline-flex; align-items: center; gap: .55rem; }
.marke:hover { text-decoration: none; opacity: .85; }
.marke-hut { font-size: 1.15rem; }
.kopf-nav { display: flex; align-items: center; gap: 1rem; font-size: .92rem; }
.kopf-nav a { color: #cfd4da; }
.kopf-nutzer { color: #9aa1aa; max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inhalt { padding: 2.2rem 0 3.5rem; }
.brotkrume { font-size: .9rem; margin-bottom: .8rem; }

/* Karten ---------------------------------------------------------------- */
.karte { background: var(--karte); border: 1px solid var(--line); border-radius: var(--radius-lg);
         padding: 1.4rem 1.5rem; box-shadow: var(--shadow); margin: 0 0 1.4rem; }
.karte-akzent { border-left: 4px solid var(--accent); }
.akten-gitter { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.akte-karte { display: block; color: inherit; transition: transform .18s, box-shadow .18s; }
.akte-karte:hover { text-decoration: none; transform: translateY(-2px);
                    box-shadow: 0 2px 6px rgba(22,24,28,.07), 0 18px 40px rgba(22,24,28,.12); }
.akte-karte h2 { margin: .5rem 0 .2rem; }
.az { color: var(--ink-50); font-size: .9rem; margin: 0 0 .8rem; }
.akte-meta { margin: .6rem 0 0; font-size: .9rem; color: var(--ink-70); }
.akte-kopf { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }

/* Status & Marker ------------------------------------------------------- */
.status { display: inline-block; font-size: .72rem; font-weight: 650; letter-spacing: .06em;
          text-transform: uppercase; padding: .25em .7em; border-radius: 999px;
          background: var(--accent-hell); color: var(--accent-ink); }
.status-abgeschlossen { background: var(--ok-hell); color: var(--ok); }
.status-ruht { background: var(--warn-hell); color: var(--warn); }
.pill { display: inline-block; background: var(--accent); color: #fff; font-size: .74rem;
        font-weight: 600; padding: .15em .6em; border-radius: 999px; margin-left: .35rem; }
.pill-warn { background: var(--warn); }
.marker { display: inline-block; min-width: 4.2rem; text-align: center; font-size: .72rem;
          font-weight: 650; padding: .15em .55em; border-radius: 6px; margin-right: .5rem;
          background: var(--accent-hell); color: var(--accent-ink); }
.marker-frist { background: var(--warn-hell); color: var(--warn); }

/* Fortschritt als <progress> – die CSP lässt keine Inline-Breiten zu. */
.balken { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 7px;
          border: 0; border-radius: 999px; overflow: hidden; margin: .3rem 0 .4rem;
          background: var(--line-soft); color: var(--accent); }
.balken::-webkit-progress-bar { background: var(--line-soft); border-radius: 999px; }
.balken::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
.balken::-moz-progress-bar { background: var(--accent); border-radius: 999px; }

/* Ablauf ---------------------------------------------------------------- */
.schritte { list-style: none; margin: 0; padding: 0; }
.schritte li { position: relative; display: flex; gap: .9rem; padding: 0 0 1.15rem 0; }
.schritte li:not(:last-child)::before { content: ""; position: absolute; left: 8px; top: 20px;
  bottom: 0; width: 2px; background: var(--line); }
.schritt-punkt { flex: 0 0 18px; width: 18px; height: 18px; margin-top: 3px; border-radius: 50%;
  background: #fff; border: 2px solid var(--line); z-index: 1; }
.ist-erledigt .schritt-punkt { background: var(--ok); border-color: var(--ok); }
.ist-aktuell .schritt-punkt { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(0,109,176,.14); }
.ist-erledigt strong { color: var(--ink-70); }
.schritte .klein { display: block; }
.schritte-edit li { align-items: flex-start; }
.schritt-tasten { margin-left: auto; display: flex; gap: .6rem; align-items: center; }

/* Listen & Tabellen ----------------------------------------------------- */
.liste-schlicht { list-style: none; margin: 0; padding: 0; }
.liste-schlicht li { padding: .5rem 0; border-bottom: 1px solid var(--line-soft); }
.liste-schlicht li:last-child { border-bottom: 0; }
.liste-schlicht .klein { margin-left: .4rem; }
.ist-vorbei { opacity: .55; }
.tabelle { width: 100%; border-collapse: collapse; margin: 0 0 1rem; font-size: .95rem; }
.tabelle th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em;
              color: var(--ink-50); border-bottom: 1px solid var(--line); padding: .45rem .5rem; }
.tabelle td { padding: .6rem .5rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tabelle tr:last-child td { border-bottom: 0; }
.tabelle .reihe { display: flex; gap: .6rem; align-items: center; }
.tabelle form { display: inline; }

/* Nachrichten ----------------------------------------------------------- */
.verlauf { display: flex; flex-direction: column; gap: .8rem; margin: 0 0 1.2rem; }
.blase { padding: .8rem 1rem; border-radius: var(--radius-lg); max-width: 46rem; }
.blase p:last-child { margin-bottom: 0; }
.blase-kopf { font-size: .82rem; color: var(--ink-50); margin-bottom: .25rem; }
.blase-kanzlei { background: var(--accent-hell); border: 1px solid #d3e6f3; }
.blase-mandant { background: var(--line-soft); border: 1px solid var(--line); align-self: flex-end; }

/* Formulare ------------------------------------------------------------- */
label { display: block; font-weight: 600; font-size: .9rem; margin: .9rem 0 .3rem; }
input[type=text], input[type=email], input[type=search], input[type=date], input[type=file],
select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff;
  border: 1px solid #cfd4da; border-radius: var(--radius); padding: .62rem .7rem;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
textarea { resize: vertical; }
.check { display: flex; gap: .55rem; align-items: flex-start; font-weight: 400; font-size: .95rem; }
.check input { width: auto; margin-top: .25rem; }
.gitter-form { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.gitter-form .voll { grid-column: 1 / -1; }
.gitter-form button { margin-top: 1rem; }
.upload-form, .nachricht-form { border-top: 1px solid var(--line); margin-top: 1.2rem; padding-top: .4rem; }
.upload-form button, .nachricht-form button { margin-top: .8rem; }
.suche { display: flex; gap: .6rem; align-items: center; margin: 0 0 1.2rem; }
.suche input { max-width: 22rem; }
.zurueck-form { margin-top: .8rem; }

/* Buttons --------------------------------------------------------------- */
.btn { display: inline-block; font: inherit; font-weight: 600; cursor: pointer;
  padding: .62rem 1.15rem; border-radius: var(--radius-btn); border: 1px solid #d3d7dd;
  background: linear-gradient(#ffffff, #f3f5f7); color: var(--ink); box-shadow: 0 1px 0 #fff inset, 0 2px 4px rgba(22,24,28,.07); }
.btn:hover { text-decoration: none; background: linear-gradient(#ffffff, #eceff2); }
.btn:active { transform: translateY(1px); box-shadow: 0 1px 2px rgba(22,24,28,.12) inset; }
.btn-accent { background: linear-gradient(#1f8fd4, #006db0); border-color: #00619c; color: #fff;
              box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 3px 8px rgba(0,109,176,.28); }
.btn-accent:hover { background: linear-gradient(#2d9bde, #00639f); }
.btn-klein { padding: .34rem .7rem; font-size: .86rem; border-radius: 9px; }
.btn-voll { width: 100%; margin-top: 1.1rem; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-size: .86rem;
            color: var(--accent-ink); text-decoration: underline; cursor: pointer; }

/* Hinweise -------------------------------------------------------------- */
.hinweis { padding: .8rem 1rem; border-radius: var(--radius); margin: 0 0 1.2rem;
           border: 1px solid var(--line); background: var(--ok-hell); color: #14603c; }
.hinweis-warn { background: var(--warn-hell); color: #7c3d06; border-color: #f2d9b3; }
.hinweis-fehler { background: var(--fehler-hell); color: var(--fehler); border-color: #f3c9c9; }

/* Anmeldung ------------------------------------------------------------- */
.login-karte { max-width: 30rem; margin: 1rem auto 0; background: var(--karte);
  border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.8rem;
  box-shadow: var(--shadow); }
.code-feld { font-size: 1.7rem; letter-spacing: .5em; text-align: center; font-variant-numeric: tabular-nums; }

/* Fuss ------------------------------------------------------------------ */
.fuss { border-top: 1px solid var(--line); padding: 1.4rem 0 2.4rem; font-size: .85rem; color: var(--ink-50); }
.fuss p { color: inherit; margin: 0 0 .3rem; }
.fuss-links a { margin-right: 1rem; }

@media (max-width: 640px) {
  .inhalt { padding-top: 1.4rem; }
  .karte { padding: 1.1rem; }
  .kopf-in { min-height: 56px; padding: .5rem 0; }
  .tabelle { display: block; overflow-x: auto; }
  .btn-klein { padding: .45rem .8rem; }
  .schritt-tasten { margin-left: 0; width: 100%; }
}

/* Erkannte Termine zur Prüfung ------------------------------------------ */
.karte-pruefen { border-left: 4px solid var(--warn); }
.vorschlag { border: 1px solid var(--line); border-radius: var(--radius-lg);
             padding: .9rem 1.1rem; margin: 0 0 1rem; background: #fcfcfd; }
.vorschlag-kopf { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.vorschlag .zitat { margin: .7rem 0 .2rem; padding-left: .9rem; border-left: 3px solid var(--line);
                    font-style: italic; color: var(--ink-70); }
.vorschlag-tasten { display: flex; gap: .7rem; flex-wrap: wrap; }
.sicherheit { font-size: .74rem; font-weight: 650; padding: .15em .6em; border-radius: 999px;
              background: var(--line-soft); color: var(--ink-70); }
.sicherheit-hoch { background: var(--ok-hell); color: var(--ok); }
.sicherheit-mittel { background: var(--warn-hell); color: var(--warn); }
.sicherheit-niedrig { background: var(--fehler-hell); color: var(--fehler); }

/* Angeforderte Unterlagen ------------------------------------------------- */
.unterlagen { list-style: none; margin: 0 0 .5rem; padding: 0; display: grid; gap: .7rem; }
.unterlagen li { display: flex; gap: .85rem; align-items: center; flex-wrap: wrap;
                 padding: .75rem .9rem; border: 1px solid var(--line); border-radius: var(--radius-lg);
                 background: #fff; }
.unterlagen li.ist-erledigt { background: var(--ok-hell); border-color: #cbe7d8; }
.unterlage-marke { flex: none; width: 22px; height: 22px; border-radius: 50%;
                   border: 2px solid var(--line); display: grid; place-items: center;
                   font-size: .8rem; font-weight: 700; color: #fff; }
.ist-erledigt .unterlage-marke { background: var(--ok); border-color: var(--ok); }
.unterlage-text { flex: 1 1 16rem; min-width: 0; }
.unterlage-text .klein { display: block; }
.unterlage-form { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-left: auto; }
.unterlage-datei { width: auto; max-width: 15rem; font-size: .85rem; padding: .35rem .4rem; }
@media (max-width: 640px) {
  .unterlage-form { margin-left: 0; width: 100%; }
  .unterlage-datei { max-width: none; flex: 1 1 10rem; }
}

/* Zahlungsaufforderung Gerichtskostenvorschuss – bewusst auffällig */
.karte-zahlung { border-left: 4px solid var(--warn); background: var(--warn-hell); border-color: #f2d9b3; }
.karte-zahlung h2 { color: #7c3d06; }
.karte-zahlung p { color: #7c3d06; }
.karte-zahlung .klein { color: #96541a; }

/* Nummerierte Schrittfolge auf hellem Grund (Kontenklärung) */
.portal-schritte-hell { counter-reset: ph; list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .7rem; }
.portal-schritte-hell li { counter-increment: ph; display: flex; gap: .8rem; align-items: flex-start;
                           color: var(--ink-soft); }
.portal-schritte-hell li::before {
  content: counter(ph); flex: none; width: 23px; height: 23px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 700; font-size: .8rem;
  display: grid; place-items: center; margin-top: .1em;
}
#kontenklaerung h3 { font-size: 1.02rem; margin: 1.2rem 0 .5rem; }
#kontenklaerung .portal-hinweis h3 { margin-top: 0; }

/* Akte löschen – bewusst am Ende der Seite und farblich abgesetzt */
.karte-gefahr { border-color: #f3c9c9; background: #fffafa; }
.karte-gefahr h2 { color: var(--fehler); }
.loeschen-form { display: grid; gap: .5rem; max-width: 26rem; margin-top: 1rem; }
.btn-gefahr { background: linear-gradient(#d93a3a, #b91c1c); border-color: #9c1717;
              color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 2px 4px rgba(120,20,20,.25); }
.btn-gefahr:hover { background: linear-gradient(#e04747, #a81919); }
