/* MasAnalyst – dunkler Glassmorphism-Stil (Referenz: Portal / PVMonitor / Swiss1) */

:root {
  --bg1: #0b1120;
  --bg2: #101a30;
  --karte: rgba(255, 255, 255, 0.055);
  --karte-rand: rgba(255, 255, 255, 0.11);
  --karte-hover: rgba(255, 255, 255, 0.09);
  --text: #e8ecf4;
  --text-dim: #93a1b8;
  --text-schwach: #64748b;
  --akzent: #e0453a;          /* Schweizer Rot */
  --plus: #34c98a;
  --minus: #ff5d5d;
  --neutral: #8ea0bd;
  --warn: #f5a623;
  --radius: 14px;
  --schatten: 0 8px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(224, 69, 58, 0.14), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(58, 110, 224, 0.12), transparent 60%),
    linear-gradient(160deg, var(--bg1), var(--bg2));
  background-attachment: fixed;
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 15px;
}

a { color: inherit; }

.hof { max-width: 1320px; margin: 0 auto; padding: 22px 20px 60px; }

/* ------------------------------------------------------------- Kopfbereich */
header.kopf {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  margin-bottom: 18px;
}
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo .kreuz {
  width: 38px; height: 38px; border-radius: 10px; background: var(--akzent);
  position: relative; box-shadow: 0 4px 14px rgba(224, 69, 58, 0.4); flex: 0 0 auto;
}
.logo .kreuz::before, .logo .kreuz::after {
  content: ''; position: absolute; background: #fff; border-radius: 2px;
}
.logo .kreuz::before { width: 20px; height: 6px; left: 9px; top: 16px; }
.logo .kreuz::after  { width: 6px; height: 20px; left: 16px; top: 9px; }
.logo h1 { font-size: 1.35rem; margin: 0; letter-spacing: 0.3px; }
.logo .unter { color: var(--text-dim); font-size: 0.8rem; margin-top: 1px; }

.kopf-rechts { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.status-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--karte); border: 1px solid var(--karte-rand);
  border-radius: 999px; padding: 7px 14px; font-size: 0.8rem; color: var(--text-dim);
  backdrop-filter: blur(10px); text-decoration: none;
}
.status-chip .punkt { width: 9px; height: 9px; border-radius: 50%; background: var(--plus); flex: 0 0 auto; }
.status-chip.cache .punkt { background: var(--warn); }
.status-chip.keine .punkt, .status-chip.fehler .punkt { background: var(--minus); }
a.status-chip:hover { background: var(--karte-hover); color: var(--text); }

/* ------------------------------------------------------------------- Tabs */
nav.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
nav.tabs a {
  border: 1px solid var(--karte-rand); background: var(--karte); color: var(--text-dim);
  padding: 9px 18px; border-radius: 999px; cursor: pointer; font-size: 0.9rem;
  text-decoration: none; backdrop-filter: blur(10px); transition: all 0.15s ease;
}
nav.tabs a:hover { background: var(--karte-hover); color: var(--text); }
nav.tabs a.aktiv {
  background: var(--akzent); border-color: var(--akzent); color: #fff;
  box-shadow: 0 4px 16px rgba(224, 69, 58, 0.35);
}
nav.tabs a.rechts { margin-left: auto; }

/* ------------------------------------------------------------------ Karten */
.karte {
  background: var(--karte); border: 1px solid var(--karte-rand);
  border-radius: var(--radius); padding: 18px 20px;
  backdrop-filter: blur(14px); box-shadow: var(--schatten);
}
.karte + .karte { margin-top: 14px; }
.karte h2 { margin: 0 0 4px; font-size: 1.02rem; font-weight: 600; }
.karte h3 { margin: 18px 0 8px; font-size: 0.9rem; font-weight: 600; color: var(--text-dim); }
.hinweis { color: var(--text-schwach); font-size: 0.78rem; font-weight: 400; }

.raster { display: grid; gap: 14px; }
.raster.kpi { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-bottom: 14px; }
.raster.zwei { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }

.kpi .wert { font-size: 1.6rem; font-weight: 650; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.kpi .neben { font-size: 0.85rem; color: var(--text-dim); }
.kpi .marke { color: var(--text-schwach); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.6px; }

/* ---------------------------------------------------------------- Tabellen */
table.markt { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.markt th {
  text-align: right; color: var(--text-schwach); font-weight: 500; font-size: 0.75rem;
  text-transform: uppercase; letter-spacing: 0.6px; padding: 8px 10px;
  border-bottom: 1px solid var(--karte-rand); white-space: nowrap;
}
table.markt th:first-child, table.markt td:first-child { text-align: left; }
table.markt td {
  padding: 9px 10px; text-align: right; border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.9rem;
}
table.markt tbody tr.klickbar { cursor: pointer; transition: background 0.12s; }
table.markt tbody tr:hover { background: rgba(255, 255, 255, 0.05); }
table.markt td a { text-decoration: none; }
table.markt td a:hover { text-decoration: underline; }
.tabellen-halter { overflow-x: auto; }
.titel-name { font-weight: 600; }
.titel-sub { color: var(--text-schwach); font-size: 0.75rem; }

.plus  { color: var(--plus); }
.minus { color: var(--minus); }
.neutral { color: var(--neutral); }
.dim { color: var(--text-schwach); }

.badge {
  display: inline-block; padding: 3px 11px; border-radius: 999px;
  font-size: 0.76rem; font-weight: 600; white-space: nowrap;
}
.badge.kaufen        { background: rgba(52, 201, 138, 0.16); color: var(--plus);  border: 1px solid rgba(52, 201, 138, 0.4); }
.badge.eher-kaufen   { background: rgba(52, 201, 138, 0.09); color: #7ed9b2;      border: 1px solid rgba(52, 201, 138, 0.25); }
.badge.halten        { background: rgba(142, 160, 189, 0.12); color: var(--neutral); border: 1px solid rgba(142, 160, 189, 0.3); }
.badge.eher-verkaufen{ background: rgba(255, 93, 93, 0.09);  color: #ff9b9b;      border: 1px solid rgba(255, 93, 93, 0.25); }
.badge.verkaufen     { background: rgba(255, 93, 93, 0.16);  color: var(--minus); border: 1px solid rgba(255, 93, 93, 0.4); }

/* Risikostufe 1–5 */
.risiko {
  display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem;
  font-weight: 600; white-space: nowrap;
}
.risiko .punkte { display: inline-flex; gap: 2px; }
.risiko .punkte i {
  width: 6px; height: 12px; border-radius: 2px; background: rgba(255, 255, 255, 0.14);
  display: inline-block;
}
.risiko.s1 { color: #34c98a; } .risiko.s1 .punkte i:nth-child(-n+1) { background: #34c98a; }
.risiko.s2 { color: #7ed9b2; } .risiko.s2 .punkte i:nth-child(-n+2) { background: #7ed9b2; }
.risiko.s3 { color: #d9c271; } .risiko.s3 .punkte i:nth-child(-n+3) { background: #d9c271; }
.risiko.s4 { color: #f5a623; } .risiko.s4 .punkte i:nth-child(-n+4) { background: #f5a623; }
.risiko.s5 { color: var(--minus); } .risiko.s5 .punkte i { background: var(--minus); }
.risiko.leer { color: var(--text-schwach); }

/* Score-Balken */
.score-balken {
  position: relative; height: 8px; width: 110px; border-radius: 4px;
  background: rgba(255, 255, 255, 0.09); display: inline-block; vertical-align: middle;
}
.score-balken .mitte { position: absolute; left: 50%; top: -2px; width: 1px; height: 12px; background: rgba(255, 255, 255, 0.25); }
.score-balken .fuellung { position: absolute; top: 0; height: 100%; border-radius: 4px; }

/* Konfidenz-Balken */
.konfidenz { display: inline-block; width: 70px; height: 6px; border-radius: 3px; background: rgba(255,255,255,0.1); vertical-align: middle; position: relative; }
.konfidenz span { position: absolute; left: 0; top: 0; height: 100%; border-radius: 3px; background: var(--neutral); }

/* --------------------------------------------------------------- Steuerung */
.steuerzeile { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.steuerzeile label { color: var(--text-dim); font-size: 0.85rem; }
.steuerzeile .rechts { margin-left: auto; }

select.auswahl, input.feld, textarea.feld, .knopfgruppe a, .knopfgruppe button, button.knopf {
  background: var(--karte); border: 1px solid var(--karte-rand); color: var(--text);
  border-radius: 9px; padding: 8px 12px; font-family: inherit; font-size: 0.88rem;
  cursor: pointer; text-decoration: none; display: inline-block;
}
input.feld, textarea.feld { cursor: text; }
input.feld:focus, select.auswahl:focus, textarea.feld:focus { outline: 1px solid var(--akzent); }
select.auswahl option { background: var(--bg2); }
.knopfgruppe { display: flex; gap: 6px; flex-wrap: wrap; }
.knopfgruppe a.aktiv, .knopfgruppe button.aktiv, button.knopf.haupt {
  background: var(--akzent); border-color: var(--akzent); color: #fff;
}
button.knopf:hover, .knopfgruppe a:hover { background: var(--karte-hover); }
button.knopf.haupt:hover { background: #c93a30; }

.diagramm-halter { position: relative; width: 100%; height: 420px; }
.diagramm-halter.klein { height: 200px; }

/* ------------------------------------------------------------------ Muster */
.muster-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.muster-karte { border-left: 3px solid var(--neutral); }
.muster-karte.plus  { border-left-color: var(--plus); }
.muster-karte.minus { border-left-color: var(--minus); }
.muster-karte .kopfzeile { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.muster-karte .kopfzeile .symbol { color: var(--text-schwach); font-size: 0.78rem; }
.muster-karte p { margin: 4px 0 0; color: var(--text-dim); font-size: 0.86rem; line-height: 1.45; }
.gewicht { margin-left: auto; color: var(--warn); letter-spacing: 2px; font-size: 0.8rem; }

/* Gründe-Liste */
ul.gruende { margin: 6px 0 0; padding: 0; list-style: none; }
ul.gruende li { font-size: 0.82rem; color: var(--text-dim); padding: 2px 0; text-align: left; }
ul.gruende li::before { content: '• '; }
ul.gruende li.p::before { content: '▲ '; color: var(--plus); }
ul.gruende li.m::before { content: '▼ '; color: var(--minus); }

/* --------------------------------------------------------------- Meldungen */
.meldung {
  margin: 0 0 14px; padding: 12px 16px; border-radius: 10px; font-size: 0.85rem;
  background: rgba(142, 160, 189, 0.1); border: 1px solid rgba(142, 160, 189, 0.28);
  color: var(--text-dim);
}
.meldung.fehler  { background: rgba(255, 93, 93, 0.09); border-color: rgba(255, 93, 93, 0.3); color: #ff9b9b; }
.meldung.warnung { background: rgba(245, 166, 35, 0.08); border-color: rgba(245, 166, 35, 0.25); color: #d9b271; }
.meldung.gut     { background: rgba(52, 201, 138, 0.09); border-color: rgba(52, 201, 138, 0.28); color: #7ed9b2; }

.disclaimer {
  margin-top: 16px; padding: 12px 16px; border-radius: 10px;
  background: rgba(245, 166, 35, 0.08); border: 1px solid rgba(245, 166, 35, 0.25);
  color: #d9b271; font-size: 0.8rem;
}

.lade { color: var(--text-schwach); padding: 30px; text-align: center; }
.leer { color: var(--text-schwach); padding: 24px; text-align: center; font-size: 0.88rem; }

footer.fuss { margin-top: 26px; color: var(--text-schwach); font-size: 0.76rem; text-align: center; line-height: 1.6; }

/* ------------------------------------------------------------ Anmeldeseite */
body.anmelde-seite { display: flex; align-items: center; justify-content: center; }
.anmelde-karte {
  background: var(--karte); border: 1px solid var(--karte-rand); border-radius: 18px;
  padding: 34px 38px; width: min(94vw, 380px); text-align: center;
  backdrop-filter: blur(14px); box-shadow: var(--schatten);
}
.anmelde-logo {
  width: 46px; height: 46px; border-radius: 12px; background: var(--akzent);
  margin: 0 auto 14px; position: relative; box-shadow: 0 4px 14px rgba(224, 69, 58, 0.4);
}
.anmelde-logo::before, .anmelde-logo::after { content: ''; position: absolute; background: #fff; border-radius: 2px; }
.anmelde-logo::before { width: 24px; height: 7px; left: 11px; top: 19.5px; }
.anmelde-logo::after  { width: 7px; height: 24px; left: 19.5px; top: 11px; }
.anmelde-karte h1 { margin: 0; font-size: 1.3rem; }
.anmelde-karte .unter { color: var(--text-dim); font-size: 0.82rem; margin: 4px 0 20px; }
.anmelde-karte label { display: block; text-align: left; color: var(--text-dim); font-size: 0.8rem; margin-bottom: 5px; }
.anmelde-karte input {
  width: 100%; background: rgba(0, 0, 0, 0.2); border: 1px solid var(--karte-rand);
  color: var(--text); border-radius: 9px; padding: 11px 13px; font-family: inherit; font-size: 0.95rem;
}
.anmelde-karte input:focus { outline: 1px solid var(--akzent); }
.anmelde-karte button {
  width: 100%; margin-top: 14px; background: var(--akzent); border: none; color: #fff;
  border-radius: 9px; padding: 12px; font-family: inherit; font-size: 0.95rem;
  font-weight: 600; cursor: pointer;
}
.anmelde-karte button:hover { background: #c93a30; }
.anmelde-karte .fuss-hinweis { color: var(--text-schwach); font-size: 0.72rem; margin: 18px 0 0; }

/* -------------------------------------------------------------- Definition */
dl.werte { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; font-size: 0.86rem; }
dl.werte dt { color: var(--text-schwach); }
dl.werte dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

@media (max-width: 780px) {
  .hof { padding: 14px 10px 40px; }
  table.markt .versteckbar { display: none; }
  .diagramm-halter { height: 300px; }
  .kpi .wert { font-size: 1.35rem; }
}
