:root {
  --bg: #f4f7fc;
  --bg-2: #eaf0f9;
  --card: #ffffff;
  --card-2: #f5f8fd;
  --line: #e4ebf5;
  --text: #0f1f38;
  --muted: #64748b;
  --accent: #2f6bff;
  --accent-2: #06b6d4;
  --ok: #16a34a;
  --low: #ca8a04;
  --medium: #ea8a0c;
  --high: #e11d48;
  --info: #64748b;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(20, 50, 110, .08);
  --shadow-lg: 0 18px 50px rgba(20, 50, 110, .14);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  background:
    radial-gradient(900px 500px at 85% -10%, #e3edff 0%, rgba(227,237,255,0) 60%),
    radial-gradient(700px 500px at 0% 0%, #e0fbff 0%, rgba(224,251,255,0) 55%),
    var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}
.accent { color: var(--accent); }
.hidden { display: none !important; }
.muted { color: var(--muted); }

/* TOPBAR */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 32px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: rgba(255,255,255,.78); backdrop-filter: blur(10px); z-index: 50;
}
.brand { display: flex; align-items: center; gap: 10px; }
.logo-dot { width: 14px; height: 14px; border-radius: 5px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 2px 8px rgba(47,107,255,.4); }
.logo-mark-svg { display: block; flex-shrink: 0; filter: drop-shadow(0 2px 6px rgba(47,107,255,.35)); }
.logo-mark { font-weight: 800; font-size: 22px; letter-spacing: -.4px; color: var(--text); }
.logo-tag { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1.2px; margin-left: 6px; }
.topnav a { color: var(--muted); text-decoration: none; margin-left: 24px; font-size: 14px; font-weight: 500; }
.topnav a:hover { color: var(--accent); }
.user-area { display: flex; align-items: center; gap: 14px; }
.user-email { font-size: 14px; color: var(--muted); font-weight: 500; }

/* BUTTONS */
.primary-btn, #scanBtn, .scanbox button {
  padding: 14px 24px; border: none; border-radius: 12px; cursor: pointer; font-weight: 700; font-size: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff;
  box-shadow: 0 6px 18px rgba(47,107,255,.28); transition: filter .15s, transform .05s;
}
.primary-btn:hover, #scanBtn:hover { filter: brightness(1.06); }
.primary-btn:active { transform: translateY(1px); }
.primary-btn:disabled, #scanBtn:disabled { opacity: .6; cursor: wait; }
.ghost { background: #fff; border: 1px solid var(--line); color: var(--text); padding: 10px 18px; border-radius: 10px; cursor: pointer; font-weight: 600; }
.ghost:hover { border-color: var(--accent); color: var(--accent); }
.ghost.small { padding: 7px 14px; font-size: 13px; }
.primary-btn.small { padding: 8px 16px; font-size: 13px; text-decoration: none; display: inline-block; }
.head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
a.ghost { text-decoration: none; display: inline-block; }
.linkbtn { background: none; border: none; color: var(--accent); font-weight: 600; cursor: pointer; padding: 0; font-size: inherit; }
.linkbtn:hover { text-decoration: underline; }

/* AUTH SCREEN */
.auth-wrap { min-height: calc(100vh - 64px); display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg); padding: 38px 36px; width: 100%; max-width: 420px; }
.auth-brand { display: flex; align-items: center; gap: 10px; justify-content: center; }
.auth-brand .logo-mark { font-size: 26px; }
.auth-sub { text-align: center; color: var(--muted); margin: 10px 0 26px; font-size: 15px; }
.auth-tabs { display: flex; background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-bottom: 22px; }
.auth-tab { flex: 1; padding: 10px; border: none; background: transparent; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--muted); }
.auth-tab.active { background: #fff; color: var(--accent); box-shadow: var(--shadow); }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text); }
.auth-form input {
  padding: 13px 14px; border-radius: 11px; border: 1px solid var(--line); background: #fff;
  font-size: 15px; color: var(--text); outline: none; font-family: inherit;
}
.auth-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47,107,255,.14); }
.auth-hint { color: var(--muted); font-size: 12px; margin: -6px 0 0; }
.auth-error { background: rgba(225,29,72,.08); color: var(--high); border: 1px solid rgba(225,29,72,.25); padding: 10px 14px; border-radius: 10px; font-size: 13px; margin: 0; }
.auth-form .primary-btn { margin-top: 4px; width: 100%; }
.auth-foot { text-align: center; color: var(--muted); font-size: 14px; margin: 22px 0 0; }

