/* =====================================================================
 *  dpt-ui.css — gemeinsame Oberfläche für Anmeldung, Einrichtung,
 *  Wiederherstellung, Admin-Panel und das Alarm-Feld im Tracker.
 *
 *  Die Variablen sind identisch zu denen in defi_pool_tracker.html. Eine
 *  zweite Designsprache für die Nebenseiten wäre kein mutiger Entwurf,
 *  sondern ein Bruch.
 * ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Inter:wght@400;500;600&display=swap');

/* Breiten des Lending-Bereichs. An einer Stelle, damit Karten und
   Formulare nicht auseinanderlaufen, wenn jemand eine davon aendert. */
:root {
  --lending-breite: 1100px;   /* Karten, Formulare, Summenleiste */
  --lesebreite: 720px;        /* Fliesstext -- bewusst schmaler */
  --bg: #0B0D10; --surface: #12151A; --surface2: #181C22;
  --border: #262B33; --border-soft: #1D2129;
  --text: #E7E5E0; --text-mid: #ABAFB6; --text-muted: #6B707A;
  --accent: #C9A227; --accent-soft: rgba(201,162,39,.12);
  --pos: #4FAE7A; --pos-soft: rgba(79,174,122,.12);
  --neg: #C9584F; --neg-soft: rgba(201,88,79,.12);
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --sans: 'Inter', -apple-system, system-ui, sans-serif;
}
:root[data-theme="light"] {
  --bg: #F7F6F2; --surface: #FFFFFF; --surface2: #F1EFE9;
  --border: #DCDAD1; --border-soft: #E7E5DD;
  --text: #1A1D22; --text-mid: #4A4F58; --text-muted: #868B94;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 14px; line-height: 1.5;
}

/* ---- zentrierte Karte (Anmeldung, Einrichtung, Wiederherstellung) ---- */

.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.card { width: 100%; max-width: 430px; background: var(--surface);
        border: 1px solid var(--border); border-radius: 10px; padding: 32px; }

