/* ==========================================================================
   1. Lokale Schriften (DSGVO-konform ohne Drittanbieter)
   ========================================================================== */

/* Cinzel (v26) - Titel & Heraldische Akzente */
@font-face {
  font-family: 'Cinzel';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('./fonts/cinzel-v26-latin-500.woff2') format('woff2');
}

@font-face {
  font-family: 'Cinzel';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('./fonts/cinzel-v26-latin-700.woff2') format('woff2');
}

@font-face {
  font-family: 'Cinzel';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url('./fonts/cinzel-v26-latin-900.woff2') format('woff2');
}

/* Rajdhani (v17) - UI, Navigation & Fließtext */
@font-face {
  font-family: 'Rajdhani';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/rajdhani-v17-latin-regular.woff2') format('woff2');
}

@font-face {
  font-family: 'Rajdhani';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('./fonts/rajdhani-v17-latin-600.woff2') format('woff2');
}

@font-face {
  font-family: 'Rajdhani';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('./fonts/rajdhani-v17-latin-700.woff2') format('woff2');
}

/* ==========================================================================
   2. Globale Variablen & Reset
   ========================================================================== */
:root {
  --bg-dark: #050811;
  --card-bg: rgba(15, 23, 42, 0.65);
  --card-border: rgba(56, 189, 248, 0.2);
  --cyan-glow: #38bdf8;
  --cyan-dim: #0284c7;
  --gold-accent: #eab308;
  --gold-light: #fef08a;
  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --text-faint: #7c8aa0;
  --ok: #4ade80;
  --err: #f87171;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: 'Rajdhani', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

a {
  color: var(--cyan-glow);
}

:focus-visible {
  outline: 2px solid var(--cyan-glow);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   3. Kosmischer Hintergrund
   ========================================================================== */
#canvas-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.veil-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 20%, rgba(2, 132, 199, 0.12) 0%, rgba(5, 8, 17, 0.85) 75%);
  z-index: 1;
  pointer-events: none;
}

/* ==========================================================================
   4. Layout & Typografie
   ========================================================================== */
.container {
  position: relative;
  z-index: 2;
  max-width: 1100px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 3rem 1.5rem 3rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.emblem-wrapper {
  width: 170px;
  height: 170px;
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 0 25px rgba(56, 189, 248, 0.35));
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(234, 179, 8, 0.1);
  border: 1px solid rgba(234, 179, 8, 0.35);
  color: var(--gold-light);
  padding: 0.35rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 1.5rem;
}

.status-pulse {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  background-color: var(--gold-accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--gold-accent);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.75); }
}

h1 {
  font-family: 'Cinzel', serif;
  font-size: clamp(2.2rem, 7vw, 4.8rem);
  font-weight: 900;
  letter-spacing: 0.25em;
  text-indent: 0.25em;
  color: #fff;
  text-shadow: 0 0 35px rgba(56, 189, 248, 0.45);
  margin-bottom: 0.5rem;
}

.tagline {
  font-family: 'Cinzel', serif;
  color: var(--gold-light);
  font-size: clamp(1.05rem, 2.5vw, 1.45rem);
  letter-spacing: 0.15em;
  margin-bottom: 1.5rem;
}

.description {
  max-width: 680px;
  color: var(--text-muted);
  font-size: 1.15rem;
  line-height: 1.6;
  margin-bottom: 3.5rem;
}

/* ==========================================================================
   5. Feature-Karten
   ========================================================================== */
.grid {
  display: grid;
  /* Standardmäßig (Mobil): 1 Spalte */
  grid-template-columns: 1fr;
  gap: 1.5rem;
  width: 100%;
  margin-bottom: 1.5rem;
  text-align: left;
}

@media (min-width: 768px) {
  .grid {
    grid-template-columns: 1fr 1fr; /* Zwei Spalten mit je 50% Platz */
  }
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1.8rem;
  backdrop-filter: blur(8px);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--cyan-glow);
}

.card-num {
  font-family: 'Cinzel', serif;
  color: var(--gold-accent);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

.card h2 {
  font-family: 'Cinzel', serif;
  font-size: 1.3rem;
  color: #fff;
  margin-bottom: 0.75rem;
}

.card p {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.5;
}

.fineprint {
  max-width: 680px;
  color: var(--text-faint);
  font-size: 0.9rem;
  margin-bottom: 3rem;
}

/* ==========================================================================
   6. Formular
   ========================================================================== */
.cta-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: 100%;
  max-width: 520px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(56, 189, 248, 0.15);
  border-radius: 12px;
  padding: 1.75rem;
}