/* HERO */
.hero { padding: 76px 24px 50px; text-align: center; }
.hero-inner { max-width: 820px; margin: 0 auto; }
.eyebrow { color: var(--accent); font-weight: 700; letter-spacing: 1px; text-transform: uppercase; font-size: 12.5px; margin: 0 0 12px; }
.hero h1 { font-size: 46px; line-height: 1.1; font-weight: 800; margin: 0 0 18px; letter-spacing: -1.2px; }
.hero .sub { font-size: 18px; color: var(--muted); max-width: 640px; margin: 0 auto 32px; }

.scanbox { display: flex; gap: 10px; max-width: 560px; margin: 0 auto; }
.scanbox input {
  flex: 1; padding: 16px 18px; border-radius: 12px; border: 1px solid var(--line);
  background: #fff; color: var(--text); font-size: 16px; outline: none; box-shadow: var(--shadow);
}
.scanbox input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47,107,255,.14); }

.hint { margin-top: 18px; color: var(--muted); font-size: 14px; }
.example { background: #fff; border: 1px solid var(--line); color: var(--accent); padding: 5px 13px; border-radius: 20px; cursor: pointer; font-size: 13px; margin: 0 4px; font-weight: 600; }
.example:hover { border-color: var(--accent); background: var(--card-2); }
.legal-mini { margin: 22px auto 0; color: var(--info); font-size: 12px; max-width: 520px; }

/* LOADING */
.loading { text-align: center; padding: 60px 24px; }
.spinner { width: 54px; height: 54px; border-radius: 50%; margin: 0 auto 20px; border: 4px solid var(--line); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loadsteps { list-style: none; padding: 0; max-width: 380px; margin: 20px auto 0; text-align: left; }
.loadsteps li { color: var(--muted); padding: 6px 0; font-size: 14px; opacity: .4; transition: opacity .3s; }
.loadsteps li.done { opacity: 1; color: var(--text); }
.loadsteps li.done::before { content: "✓ "; color: var(--ok); font-weight: 700; }

/* ERROR */
.error-box { max-width: 560px; margin: 40px auto; background: rgba(225,29,72,.07); border: 1px solid rgba(225,29,72,.3); color: var(--high); padding: 18px 22px; border-radius: 12px; text-align: center; }

/* DASHBOARD */
.dashboard { max-width: 1120px; margin: 40px auto 80px; padding: 0 24px; }
.result-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.result-head h2 { margin: 0; font-size: 30px; }

/* SCORE ROW */
.score-row { display: grid; grid-template-columns: 280px 1fr; gap: 22px; margin-bottom: 32px; }
.gauge-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; text-align: center; box-shadow: var(--shadow); }
.gauge { position: relative; width: 200px; height: 200px; margin: 0 auto; }
.gauge svg { transform: rotate(-90deg); }
.gauge-bg { fill: none; stroke: var(--line); stroke-width: 16; }
.gauge-fg { fill: none; stroke: var(--accent); stroke-width: 16; stroke-linecap: round; transition: stroke-dashoffset 1s ease, stroke .6s; }
.gauge-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.gauge-grade { font-size: 52px; font-weight: 800; line-height: 1; }
.gauge-score { color: var(--muted); font-size: 20px; font-weight: 700; }
.gauge-score small { font-size: 13px; }
.gauge-label { margin: 16px 0 0; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }

.cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.cat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.cat-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.cat-name { font-weight: 600; font-size: 14px; }
.cat-score { font-weight: 800; font-size: 18px; }
.bar { height: 8px; background: var(--line); border-radius: 6px; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 6px; transition: width .9s ease; }

/* TABS */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 24px; flex-wrap: wrap; }
.tab { background: transparent; border: none; color: var(--muted); padding: 12px 18px; cursor: pointer; font-weight: 600; font-size: 15px; border-bottom: 2px solid transparent; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* VIEWS */
.view { animation: fade .3s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 18px; box-shadow: var(--shadow); }
.panel h3 { margin: 0 0 14px; font-size: 18px; }
.panel h4 { margin: 18px 0 8px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }

.findings { list-style: none; padding: 0; margin: 0; }
.findings li { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.findings li:last-child { border-bottom: none; }
.dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.dot.ok { background: var(--ok); } .dot.low { background: var(--low); }
.dot.medium { background: var(--medium); } .dot.high { background: var(--high); }
.dot.info { background: var(--info); }

.kv { display: grid; grid-template-columns: 200px 1fr; gap: 6px 16px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; word-break: break-word; }

.verdict { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 10px; font-weight: 700; font-size: 16px; }
.verdict.up { background: rgba(22,163,74,.12); color: var(--ok); }
.verdict.down { background: rgba(225,29,72,.12); color: var(--high); }
.verdict.mid { background: rgba(234,138,12,.14); color: var(--medium); }

.big-number { font-size: 40px; font-weight: 800; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; background: var(--card-2); border: 1px solid var(--line); }
.grade-badge { display: inline-flex; width: 42px; height: 42px; align-items: center; justify-content: center; border-radius: 10px; font-weight: 800; font-size: 20px; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th, table.tbl td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); }
table.tbl th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; }
table.tbl tr:hover td { background: var(--card-2); }
.row-link { cursor: pointer; }