.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.brand svg { width: 26px; height: 26px; flex: none; }
.brand strong { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.sub { color: var(--text-muted); font-size: 12.5px; margin: 0 0 26px; }

/* ---- Formulare ---- */

label { display: block; font-size: 12px; font-weight: 500; color: var(--text-mid); margin: 16px 0 6px; }
input[type=text], input[type=password], input[type=email], input[type=number],
select, textarea {
  width: 100%; padding: 9px 11px; background: var(--bg);
  border: 1px solid var(--border); border-radius: 6px; color: var(--text);
  font-family: var(--sans); font-size: 14px;
}
input:focus, select:focus, textarea:focus, button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent);
}
input.mono, .mono { font-family: var(--mono); }
.hint { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

button {
  font-family: var(--sans); font-size: 13.5px; font-weight: 500;
  padding: 9px 16px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface2); color: var(--text); cursor: pointer;
}
button:hover:not(:disabled) { border-color: var(--text-muted); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.primary { width: 100%; margin-top: 24px; background: var(--accent);
                 border-color: var(--accent); color: #0B0D10; font-weight: 600; }
button.danger  { background: var(--neg-soft); border-color: var(--neg); color: var(--neg); }
button.small   { padding: 5px 10px; font-size: 12px; }

.linkrow { margin-top: 18px; text-align: center; }
.linkrow a { color: var(--text-muted); font-size: 12.5px; text-decoration: none;
             border-bottom: 1px solid var(--border); }
.linkrow a:hover { color: var(--accent); }

/* ---- Meldungen ---- */

.msg { margin-top: 18px; padding: 11px 13px; border-radius: 6px; font-size: 13px; display: none; }
.msg.show  { display: block; }
.msg.error { background: var(--neg-soft);    border: 1px solid var(--neg);    color: var(--neg); }
.msg.ok    { background: var(--pos-soft);    border: 1px solid var(--pos);    color: var(--pos); }
.msg.warn  { background: var(--accent-soft); border: 1px solid var(--accent); color: var(--accent); }

/* ---- Wiederherstellungscode ----
   Das einzige Element mit Gewicht. An dieser Stelle entscheidet sich, ob
   jemand seine Daten je wiedersieht. */

.recovery-code {
  background: var(--surface2); border: 1px solid var(--accent);
  border-radius: 8px; padding: 20px; margin: 18px 0;
  font-family: var(--mono); font-size: 13.5px; line-height: 2;
  word-break: break-all; user-select: all;
}
.cap { font-size: 11px; letter-spacing: .09em; text-transform: uppercase;
       color: var(--accent); font-weight: 600; margin-bottom: 10px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0; font-size: 13px; }
.check input { width: auto; margin-top: 3px; flex: none; }
.check label { margin: 0; color: var(--text); font-size: 13px; line-height: 1.5; }

/* ---- Verwaltung ---- */

.shell { max-width: 1180px; margin: 0 auto; padding: 28px 24px 80px; }
header.bar {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding-bottom: 18px; margin-bottom: 26px; border-bottom: 1px solid var(--border);
}
.who { font-size: 12.5px; color: var(--text-muted); font-family: var(--mono); }

h2 { font-size: 13px; font-weight: 600; letter-spacing: .05em;
     text-transform: uppercase; color: var(--text-mid); margin: 34px 0 12px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 11px; font-weight: 500; letter-spacing: .05em;
     text-transform: uppercase; color: var(--text-muted);
     padding: 0 10px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 11px 10px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
td.num, th.num { text-align: right; font-family: var(--mono); font-size: 12.5px; }
tbody tr:hover { background: var(--surface); }
.muted { color: var(--text-muted); }

.pill { display: inline-block; font-size: 11px; font-family: var(--mono);
        padding: 2px 7px; border-radius: 3px; border: 1px solid var(--border); color: var(--text-mid); }
.pill.active  { color: var(--pos);    border-color: var(--pos);    background: var(--pos-soft); }
.pill.locked  { color: var(--neg);    border-color: var(--neg);    background: var(--neg-soft); }
.pill.pending { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.pill.admin   { color: var(--accent); border-color: var(--accent); }

.notice { border-left: 2px solid var(--border); padding-left: 12px;
          font-size: 12px; color: var(--text-muted); line-height: 1.55; margin: 18px 0; }

.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6);
           display: none; place-items: center; padding: 24px; z-index: 50; }
.overlay.show { display: grid; }
.modal { background: var(--surface); border: 1px solid var(--border);
         border-radius: 10px; padding: 26px; width: 100%; max-width: 460px; }
.modal h3 { margin: 0 0 10px; font-size: 16px; font-weight: 600; }
.modal p  { font-size: 13px; color: var(--text-mid); margin: 0 0 8px; }
.row { display: flex; gap: 10px; margin-top: 22px; }
.row button { flex: 1; margin-top: 0; }

@media (max-width: 720px) { .opt { display: none; } .shell { padding: 20px 14px 60px; } }

/* =====================================================================
 *  Alarm-Feld im Tracker (dpt-alerts.js)
 *  Eigenes Präfix, damit nichts mit den Klassen der 11.000 Zeilen
 *  im Tracker kollidiert.
 * ===================================================================== */

.dpt-note { border: 1px solid var(--accent); background: var(--accent-soft);
            border-radius: 8px; padding: 14px 16px; margin-bottom: 20px;
            font-size: 12.5px; line-height: 1.6; }
.dpt-fp { font-family: var(--mono); font-size: 11px; color: var(--text-muted); }

.dpt-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dpt-table th { text-align: left; font-size: 11px; letter-spacing: .05em;
                text-transform: uppercase; color: var(--text-muted);
                padding: 0 10px 8px; border-bottom: 1px solid var(--border); }
.dpt-table td { padding: 10px; border-bottom: 1px solid var(--border-soft); }
.dpt-num { text-align: right; font-family: var(--mono); font-size: 12.5px; }
.dpt-right { text-align: right; white-space: nowrap; }
.dpt-mono { font-family: var(--mono); font-size: 12px; }
.dpt-table small { color: var(--text-muted); font-size: 10.5px; }

.dpt-hf { font-family: var(--mono); }
.dpt-hf.ok   { color: var(--pos); }
.dpt-hf.warn { color: var(--accent); }
.dpt-hf.crit { color: var(--neg); font-weight: 600; }
.dpt-hf.none { color: var(--text-muted); }

.dpt-pill { font-size: 11px; font-family: var(--mono); padding: 2px 7px;
            border-radius: 3px; border: 1px solid var(--border); color: var(--text-muted); }
.dpt-pill.on { color: var(--pos); border-color: var(--pos); background: var(--pos-soft); }

.dpt-mini { padding: 4px 9px; font-size: 11.5px; }
.dpt-mini.danger { background: var(--neg-soft); border-color: var(--neg); color: var(--neg); }
.dpt-primary { margin-top: 18px; background: var(--accent); border-color: var(--accent);
               color: #0B0D10; font-weight: 600; padding: 9px 18px; }

.dpt-empty { text-align: center; padding: 40px 20px; color: var(--text-muted);
             border: 1px dashed var(--border); border-radius: 8px; font-size: 13px; }
.dpt-orphan { color: var(--accent); font-size: 12.5px; }
.dpt-err { color: var(--neg); font-size: 13px; margin: 12px 0; }
.dpt-hint { font-size: 12px; color: var(--text-muted); margin: 6px 0 0; }

.dpt-form { border: 1px solid var(--border); border-radius: 8px;
            padding: 20px; margin-top: 18px; background: var(--surface); }
.dpt-form h4 { margin: 0 0 6px; font-size: 14px; font-weight: 600; }
.dpt-two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.dpt-check { display: flex; gap: 9px; align-items: flex-start; margin-top: 18px;
             color: var(--text); font-size: 13px; font-weight: 400; }
.dpt-check input { width: auto; flex: none; margin-top: 3px; }
.dpt-row { display: flex; gap: 10px; margin-top: 20px; }
.dpt-row button { flex: 1; margin-top: 0; }

/* =====================================================================
 *  Aufklappbare Abschnitte
 *
 *  <details>/<summary> statt selbstgebauter Klapplogik. Der Browser kann
 *  das: Tastaturbedienung, Vorleseprogramme und — der eigentliche Grund —
 *  die Suchfunktion. Strg+F findet Text in einem zugeklappten Abschnitt
 *  und klappt ihn von selbst auf. Eine Eigenbaulösung mit display:none
 *  kann das nicht, und niemand versteht, warum die Suche nichts findet.
 *
 *  Zugeklappt heißt hier NICHT ausgehängt: Die Inhalte stehen im DOM,
 *  nur eingeklappt. Skripte finden ihre Elemente also wie zuvor.
 * ===================================================================== */
.dpt-einstellungen { max-width: 900px; }

.dpt-akk {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  margin-top: 10px;
  overflow: hidden;
}

.dpt-akk > summary {
  cursor: pointer;
  padding: 14px 18px;
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  /* Das voreingestellte Dreieck fällt weg; darunter steht ein eigenes,
     das sich mitdreht. Beide Schreibweisen, sonst bleibt in Safari und
     älteren Chrome-Fassungen das Originaldreieck stehen. */
  list-style: none;
}
.dpt-akk > summary::-webkit-details-marker { display: none; }

.dpt-akk > summary::before {
  content: '';
  flex: none;
  width: 6px; height: 6px;
  margin-right: 2px;
  border-right: 1.6px solid var(--accent);
  border-bottom: 1.6px solid var(--accent);
  transform: rotate(-45deg);
  transition: transform .15s ease;
  position: relative; top: -2px;
}
.dpt-akk[open] > summary::before { transform: rotate(45deg); }

.dpt-akk > summary:hover { background: var(--surface2); }
.dpt-akk > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Ein Halbsatz neben der Überschrift, damit man nicht aufklappen muss,
   um zu wissen, was drin ist. */
.dpt-akk-kurz {
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 400;
  color: var(--text-muted);
  text-align: right;
}

.dpt-akk-inhalt {
  padding: 16px 18px 18px;
  border-top: 1px solid var(--border-soft);
}
/* Der erste Rahmen im Inhalt wäre ein Rahmen im Rahmen. */
.dpt-akk-inhalt > .dpt-form:first-child { margin-top: 0; border: 0; padding: 0; background: none; }

@media (prefers-reduced-motion: reduce) {
  .dpt-akk > summary::before { transition: none; }
}

@media (max-width: 560px) {
  .dpt-akk-kurz { display: none; }
}

@media (max-width: 560px) { .dpt-two { grid-template-columns: 1fr; } }
.dpt-pill.stalled { color: var(--neg); border-color: var(--neg); background: var(--neg-soft); font-weight: 600; }
