/* Gemeinsames Design fuer alle Nuklaro-Security-Seiten - ein Ort statt verstreuter
   Inline-Styles je Datei, damit sich Look&Feel konsistent halten laesst. */

:root {
  --bg: #0a0a0a;
  --bg-elevated: #16181a;
  --bg-elevated-2: #1e2124;
  --border: #2a2d31;
  --text: #f0f1f3;
  --text-muted: #9a9fa6;
  --text-dim: #6b7075;
  --accent: #2f7fe0;
  --accent-strong: #4d97f0;
  --accent-text: #ffffff;
  --danger: #e5534b;
  --danger-bg: rgba(229, 83, 75, 0.12);
  --warning: #d9a441;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-elevated: 0 8px 24px rgba(0, 0, 0, 0.35);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  /* Mobile Browser zoomen die GESAMTE Seite verkleinert heraus, sobald irgendein Element
     ueber die Viewport-Breite hinausragt (ignoriert dabei "initial-scale=1.0" bewusst, um
     nichts abzuschneiden) - das sieht dann wie eine geschrumpfte Desktop-Seite aus, obwohl
     das viewport-Meta korrekt gesetzt ist. Deshalb hart absichern statt zu hoffen, dass
     nirgends versehentlich Breite ueberschritten wird.
  */
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
  background:
    radial-gradient(circle at 20% -10%, rgba(47, 127, 224, 0.18), transparent 45%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* App-Kopfzeile - auf jeder Seite gleich, respektiert die Notch/Statusleiste einer
   installierten Standalone-App (safe-area-inset). */
.app-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(16px + var(--safe-top)) 20px 14px;
  position: sticky;
  top: 0;
  background: linear-gradient(to bottom, rgba(10, 10, 10, 0.92), rgba(10, 10, 10, 0.75));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10;
}

.app-header .mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.app-header .mark img { width: 100%; height: 100%; object-fit: cover; }

.app-header .title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.app-header .title small {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-dim);
  margin-top: 1px;
}

main {
  padding: 24px 20px calc(32px + var(--safe-bottom));
  max-width: 480px;
  margin: 0 auto;
}

.center-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  padding-top: calc(24px + var(--safe-top));
  padding-bottom: calc(24px + var(--safe-bottom));
}

h1 {
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.015em;
  margin-bottom: 8px;
}

p.lead {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 24px;
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease, background 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: var(--accent-strong); }

.btn-secondary { background: var(--bg-elevated-2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: #24272b; }

.btn-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(229, 83, 75, 0.3); }

.btn-google {
  background: #fff;
  color: #2a2a2a;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
}
.btn-google:hover { background: #f4f4f4; }
.btn-google svg { width: 19px; height: 19px; }

.stack { display: flex; flex-direction: column; gap: 12px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.msg { margin-top: 18px; font-size: 13.5px; text-align: center; }
.msg.ok { color: var(--accent-strong); }
.msg.error { color: var(--danger); }

nav.links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 28px;
}
nav.links a {
  color: var(--text-dim);
  font-size: 13px;
  text-decoration: none;
  font-weight: 500;
}
nav.links a:hover { color: var(--text-muted); }

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  gap: 16px;
}
.detail-row:last-child { border-bottom: none; }
.detail-row .label { color: var(--text-dim); flex-shrink: 0; }
.detail-row .value { color: var(--text); text-align: right; word-break: break-word; }

select {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-elevated-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239a9fa6' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

label.field-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.spinner {
  width: 34px;
  height: 34px;
  margin: 22px auto;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.status-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}
.status-icon.ok { background: rgba(47, 127, 224, 0.15); color: var(--accent-strong); }
.status-icon.error { background: var(--danger-bg); color: var(--danger); }
.status-icon.warn { background: rgba(217, 164, 65, 0.15); color: var(--warning); }
.status-icon svg { width: 26px; height: 26px; }

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-dim);
  font-size: 13.5px;
}

/* Untere Navigation zwischen den drei Hauptbereichen (Anfragen/Freigaben/Gerät) - nur auf
   Seiten, zwischen denen man im normalen Gebrauch wechselt, nicht auf Login/Entscheidungs-/
   Warte-Seite (die sind je ein einzelner, fokussierter Schritt). */
body:has(.tab-bar) main {
  padding-bottom: calc(88px + var(--safe-bottom));
}

.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  padding-bottom: var(--safe-bottom);
  background: rgba(16, 18, 20, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  z-index: 10;
}

.tab-bar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px 8px;
  text-decoration: none;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
  position: relative;
}

.tab-bar a svg { width: 22px; height: 22px; }
.tab-bar a.active { color: var(--accent-strong); }

.tab-bar .badge {
  position: absolute;
  top: 4px;
  right: calc(50% - 20px);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
}
.tab-bar .badge.visible { display: flex; }

/* Sicherheitshinweis + Alarm (security-notice.html, alerts.html) - eine Optik fuer beide
   Stufen, severity-Klasse auf <body> bzw. je Listeneintrag schaltet zwischen ruhigem und
   lautem Design um. Das ist zugleich der Inhalt des nativen Vollbild-Alarmschirms - nur
   diese Datei aendern reicht, keine neue App-Installation noetig. */
.notice-screen {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 32px 24px;
  padding-top: calc(32px + var(--safe-top));
  padding-bottom: calc(32px + var(--safe-bottom));
}
.notice-icon {
  width: 72px; height: 72px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; margin-bottom: 24px;
}
.notice-context {
  font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 8px;
}
.notice-message {
  font-size: 19px; line-height: 1.5; max-width: 420px; margin-bottom: 8px;
}
.notice-at { font-size: 13px; color: var(--text-dim); }

body.severity-normal .notice-icon { background: rgba(47, 127, 224, 0.15); color: var(--accent-strong); }

body.severity-critical { background: #1a0a0a; }
body.severity-critical .notice-icon {
  background: var(--danger-bg); color: var(--danger);
  animation: notice-pulse 1.1s ease-in-out infinite;
}
body.severity-critical .notice-context { color: var(--danger); font-weight: 700; }
body.severity-critical .notice-message { font-size: 22px; font-weight: 600; }
@keyframes notice-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(229, 83, 75, 0.5); }
  50% { transform: scale(1.06); box-shadow: 0 0 0 16px rgba(229, 83, 75, 0); }
}

/* Bedrohungs-Historie (alerts.html) - Listenvariante derselben Severity-Optik. */
.alert-entry {
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 14px 16px; margin-bottom: 10px;
}
.alert-entry.severity-critical { border-color: rgba(229, 83, 75, 0.4); background: rgba(229, 83, 75, 0.06); }
.alert-entry .context {
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim);
}
.alert-entry.severity-critical .context { color: var(--danger); font-weight: 700; }
.alert-entry .message { font-size: 14px; margin: 4px 0; }
.alert-entry .at { font-size: 12px; color: var(--text-dim); }