pre.code { background: #0f1f38; border: 1px solid var(--line); border-radius: 10px; padding: 16px; overflow-x: auto; font-size: 13px; color: #cfe0ff; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.disclaimer { color: var(--info); font-size: 12px; margin-top: 24px; text-align: center; }

/* FEATURES */
.features, .how { max-width: 1120px; margin: 60px auto; padding: 0 24px; }
.features h2, .how h2 { text-align: center; font-size: 30px; margin-bottom: 30px; }
.feat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.feat h3 { margin: 0 0 8px; font-size: 17px; color: var(--accent); }
.feat p { margin: 0; color: var(--muted); font-size: 14px; }
.how ol { max-width: 640px; margin: 0 auto; font-size: 16px; color: var(--muted); }
.how li { margin-bottom: 12px; }
.how strong { color: var(--text); }

.foot { text-align: center; padding: 30px; border-top: 1px solid var(--line); color: var(--info); font-size: 12px; }

/* ===== App-Navigation ===== */
.brand { text-decoration: none; }
.topnav { display: flex; gap: 4px; flex: 1; margin: 0 24px; }
.topnav a { color: var(--muted); text-decoration: none; margin: 0; font-size: 14.5px; font-weight: 600; padding: 8px 14px; border-radius: 9px; }
.topnav a:hover { color: var(--accent); background: var(--card-2); }
.topnav a.active { color: var(--accent); background: rgba(47,107,255,.10); }

/* Glocke / Alarme */
.bell { position: relative; background: transparent; border: none; font-size: 18px; cursor: pointer; padding: 4px 6px; }
.badge-count { position: absolute; top: -2px; right: -4px; background: var(--high); color: #fff; font-size: 10px; font-weight: 700; border-radius: 10px; padding: 1px 5px; }
.alert-pop { position: fixed; top: 62px; right: 24px; width: 360px; max-height: 70vh; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 60; }
.ap-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.ap-item { display: flex; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--line); font-size: 13px; }
.ap-item.unread { background: #f3f8ff; }
.ap-item:last-child { border-bottom: none; }

/* ===== Seiten-Layout ===== */
.view-root { max-width: 1120px; margin: 0 auto; }
.page { padding: 28px 24px 40px; animation: fade .25s ease; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 28px; }
.back { color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 600; }
.back:hover { color: var(--accent); }

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; }
.kpi-label { color: var(--muted); font-size: 13px; }
.kpi-val { font-size: 34px; font-weight: 800; line-height: 1; }

.card-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); margin-bottom: 18px; }
.card-box h2 { margin: 0 0 14px; font-size: 18px; }
.cb-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.cb-head h2 { margin: 0; }
.cb-head h2 a { color: inherit; text-decoration: none; }
.cb-head h2 a:hover { color: var(--accent); }
.empty { text-align: center; padding: 30px; color: var(--muted); }
.empty .primary-btn { margin-top: 14px; }
.alert-banner { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; font-size: 14px; }
.alert-banner a { color: #9a3412; font-weight: 700; }

.row-link { cursor: pointer; }
table.tbl tr.row-link:hover td { background: var(--card-2); }

/* Sub-Tabs (Domain-Detail) */
.subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; flex-wrap: wrap; }
.subtab { background: transparent; border: none; color: var(--muted); padding: 10px 16px; cursor: pointer; font-weight: 600; font-size: 14.5px; border-bottom: 2px solid transparent; }
.subtab:hover { color: var(--text); }
.subtab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* Mini-Balken */
.mbar { display: inline-block; width: 100%; height: 8px; background: var(--line); border-radius: 5px; overflow: hidden; vertical-align: middle; }
.mbar > span { display: block; height: 100%; border-radius: 5px; }

