:root {
  --navy: #0f4585;
  --rot: #d7172e;
  --rot-dunkel: #a01022;
  --grau: #6b7280;
  --bg: #f4f5f7;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: #1a1a1a;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
}

.screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 40px;
}

.kopf {
  width: 100%;
  max-width: 420px;
  text-align: center;
  margin-bottom: 16px;
}

.kopf .logo {
  display: block;
  max-width: 120px;
  max-height: 120px;
  margin: 0 auto 10px;
}

.kopf h1 {
  color: var(--navy);
  font-size: 1.3rem;
  margin: 8px 0 2px;
}

.kopf .notfall-banner {
  display: inline-block;
  background: var(--rot);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 7px 14px;
  border-radius: 20px;
  margin: 6px 0 8px;
}

.kopf .untertitel {
  color: var(--grau);
  font-size: 0.9rem;
  margin: 0;
}

.karte {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin: 14px 0 6px;
}

input[type=text], input[type=tel], input[type=number], select {
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  border: 1.5px solid #d6d9de;
  border-radius: 10px;
  background: #fff;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--navy);
}

.geschlecht-optionen {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.geschlecht-optionen label {
  flex: 1;
  margin: 0;
  text-align: center;
  padding: 10px 4px;
  border: 1.5px solid #d6d9de;
  border-radius: 10px;
  font-weight: 500;
  font-size: 0.85rem;
  cursor: pointer;
}

.geschlecht-optionen input { display: none; }

.geschlecht-optionen input:checked + span {
  color: var(--navy);
}

.geschlecht-optionen label:has(input:checked) {
  border-color: var(--navy);
  background: #eef3fb;
}

.einwilligung {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 18px;
  font-size: 0.82rem;
  color: #444;
}

.einwilligung input { margin-top: 3px; width: 18px; height: 18px; flex-shrink: 0; }

.einwilligung a { color: var(--navy); }

button.primaer {
  width: 100%;
  margin-top: 20px;
  padding: 15px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  background: var(--navy);
  border: none;
  border-radius: 12px;
  cursor: pointer;
}

button.primaer:disabled { background: #a9b6c9; }

.fehler {
  color: var(--rot-dunkel);
  font-size: 0.85rem;
  margin-top: 10px;
  display: none;
}

/* --- Panic-Button-Screen --------------------------------------------- */

.panic-screen {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
}

.panic-hinweis {
  text-align: center;
  color: var(--grau);
  font-size: 0.9rem;
  max-width: 300px;
  line-height: 1.4;
}

.panic-button-wrapper {
  position: relative;
  width: 240px;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#panicBtn {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: none;
  background: var(--rot);
  color: #fff;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 24px rgba(215, 23, 46, 0.45);
  touch-action: none;
  user-select: none;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}

#panicBtn.armed {
  background: #ff4d5e;
  box-shadow: 0 0 0 16px rgba(215, 23, 46, 0.15);
}

#panicBtn.cancel-armed {
  background: var(--grau);
  box-shadow: 0 0 0 10px rgba(107, 114, 128, 0.15);
}

.panic-abbrechen-hinweis {
  text-align: center;
  color: var(--grau);
  font-size: 0.8rem;
}

.unten-link {
  margin-top: auto;
  padding-top: 16px;
  font-size: 0.8rem;
  color: var(--grau);
  text-decoration: underline;
  background: none;
  border: none;
  cursor: pointer;
}

/* --- Status-/Bestaetigungsscreen nach ausgeloestem Alarm -------------- */

.status-screen {
  flex: 1;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
}

.status-icon {
  font-size: 3.4rem;
}

.status-screen h2 {
  color: var(--navy);
  margin: 0;
}

.status-label {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  background: #eef3fb;
  color: var(--navy);
  font-weight: 700;
  font-size: 0.9rem;
}

.status-label.angenommen { background: #fff4e0; color: #a06400; }
.status-label.erledigt { background: #e6f6ea; color: #1a7a3c; }

button.abbrechen-link {
  margin-top: 24px;
  background: none;
  border: none;
  color: var(--grau);
  text-decoration: underline;
  font-size: 0.85rem;
  cursor: pointer;
}

.versteckt { display: none !important; }
