/* SART-Plattform — CI der SART (Petrol/Korall/Tuerkis, Roboto)
   Grundlage: docs/ci/SART-CI.md, abgeleitet von www.sart.ch */

@font-face {
  font-family: "Roboto";
  src: url("../fonts/roboto-vf.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  font-style: normal;
}

:root {
  /* CI-Farben */
  --petrol: #003f49;
  --petrol-700: #002d35;
  --coral: #ff9970;
  --coral-600: #f4835a;
  --turq: #00b0b7;
  --turq-700: #00949a;
  --mist: #f2f2f2;
  --white: #ffffff;

  /* abgeleitet */
  --bg: #f6f7f7;
  --ink: #003f49;
  --muted: #5c7379;
  --line: #e2e6e6;
  --coral-tint: #ffece3;
  --turq-tint: #e0f3f4;
  --focus: #00b0b7;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(0, 63, 73, .05), 0 12px 30px rgba(0, 63, 73, .07);
  --shadow-sm: 0 1px 2px rgba(0, 63, 73, .05), 0 5px 16px rgba(0, 63, 73, .05);
  --font: "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 400;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  font-size: 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3 {
  font-family: var(--font);
  font-weight: 500;
  letter-spacing: -.01em;
  line-height: 1.14;
  margin: 0 0 .4em;
  color: var(--petrol);
}

a { color: var(--turq-700); text-decoration: none; }
a:hover { color: var(--petrol); text-decoration: underline; text-underline-offset: 3px; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- App-Kopf (nur eingeloggt) ---------- */
.appbar {
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.appbar__inner {
  max-width: 940px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand__mark {
  font-weight: 700;
  font-size: 22px;
  letter-spacing: .06em;
  color: var(--petrol);
}
.brand__logo { height: 30px; width: auto; display: block; }
.brand__sub {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: .05em;
  text-transform: uppercase;
}
.appbar__user { display: flex; align-items: center; gap: 14px; font-size: 14px; color: var(--muted); }
.appbar__user strong { color: var(--ink); font-weight: 600; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font);
  font-weight: 500;
  font-size: 15px;
  padding: 11px 22px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background-color .15s ease, transform .05s ease, border-color .15s ease;
}
.btn:active { transform: translateY(1px); }
/* Primaer: Korall-Flaeche mit Petrol-Text (CI-konform + AA-Kontrast) */
.btn--primary { background: var(--coral); color: var(--petrol); }
.btn--primary:hover { background: var(--coral-600); text-decoration: none; color: var(--petrol); }
.btn--ghost { background: transparent; color: var(--petrol); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--petrol); text-decoration: none; color: var(--petrol); }
.btn--block { width: 100%; }

/* ---------- Layout ---------- */
.page {
  flex: 1;
  width: 100%;
  max-width: 940px;
  margin: 0 auto;
  padding: 40px 24px 64px;
}

/* ---------- Login ---------- */
.auth {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}
.auth__card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 400px;
  padding: 40px 36px 34px;
  position: relative;
  overflow: hidden;
}
/* Signatur: Bewegungsbogen in Tuerkis (Rehabilitation = Fortschritt),
   in die obere rechte Ecke getuckt und hinter den Inhalt gelegt */
.auth__arc {
  position: absolute;
  top: -30px; right: -30px;
  width: 118px; height: 118px;
  color: var(--turq-tint);
  pointer-events: none;
  z-index: 0;
}
.auth__card > *:not(.auth__arc) { position: relative; z-index: 1; }
.auth__logo { height: 46px; width: auto; display: block; margin-bottom: 6px; }
.auth__lede { color: var(--muted); font-size: 15px; margin: 4px 0 26px; }

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  font-family: var(--font);
  font-size: 15px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus {
  outline: none;
  border-color: var(--turq);
  box-shadow: 0 0 0 3px rgba(0, 176, 183, .22);
}
.form-error {
  background: var(--coral-tint);
  border: 1px solid #f3c3ad;
  color: #9a3b1a;
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  font-size: 14px;
  margin-bottom: 18px;
}
.form-help { color: var(--muted); font-size: 12px; margin-top: 5px; }

/* ---------- Dashboard ---------- */
.welcome { margin-bottom: 28px; }
.welcome h1 { font-size: clamp(28px, 4vw, 40px); color: var(--turq-700); }
.welcome p { color: var(--muted); margin: 0; font-size: 16px; }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}
.tile {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 148px;
  position: relative;
}
.tile__dot {
  width: 32px; height: 32px;
  border-radius: 10px;
  background: var(--turq-tint);
  display: grid; place-items: center;
  color: var(--turq-700);
  margin-bottom: 8px;
}
.tile h2 { font-size: 19px; margin: 0; }
.tile p { color: var(--muted); font-size: 14px; margin: 0; }
.tile__pill {
  margin-top: auto;
  align-self: flex-start;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  color: #9a3b1a;
  background: var(--coral-tint);
  border-radius: 999px;
  padding: 4px 11px;
}
.tile--soon .tile__dot { background: var(--mist); color: var(--muted); }

.toolbar {
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------- Generische Inhaltsseiten ---------- */
.prose h1 { font-size: 28px; }
.prose ul { list-style: none; padding: 0; margin: 18px 0; }
.prose li {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.prose form { display: inline; }
.prose input:not([type=checkbox]) {
  font-family: var(--font);
  font-size: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--white);
}
.prose label { font-weight: 600; font-size: 14px; }
.prose p { margin: 10px 0; }

/* ---------- Fuss ---------- */
.foot {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  padding: 20px;
  letter-spacing: .02em;
}

@media (max-width: 560px) {
  .appbar__inner { padding: 14px 18px; }
  .page { padding: 28px 18px 48px; }
  .auth__card { padding: 32px 24px 28px; }
}

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