/* Verlauf-Chart */
.chart { width: 100%; height: auto; }

/* Benchmark */
.bench { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.bench-row { display: grid; grid-template-columns: 140px 1fr 36px; align-items: center; gap: 10px; font-size: 14px; }
.bench-row b { text-align: right; }

/* Simulator */
.sim-gauges { display: flex; align-items: center; justify-content: center; gap: 24px; margin: 8px 0; }
.sim-gauges > div { text-align: center; }
.sim-cap { display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.sim-arrow { font-size: 30px; color: var(--muted); }
.progress { height: 10px; background: var(--line); border-radius: 6px; overflow: hidden; margin: 8px 0 4px; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 6px; transition: width .4s ease; }

/* Task-Liste / Tracker */
.task-list { list-style: none; padding: 0; margin: 0; }
.task { border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: none; }
.task label { display: flex; align-items: flex-start; gap: 10px; padding: 11px 2px; cursor: pointer; }
.task input { margin-top: 3px; width: 17px; height: 17px; cursor: pointer; flex-shrink: 0; }
.task-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.task-text { display: flex; flex-direction: column; }
.task-meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.task.done .task-text strong { text-decoration: line-through; color: var(--muted); }

/* Formulare (Einstellungen) */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid label, label.block { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
label.block { max-width: 320px; }
.form-grid input, label.block input, label.block select { padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; font-family: inherit; }
input[type=color] { height: 44px; padding: 4px; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; margin-bottom: 12px; }
label.check input { width: 17px; height: 17px; }

.scan-loading { text-align: center; padding: 30px; }
.scan-loading .loadsteps { display: inline-block; text-align: left; }

@media (max-width: 920px) {
  .topbar { padding: 12px 16px; flex-wrap: wrap; }
  .logo-tag { display: none; }
  .topnav { order: 3; width: 100%; margin: 10px 0 0; overflow-x: auto; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .score-row { grid-template-columns: 1fr; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .feat-grid, .two-col, .form-grid { grid-template-columns: 1fr; }
  .alert-pop { right: 8px; width: calc(100vw - 16px); }
  .hero h1 { font-size: 34px; }
}
