/* Euphoris Digital Corporate Design (Montserrat, Markenblau, flach). */

@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("fonts/montserrat-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
    U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("fonts/montserrat-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #ffffff;
  --bg-2: #f4f6fb;
  --surface: #ffffff;
  --surface-hover: #f4f6fb;

  --border: #e3e7f0;
  --border-strong: #c3cbdd;

  --text: #333333;
  --text-secondary: #6b7280;
  --text-muted: #9aa3b2;

  --brand: #2e62fb;
  --brand-deep: #353ad4;
  --brand-light: #5981fb;
  --brand-tint: #eaeffe;

  --up: #17795e;
  --down: #b3261e;

  --radius-card: 10px;
  --radius-input: 6px;
  --radius-pill: 100px;

  color-scheme: light;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh; /* sichtbare Höhe ohne die ein-/ausfahrenden Browserleisten (iOS) */
  display: flex;
  flex-direction: column;
  font-family: "Montserrat", -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  background: var(--bg);
  color: var(--text);
}

/* ---------- Header ---------- */

.page-header {
  border-bottom: 1px solid var(--border);
  padding: calc(14px + env(safe-area-inset-top)) 16px 14px;
}
.brand-row {
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark { width: 28px; height: auto; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.brand-sub {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.badge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--brand-tint);
  color: var(--brand-deep);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }

.user {
  max-width: 560px;
  margin: 10px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--text-secondary);
  min-width: 0;
}
.user span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Layout ---------- */

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 28px 16px 40px;
}

.view { animation: fade-in 0.25s ease; }

/* Anmeldung: Titel und Microsoft-Knopf mittig im Bereich zwischen Header und Footer. */
.login {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  text-align: center;
}
.login h1 { margin: 0; }
.login > :not(.login-art) { position: relative; z-index: 1; }

/* Grosse Pyramide unten rechts, ragt über den Rand (rund 3/4 sichtbar). */
.login-art {
  --art: min(85vw, 560px);
  position: fixed;
  right: calc(var(--art) * -0.15);
  bottom: calc(var(--art) * -0.16);
  width: var(--art);
  height: auto;
  z-index: 0;
  pointer-events: none;
  user-select: none;
}

/* Vor dem Login (Laden, Anmeldung) ohne Header und Footer. */
body[data-view="loading"] .page-header,
body[data-view="login"] .page-header,
body[data-view="login"] .page-footer { display: none; }
body[data-view="login"] { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
.login .btn.ms { margin-top: 0; }
.login .error { margin: 0; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

h1 {
  margin: 0 0 6px;
  font-size: clamp(28px, 7vw, 36px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.hl { color: var(--brand); }
.lead { margin: 0 0 24px; color: var(--text-secondary); font-size: 15px; }
.center { text-align: center; }
.muted { color: var(--text-secondary); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
}

/* ---------- Formular ---------- */

.field { display: block; margin-bottom: 20px; }
.label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.field-hint { margin: -2px 0 8px; font-size: 13px; }

input[type="text"],
input[type="date"],
input[type="number"],
select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  font: inherit;
  font-size: 16px; /* verhindert Zoom auf iOS */
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-input);
  transition: border-color 0.18s ease;
}
input[type="date"] { display: block; min-width: 0; text-align: left; }

/* iOS Safari gibt Datumsfeldern eine eigene Mindestbreite und zentriert den Wert; dadurch ragt das Feld über den
   Rand und fällt leer in sich zusammen. Nur dort die native Darstellung abschalten. */
@supports (-webkit-touch-callout: none) {
  input[type="date"] { -webkit-appearance: none; appearance: none; }
  input[type="date"]::-webkit-date-and-time-value { min-height: 1.65em; margin: 0; text-align: left; }
}

input:hover, select:hover { border-color: var(--brand-light); }
input:focus-visible, select:focus-visible, .dropzone:focus-visible, .btn:focus-visible, .link:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.dropzone {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  margin-bottom: 10px;
  overflow: hidden;
  background: var(--bg-2);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-card);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--brand); background: var(--brand-tint); }
.dropzone img { display: block; max-width: 100%; max-height: 360px; object-fit: contain; }
.drop-hint { padding: 20px; text-align: center; color: var(--text-secondary); font-size: 14px; }
.drop-hint p { margin: 8px 0 0; }
.drop-icon { width: 32px; height: 32px; }
.pdf-preview { padding: 24px; text-align: center; word-break: break-all; font-weight: 600; }

.row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 11px 26px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.btn.primary {
  width: 100%;
  margin-top: 4px;
  background: var(--brand);
  color: #fff;
  border-radius: var(--radius-pill);
}
.btn.primary:hover { background: var(--brand-deep); }
.btn.primary:disabled { opacity: 0.6; cursor: progress; }
.btn.secondary {
  flex: 1 1 auto;
  padding: 10px 16px;
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
  border-radius: var(--radius-card);
}
.btn.secondary:hover { border-color: var(--brand-light); background: var(--surface-hover); }
.btn-icon { width: 18px; height: 18px; flex-shrink: 0; }

/* Microsoft-Anmeldeknopf nach den Vorgaben von Microsoft (helle Variante). */
.btn.ms {
  margin-top: 8px;
  background: #fff;
  color: #5e5e5e;
  border-color: #8c8c8c;
  border-radius: var(--radius-input);
}
.btn.ms:hover { background: var(--surface-hover); }

.link {
  padding: 0;
  background: none;
  border: 0;
  color: var(--brand);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.link:hover { color: var(--brand-deep); text-decoration: underline; }

/* Lucide-Icons */
.icon { fill: none; stroke: var(--brand); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Meldungen ---------- */

.error { margin: 0 0 16px; color: var(--down); font-weight: 500; }
.field-error { display: block; margin: 6px 0 0; color: var(--down); font-size: 13px; font-weight: 500; }
[aria-invalid="true"], .dropzone.invalid { border-color: var(--down) !important; }

.callout {
  margin-bottom: 16px;
  padding: 16px 20px;
  background: var(--bg-2);
  border-left: 3px solid var(--up);
  border-radius: 0 8px 8px 0;
}
.callout p { margin: 0; }
.callout p + p { margin-top: 8px; }
.callout-title { color: var(--up); font-weight: 700; }

/* ---------- Footer ---------- */

.page-footer {
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

@media (prefers-reduced-motion: reduce) {
  .view { animation: none; }
  * { transition: none !important; }
}