.cta-label {
  font-size: 1rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.email-form {
  width: 100%;
}

.email-row {
  display: flex;
  width: 100%;
  gap: 0.5rem;
}

@media (max-width: 480px) {
  .email-row {
    flex-direction: column;
  }
}

.email-input {
  flex: 1;
  min-width: 0;
  padding: 0.85rem 1.2rem;
  border-radius: 6px;
  border: 1px solid #334155;
  background: rgba(15, 23, 42, 0.9);
  color: #fff;
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.05rem;
  outline: none;
}

.email-input:focus {
  border-color: var(--cyan-glow);
}

.submit-btn {
  padding: 0.85rem 1.4rem;
  background: transparent;
  border: 1px solid var(--cyan-glow);
  color: var(--cyan-glow);
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.submit-btn:hover,
.submit-btn:focus-visible {
  background: var(--cyan-glow);
  color: var(--bg-dark);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.5);
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* Bot-Falle: aus dem Bild geschoben statt display:none, das erkennen manche Bots */
.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-msg {
  min-height: 1.4em;
  margin-top: 0.75rem;
  font-size: 1rem;
  line-height: 1.4;
}

.form-msg:empty {
  min-height: 0;
  margin-top: 0;
}

.form-msg.ok  { color: var(--ok); }
.form-msg.err { color: var(--err); }

.consent-text {
  margin-top: 0.85rem;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text-faint);
}

/* ==========================================================================
   7. Footer
   ========================================================================== */
footer {
  position: relative;
  z-index: 2;
  margin-top: auto;
  padding-top: 3.5rem;
  font-size: 0.9rem;
  color: var(--text-faint);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.5rem;
}

footer a {
  color: var(--text-faint);
  text-decoration: none;
  transition: color 0.2s;
}

footer a:hover,
footer a:focus-visible {
  color: var(--text-main);
}

/* ==========================================================================
   8. Rückmeldeseiten (Bestätigen, Abmelden, 404)
   ========================================================================== */
.panel {
  width: 100%;
  max-width: 540px;
  margin: auto 0 0;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 2.25rem 1.75rem;
  backdrop-filter: blur(8px);
}

.panel-emblem {
  display: block;
  width: 96px;
  height: 96px;
  margin: 0 auto 1.25rem;
  filter: drop-shadow(0 0 18px rgba(56, 189, 248, 0.35));
}

.panel-title {
  font-size: clamp(1.4rem, 5vw, 1.9rem);
  letter-spacing: 0.08em;
  text-indent: 0;
  margin-bottom: 1rem;
}

.panel-ok   .panel-title { color: var(--gold-light); }
.panel-err  .panel-title { color: #fecaca; }

.panel p {
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1.55;
  margin-bottom: 1rem;
}

.panel form {
  margin-top: 1.5rem;
}

.panel .actions {
  margin-top: 1.5rem;
}

.btn-link {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border: 1px solid var(--card-border);
  border-radius: 6px;
  color: var(--text-main);
  text-decoration: none;
  font-weight: 600;
  transition: border-color 0.2s;
}

.btn-link:hover,
.btn-link:focus-visible {
  border-color: var(--cyan-glow);
}

/* ==========================================================================
   9. Impressum & Datenschutz
   ========================================================================== */
.legal {
  width: 100%;
  max-width: 760px;
  text-align: left;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 2rem 1.5rem;
  backdrop-filter: blur(8px);
  line-height: 1.6;
}

@media (min-width: 640px) {
  .legal {
    padding: 2.5rem 2.75rem;
  }
}

.legal h1 {
  font-size: clamp(1.5rem, 5vw, 2.1rem);
  letter-spacing: 0.08em;
  text-indent: 0;
  margin-bottom: 1.5rem;
  text-align: center;
}

.legal h2 {
  font-family: 'Cinzel', serif;
  color: var(--gold-light);
  font-size: 1.35rem;
  margin: 2.25rem 0 0.75rem;
}

.legal h3 {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  color: #fff;
  font-size: 1.15rem;
  margin: 1.5rem 0 0.4rem;
}

.legal p,
.legal li {
  color: var(--text-muted);
  font-size: 1.05rem;
}

.legal p + p {
  margin-top: 0.6rem;
}

.legal ul {
  margin: 0.5rem 0 0.5rem 1.25rem;
}

.legal address {
  font-style: normal;
  color: var(--text-main);
}

.legal .updated {
  margin-top: 2rem;
  font-size: 0.9rem;
  color: var(--text-faint);
}

/* ==========================================================================
   10. Statistik
   ========================================================================== */
.legal.stats {
  max-width: 1000px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-top: 1.25rem;
}

.stats table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.stats th,
.stats td {
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid rgba(56, 189, 248, 0.12);
  text-align: right;
  white-space: nowrap;
}

.stats th:first-child,
.stats td:first-child {
  text-align: left;
}

.stats thead th {
  color: var(--gold-light);
  font-weight: 600;
  text-align: center;
}

.stats tbody td {
  color: var(--text-main);
}

.stats td.zero {
  color: var(--text-faint);
}

.month-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.month-nav h2 {
  margin: 0;
  text-align: center;
  white-space: nowrap;
}

.month-nav a {
  color: var(--cyan-glow);
  text-decoration: none;
  font-weight: 600;
}

.month-nav a:hover,
.month-nav a:focus-visible {
  text-decoration: underline;
}

.month-nav a[rel="next"] {
  justify-self: end;
}

@media (max-width: 560px) {
  .month-nav {
    grid-template-columns: 1fr 1fr;
  }
  .month-nav h2 {
    grid-column: 1 / -1;
    grid-row: 1;
  }
}

.stats-empty {
  margin-top: 1.25rem;
}

.login-form {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

@media (max-width: 480px) {
  .login-form {
    flex-direction: column;
  }
}

.more-domains {
  margin-top: 1rem;
}

.more-domains summary {
  cursor: pointer;
  color: var(--cyan-glow);
  font-weight: 600;
}

.stats tfoot th {
  color: #fff;
  border-top: 1px solid var(--card-border);
  border-bottom: 0;
}

.stats table.domains {
  width: auto;
  min-width: 50%;
}

/* ==========================================================================
   11. Weniger Bewegung, wenn im System so eingestellt
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .status-pulse {
    animation: none;
  }
  .card,
  .card:hover {
    transition: none;
    transform: none;
  }
}
