/* Napadano - Schwarz, Weiß, Chrom. */

:root {
  color-scheme: dark;
  --schwarz: #000000;
  --tief: #050609;
  --karte-1: #0e1015;
  --karte-2: #08090d;
  --feld: #111318;
  --linie: #1e2128;
  --linie-hell: #333842;
  --text: #f4f6f9;
  --muted: #878e9b;
  --leise: #5d646f;

  /* Chrom-Verlauf: Licht oben, harte Kante in der Mitte, Reflex unten */
  --chrom: linear-gradient(180deg, #ffffff 0%, #dde3ec 34%, #98a1b0 50%,
                           #f0f4f9 62%, #6f7784 88%, #b9c1cd 100%);
  --chrom-weich: linear-gradient(180deg, #e9edf3 0%, #aab2c0 52%, #d7dde5 100%);
  --chrom-linie: linear-gradient(90deg, transparent, #4a515c 18%, #dfe5ee 50%,
                                 #4a515c 82%, transparent);
  --radius: 14px;
  --safe: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--schwarz);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, sans-serif;
  padding-bottom: calc(74px + var(--safe));
  /* sehr leichter Lichtschein von oben, damit Schwarz nicht tot wirkt */
  background-image: radial-gradient(120% 60% at 50% -10%, #14171d 0%, #000 62%);
  background-attachment: fixed;
}
a { color: inherit; }
h1 { font-size: 22px; margin: 0 0 2px; letter-spacing: -.01em; }
h2 {
  font-size: 13px; margin: 0 0 12px; text-transform: uppercase;
  letter-spacing: .14em; font-weight: 600; color: var(--muted);
}
h3 {
  font-size: 12px; margin: 0 0 8px; text-transform: uppercase;
  letter-spacing: .12em; color: var(--leise); font-weight: 600;
}
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.right { margin-left: auto; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack { display: grid; gap: 10px; }

/* Chrom-Schrift und Chrom-Trenner ------------------------------------- */
.chrom {
  background: var(--chrom); -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
}
.chrom-linie { height: 1px; background: var(--chrom-linie); opacity: .55; margin: 12px 0; }

/* Kopf ----------------------------------------------------------------- */
header.top {
  position: sticky; top: 0; z-index: 20;
  background: var(--schwarz);
  border-bottom: 1px solid var(--linie);
  padding: max(12px, env(safe-area-inset-top)) 16px 12px;
  display: flex; align-items: center; gap: 12px;
}
header.top::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: var(--chrom-linie); opacity: .45;
}
.brand {
  letter-spacing: .3em; text-transform: uppercase; font-size: 10px;
  background: var(--chrom-weich); -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
}
.kopf-marke { display: block; height: 11px; width: auto; opacity: .92; margin-bottom: 3px; }
#kopf-titel { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
main { padding: 16px; max-width: 900px; margin: 0 auto; }

.gespeichert {
  display: block; font-size: 11px; color: var(--muted); margin-top: 1px;
  opacity: 0; transition: opacity .25s; min-height: 14px; letter-spacing: .04em;
}
.gespeichert.an { opacity: 1; }
.gespeichert::before { content: '✓ '; color: #dfe5ee; }

/* Navigation ------------------------------------------------------------ */
nav.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: rgba(4, 5, 7, .96); backdrop-filter: blur(14px);
  border-top: 1px solid var(--linie);
  padding: 8px 6px calc(8px + var(--safe));
}
nav.tabs::before {
  content: ''; position: absolute; left: 0; right: 0; top: -1px; height: 1px;
  background: var(--chrom-linie); opacity: .4;
}
nav.tabs button {
  background: none; border: 0; color: var(--leise); font-size: 11px;
  display: grid; gap: 3px; justify-items: center; padding: 4px; cursor: pointer;
  letter-spacing: .04em;
}
nav.tabs button .ico { font-size: 18px; line-height: 1; }
nav.tabs button.active {
  background: var(--chrom-weich); -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
}

/* Karten ---------------------------------------------------------------- */
.card {
  background: linear-gradient(180deg, var(--karte-1), var(--karte-2));
  border: 1px solid var(--linie);
  border-radius: var(--radius); padding: 15px; margin-bottom: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .045), 0 12px 28px rgba(0, 0, 0, .55);
  position: relative;
}
.card.tight { padding: 12px 14px; }
.card.link, .link { cursor: pointer; }
.card.link:active { border-color: var(--linie-hell); }
.grid2 { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat {
  background: linear-gradient(180deg, var(--karte-1), var(--karte-2));
  border: 1px solid var(--linie); border-radius: var(--radius); padding: 13px 15px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .045);
}
.stat b {
  display: block; font-size: 23px; font-weight: 650; letter-spacing: -.02em;
  background: var(--chrom); -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
}
.stat span {
  color: var(--leise); font-size: 11px; text-transform: uppercase; letter-spacing: .1em;
}

/* Formulare ------------------------------------------------------------- */
label {
  display: block; font-size: 11px; color: var(--leise); margin: 0 0 5px;
  text-transform: uppercase; letter-spacing: .09em;
}
input, textarea, select {
  width: 100%; background: var(--feld); color: var(--text);
  border: 1px solid var(--linie); border-radius: 10px; padding: 10px 12px;
  font: inherit; font-size: 16px;                 /* 16px verhindert Zoom auf iOS */
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .55);
}
textarea { min-height: 74px; resize: vertical; }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: #6d7684;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .55), 0 0 0 3px rgba(200, 210, 225, .09);
}
.field { margin-bottom: 11px; }
.fields { display: grid; gap: 11px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

button.btn {
  background: var(--chrom-weich); color: #0a0b0e; border: 1px solid #767e8b;
  border-radius: 10px; padding: 10px 17px; font: inherit; font-weight: 650;
  cursor: pointer; letter-spacing: .01em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85),
              inset 0 -1px 0 rgba(0, 0, 0, .28), 0 2px 6px rgba(0, 0, 0, .5);
}
button.btn:hover { filter: brightness(1.07); }
button.btn:active { filter: brightness(.94); }
button.btn.ghost {
  background: linear-gradient(180deg, #16181e, #0d0f13); color: var(--text);
  border: 1px solid var(--linie-hell); font-weight: 500;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}
button.btn.danger {
  background: linear-gradient(180deg, #16181e, #0d0f13); color: #c9d0da;
  border: 1px solid #3c333a; font-weight: 500; box-shadow: none;
}
button.btn.danger:hover { color: #fff; border-color: #6a5560; }
button.btn.mini { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
button.btn:disabled { opacity: .45; cursor: default; filter: none; }

.pill {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px;
  background: #101318; border: 1px solid var(--linie-hell); color: var(--muted);
  letter-spacing: .05em;
}
.pill.ok { color: #0a0b0e; background: var(--chrom-weich); border-color: #7d858f; font-weight: 600; }
.pill.warn { color: #f4f6f9; border-color: #6d7684; background: #171a20; }

/* Unterreiter ----------------------------------------------------------- */
.subtabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 14px; padding-bottom: 2px; }
.subtabs button {
  white-space: nowrap; background: linear-gradient(180deg, #101318, #0a0c10);
  border: 1px solid var(--linie); color: var(--muted); border-radius: 999px;
  padding: 7px 15px; font: inherit; font-size: 13px; cursor: pointer;
  letter-spacing: .02em;
}
.subtabs button.active {
  background: var(--chrom-weich); color: #0a0b0e; border-color: #7d858f; font-weight: 650;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
}

.item { display: flex; gap: 10px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--linie); }
.item:last-child { border-bottom: 0; }
.item .grow { flex: 1; min-width: 0; }
.item .grow > div { overflow-wrap: anywhere; }

.drop {
  border: 1px dashed var(--linie-hell); border-radius: var(--radius); padding: 20px;
  text-align: center; color: var(--muted); cursor: pointer;
  background: linear-gradient(180deg, #0c0e12, #08090c);
}
.drop.over { border-color: #cfd6e0; color: var(--text); background: #121519; }
progress { width: 100%; height: 6px; accent-color: #cfd6e0; }

/* Anmeldung ------------------------------------------------------------- */
.login {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  position: relative; overflow: hidden;
}
/* das Logo gross und leise im Hintergrund */
.login::before {
  content: ''; position: absolute; inset: 0;
  background: url('/static/wortmarke.png') center 38% / min(86%, 620px) auto no-repeat;
  opacity: .06; filter: blur(1.5px); pointer-events: none;
}
.login::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(70% 50% at 50% 42%, rgba(255, 255, 255, .07), transparent 70%);
}
.login-karte {
  position: relative; z-index: 1; width: min(380px, 100%);
  background: linear-gradient(180deg, rgba(19, 22, 27, .94), rgba(7, 8, 11, .96));
  border: 1px solid var(--linie-hell); border-radius: 20px; padding: 30px 26px 26px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .09), 0 30px 70px rgba(0, 0, 0, .8);
  backdrop-filter: blur(8px);
}
.login-karte .wortmarke { display: block; width: 78%; margin: 0 auto 6px; }
.login-karte .unterzeile {
  text-align: center; font-size: 10px; letter-spacing: .34em; text-transform: uppercase;
  color: var(--leise); margin-bottom: 4px;
}
.login-karte .field { margin-top: 16px; }
.login-karte button.btn { width: 100%; margin-top: 14px; padding: 12px; }
.login-fehler { color: #e6ebf2; font-size: 13px; margin: 12px 0 0; text-align: center; }
.rechtsfuss {
  text-align: center; font-size: 11px; color: var(--leise); margin: 16px 0 0;
  letter-spacing: .04em;
}
.rechtsfuss a { color: var(--muted); text-decoration: none; }
.rechtsfuss a:hover { color: var(--text); }

.card.hinweis {
  border-color: #4b515e; display: flex; gap: 12px; align-items: center;
  flex-wrap: wrap; font-size: 14px;
  background: linear-gradient(180deg, #181b21, #0d0f14);
}
.card.hinweis button { margin-left: auto; }

#konto { display: flex; align-items: center; gap: 8px; }
#konto select {
  width: auto; padding: 6px 10px; font-size: 13px; border-radius: 8px;
  background: linear-gradient(180deg, #14171d, #0b0d11); max-width: 46vw;
}
#konto .wer { font-size: 11px; color: var(--leise); letter-spacing: .05em; }
@media (max-width: 759px) {
  header.top { flex-wrap: wrap; }
  #konto { width: 100%; margin-top: 8px; }
  #konto select { flex: 1; max-width: none; }
}

code.zugang {
  font: 600 17px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .16em; padding: 8px 14px; border-radius: 9px;
  background: linear-gradient(180deg, #14171d, #0b0d11); border: 1px solid var(--linie-hell);
  background-clip: padding-box; color: #e9edf3;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07);
}

.punkte { display: flex; justify-content: center; gap: 6px; margin-top: 18px; }
.punkte i {
  width: 4px; height: 4px; border-radius: 50%; background: var(--chrom-weich);
  opacity: .5; display: block;
}
.punkte i:nth-child(2) { opacity: .8; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(86px + var(--safe));
  background: linear-gradient(180deg, #16181e, #0b0d11); border: 1px solid var(--linie-hell);
  color: var(--text); padding: 10px 17px; border-radius: 999px; font-size: 13px; z-index: 50;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .75), inset 0 1px 0 rgba(255, 255, 255, .07);
}

@media (min-width: 760px) {
  body { padding-bottom: 24px; }
  nav.tabs {
    position: static; grid-auto-columns: max-content;
    background: none; border: 0; padding: 0; gap: 4px; backdrop-filter: none;
  }
  nav.tabs::before { display: none; }
  nav.tabs button {
    flex-direction: row; display: flex; gap: 7px; align-items: center;
    font-size: 14px; padding: 7px 14px; border-radius: 999px;
  }
  nav.tabs button.active {
    background: var(--chrom-weich); color: #0a0b0e; -webkit-text-fill-color: #0a0b0e;
    font-weight: 600; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
  }
  nav.tabs button .ico { font-size: 14px; }
}
