/* Archivo (OFL-1.1), selbst gehostet: ein variabler Font für Gewicht und Breite */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("/fonts/archivo.woff2") format("woff2-variations"), url("/fonts/archivo.woff2") format("woff2");
}

:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-deep: #1e3a8a;
  --blue-soft: rgba(37, 99, 235, 0.14);
  --blue-tint: #edf3ff;
  --text: #0f1b3d;
  --muted: #51607f;
  --placeholder: #8d99b3;
  --field-bg: #f6f8fc;
  --border: #dbe3ef;
  --bg: #eef2f8;
  --card: #ffffff;
  --error: #b91c1c;
  --ok: #15803d;

  /* Rundungen nach Hierarchie: Fläche > Karte > Element > Feld */
  --r-hero: 28px;
  --r-card: 20px;
  --r-item: 14px;
  --r-field: 12px;

  /* Karten: feine Linie statt weichem Schatten */
  --edge: 0 0 0 1px rgba(15, 27, 61, 0.06), 0 1px 2px rgba(15, 27, 61, 0.05);
  --lift: 0 0 0 1px rgba(15, 27, 61, 0.05), 0 24px 48px -12px rgba(15, 27, 61, 0.22);

  --font: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 0;
}

button, input, textarea, select { font-family: inherit; }

/* Überschriften leicht verdichtet und eng gesetzt – hilft bei langen deutschen Wörtern */
h1, h2, h3 { font-stretch: 94%; letter-spacing: -0.015em; }

.page {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
           max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

/* Login-Hintergrund: Tiefblau oben, ruhiges Blaugrau unten */
body.login {
  background:
    linear-gradient(180deg, var(--blue-deep) 0, var(--blue-dark) 38vh, var(--bg) 38vh);
}

.card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border-radius: var(--r-hero);
  padding: 36px 24px;
  box-shadow: var(--lift);
}

@media (min-width: 480px) {
  .card { padding: 44px 40px 40px; }
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: block;
}

.brand-name {
  font-weight: 700;
  font-size: 16px;
  font-stretch: 94%;
  color: var(--text);
}

h1 {
  margin: 0 0 28px;
  font-size: 34px;
  line-height: 1.1;
  font-weight: 800;
}

.field { margin-bottom: 18px; }

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

input {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  font: inherit;
  font-size: 16px;                /* verhindert Auto-Zoom auf iOS */
  color: var(--text);
  background: var(--field-bg);
  border: 1px solid var(--border);
  border-radius: var(--r-item);
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
  -webkit-appearance: none;
  appearance: none;
}

input::placeholder { color: var(--placeholder); }

input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px var(--blue-soft);
  background: #fff;
}

.btn {
  width: 100%;
  height: 48px;
  margin-top: 4px;
  border: 0;
  border-radius: var(--r-item);
  background: var(--blue);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: inset 0 -2px 0 rgba(15, 27, 61, 0.18);
  transition: background .15s, transform .05s;
  touch-action: manipulation;
}

.btn:hover { background: var(--blue-dark); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: default; }
.btn:focus-visible { outline: 3px solid var(--blue-soft); outline-offset: 2px; }

.btn-secondary {
  background: #fff;
  color: var(--blue);
  border: 1px solid #b9cbf5;
  box-shadow: none;
}
.btn-secondary:hover { background: var(--blue-tint); border-color: var(--blue); }

.error {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: var(--r-field);
  background: #fef2f2;
  color: var(--error);
  font-size: 14px;
}

.success {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: var(--r-field);
  background: #f0fdf4;
  color: var(--ok);
  font-size: 14px;
  font-weight: 600;
}

.hint {
  margin: 28px 0 0;
  text-align: center;
  font-size: 14.5px;
  line-height: 1.4;
  color: var(--muted);
}

.hint a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.btn-link {
  display: grid;
  place-items: center;
  text-decoration: none;
}
