:root {
  /* Werte von siga.swiss / SIGA-Logo übernommen */
  --color-primary: #0091d3;
  --color-primary-dark: #214c6f;
  --color-accent: #33a7dc;
  --color-brand-red: #e63323; /* Logo-Akzentfarbe, z.B. für Fehlerzustände */
  --color-bg: #eef5f7;
  --color-card: #ffffff;
  --color-text: #525252;
  --color-muted: #6b7a85;
  --color-border: #dfe4ea;
  --radius: 10px;
  --font-sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* Erzwingt Light-Mode-Darstellung: ohne das invertieren manche Browser/OS
   (u.a. iOS/iPadOS Safari, macOS Safari) Farben automatisch im Dark Mode,
   was Markenfarben und Kontraste zerstören würde. */
:root {
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--color-bg);
  background-color: var(--color-bg);
  color: var(--color-text);
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 24px;
  -webkit-text-size-adjust: 100%;
  position: relative;
}

/* Dezentes levelzwo-Wasserzeichen im Hintergrund (nicht auf der Card selbst,
   damit der eigentliche Inhalt klar lesbar bleibt). pointer-events: none,
   damit es Klicks/Formulareingaben nicht blockiert. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("levelzwo-mark.svg");
  background-repeat: repeat;
  background-size: 180px 100px;
  background-position: 0 0;
  opacity: 0.035;
  pointer-events: none;
  z-index: 0;
}

a {
  color: var(--color-primary);
}

.card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 40px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 10px 30px rgba(11, 37, 69, 0.08);
  position: relative;
  z-index: 1;
}

.lang-switch {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 13px;
  font-weight: 600;
}

.lang-switch a {
  color: var(--color-muted);
  text-decoration: none;
  padding: 2px 4px;
}

.lang-switch a.lang-active {
  color: var(--color-primary);
}

.lang-switch .lang-sep {
  color: var(--color-border);
  margin: 0 2px;
}

.claim {
  font-size: 13px;
  font-style: italic;
  color: var(--color-muted);
  margin: -12px 0 20px;
}

.brand {
  margin-bottom: 20px;
}

.brand .brand-text {
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
  font-weight: 600;
}

.brand svg {
  max-height: 40px;
  max-width: 220px;
  width: auto;
  height: auto;
  display: block;
}

h1 {
  font-size: 24px;
  margin: 0 0 12px;
  color: var(--color-primary);
}

p.intro {
  color: var(--color-muted);
  line-height: 1.5;
  margin-bottom: 28px;
}

label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--color-text);
}

input[type="email"],
input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 16px;
  margin-bottom: 18px;
}

input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(11, 37, 69, 0.12);
}

button, .btn {
  display: inline-block;
  width: 100%;
  background: var(--color-primary-dark);
  color: #fff;
  border: none;
  padding: 13px 16px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}

button:hover, .btn:hover {
  background: var(--color-primary);
}

.alert {
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
}

.alert-error {
  background: #fdecec;
  color: #9b1c1c;
  border: 1px solid #f5c2c2;
  border-left: 3px solid var(--color-brand-red);
}

.alert-error p {
  margin: 8px 0 0;
}

.alert-error a {
  color: #9b1c1c;
  text-decoration: underline;
}

.alert-success {
  background: #eaf7ef;
  color: #1f6d41;
  border: 1px solid #bfe6cc;
}

.alert-info {
  background: #eef3fb;
  color: var(--color-primary);
  border: 1px solid #cfe0f5;
}

.muted {
  color: var(--color-muted);
  font-size: 13px;
  margin-top: 16px;
  text-align: center;
}

.muted a {
  color: var(--color-primary);
}

.test-mode-hint {
  margin-top: 20px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--color-bg);
  border: 1px solid #9b1c1c;
  font-size: 13px;
  color: var(--color-primary);
}

.pdf-box {
  text-align: center;
}

.pdf-box .filename {
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--color-primary);
}

.actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.test-email-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.copy-email {
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-primary-dark);
  color: #fff;
  border: none;
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.copy-email:hover {
  background: var(--color-primary);
}

.copy-email .copy-feedback {
  display: none;
  color: #c8f0d8;
  font-weight: 600;
}

.copy-email.copied .copy-feedback {
  display: inline;
}

.footer-contact {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
  font-size: 12px;
  color: var(--color-muted);
  text-align: left;
  line-height: 1.6;
}

.footer-contact a {
  color: var(--color-muted);
  text-decoration: underline;
}

.copyright {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
  font-size: 12px;
  line-height: 1.7;
  color: var(--color-muted);
  text-align: left;
  opacity: 0.85;
}

.copyright a {
  color: var(--color-muted);
  text-decoration: underline;
}

.copyright-logo-link {
  display: inline-flex;
  vertical-align: middle;
  text-decoration: none !important;
  margin: 0 4px;
}

.copyright-logo-link svg {
  height: 11px;
  width: auto;
  display: block;
}

/* Schmale Displays (Handy): weniger Außenabstand, Card randlos */
@media screen and (max-width: 480px) {
  body {
    padding: 0;
    align-items: flex-start;
  }

  .card {
    max-width: 100%;
    min-height: 100vh;
    border-radius: 0;
    border-left: none;
    border-right: none;
    box-shadow: none;
    padding: 32px 20px;
  }

  .lang-switch {
    top: 16px;
    right: 16px;
  }

  .brand {
    padding-right: 70px;
  }
}

/* Dark-Mode-Schutz für Clients, die den color-scheme-Meta-Tag ignorieren
   und trotzdem eigene Dark-Mode-Farben injizieren (v.a. iOS/iPadOS Safari
   und macOS Safari - "Apple Duo": Light-/Dark-Mode-Paar derselben Seite). */
@media (prefers-color-scheme: dark) {
  body {
    background-color: var(--color-bg) !important;
    color: var(--color-text) !important;
  }

  .card {
    background: var(--color-card) !important;
    color: var(--color-text) !important;
  }
}
