/* =========================================================================
   Art-4-Selbst-Check, Styles
   Marke: KI in der Pflege, Klartext statt Hype.
   Stil: flach und ruhig, keine Verlaeufe, keine Schatten, viel Weissraum.
   ========================================================================= */

/* --- Selbst gehostete Schrift (kein CDN, DSGVO) ---------------------------
   IBM Plex Sans, dieselbe Schrift wie alex-aghamir.de. Eine einzige Datei
   deckt alle Strichstaerken ab (variable Schrift), deshalb nur ein Block.
   Datei: assets/fonts/ibm-plex-sans.woff2 (~40 KB, liegt im Repo).
   Fehlt sie, greift der system-ui-Fallback, die Seite bleibt nutzbar. */
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/ki-check/assets/fonts/ibm-plex-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* --- Design-Tokens (an einer Stelle editierbar) --------------------------- */
:root {
  --bg:          #F4F1EA;  /* Haupt-Hintergrund */
  --card:        #FAF8F3;  /* Karten */
  --sunk:        #ECE8DE;  /* abgesetzte Sektion */
  --slate:       #2E3A40;  /* Text und Ueberschriften, dunkles Band */
  --slate-soft:  #3E4A50;  /* Border auf Dunkel */
  --teal:        #2F6F6B;  /* Akzent, Buttons, Links */
  --teal-hover:  #255A57;  /* Hover */
  --teal-muted:  #6B9B98;  /* Subline auf Hell */
  --teal-onDark: #8FB3B0;  /* Subline auf Dunkel */
  --border:      #E0DBD0;  /* Trennlinien auf Hell */

  /* Ampel (Ergebnis-Rad) */
  --ampel-gruen: #1F8A5B;
  --ampel-gelb:  #E0A200;
  --ampel-rot:   #C0392B;

  --radius: 8px;
  --maxw: 640px;
  --font: "IBM Plex Sans", system-ui, sans-serif;
}

/* --- Reset / Basis -------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  color: var(--slate);
  background: var(--bg);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal); }
a:hover { color: var(--teal-hover); }

/* Sichtbare Fokus-Ringe (Barrierearmut) */
:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Honeypot: aus dem Blickfeld, nicht display:none (manche Bots ueberspringen das) */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --- Layout --------------------------------------------------------------- */
.site-header {
  padding: 20px 16px;
  max-width: var(--maxw);
  margin: 0 auto;
}
.logo-link { display: inline-block; }
.logo { opacity: 0.9; }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 8px 16px 48px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

/* --- Intro ---------------------------------------------------------------- */
h1 {
  font-size: 1.6rem;
  line-height: 1.25;
  font-weight: 700;
  margin: 0 0 12px;
}
.subline {
  color: var(--slate);
  margin: 0;
}
.intro .subline { max-width: 52ch; }

/* --- Fragebogen ----------------------------------------------------------- */
#check-form { display: flex; flex-direction: column; gap: 24px; }

fieldset.q {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 0;
  padding: 20px 0 0;
}
fieldset.q:first-of-type { border-top: 0; padding-top: 0; }
legend {
  font-weight: 600;
  padding: 0;
  margin-bottom: 12px;
}
legend .hint {
  display: block;
  font-weight: 400;
  font-size: 0.9rem;
  color: var(--teal-muted);
  margin-top: 2px;
}

.options { display: flex; flex-wrap: wrap; gap: 10px; }
.opt {
  flex: 1 1 auto;
  min-width: 84px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  cursor: pointer;
}
.opt:hover { border-color: var(--teal-muted); }
.opt input { accent-color: var(--teal); width: 18px; height: 18px; margin: 0; }
.opt:has(input:checked) {
  border-color: var(--teal);
  background: #EEF3F2;
}

/* --- Lead-Box ------------------------------------------------------------- */
.sunk {
  background: var(--sunk);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.lead-box { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; }
.req { color: var(--ampel-rot); }
.opt-tag { font-weight: 400; color: var(--teal-muted); font-size: 0.9rem; }

input[type="email"], input[type="text"] {
  font: inherit;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--slate);
}
input[type="email"]:focus, input[type="text"]:focus { border-color: var(--teal); }

.note { font-size: 0.9rem; color: var(--teal-muted); margin: 0; }

.consent-label {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-weight: 400;
  cursor: pointer;
}
.consent-label input { accent-color: var(--teal); width: 20px; height: 20px; margin-top: 2px; flex: 0 0 auto; }
#consent-text { font-size: 0.95rem; }

/* --- Fehler --------------------------------------------------------------- */
.err {
  color: var(--ampel-rot);
  font-size: 0.9rem;
  margin: 8px 0 0;
  font-weight: 600;
}
.form-err { margin-top: 12px; }

/* --- Buttons -------------------------------------------------------------- */
.btn {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  padding: 14px 22px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary {
  background: var(--teal);
  color: #fff;
}
.btn-primary:hover { background: var(--teal-hover); color: #fff; }
#submit-btn { align-self: flex-start; }
#submit-btn[disabled] { opacity: 0.6; cursor: progress; }

/* --- Ergebnis ------------------------------------------------------------- */
.result { display: flex; flex-direction: column; gap: 20px; }

.gauge-box { text-align: center; }
.gauge { width: 100%; max-width: 300px; height: auto; margin: 0 auto; }
#needle { transition: transform 700ms cubic-bezier(0.22, 1, 0.36, 1); transform-origin: 100px 100px; }
.gauge-label { margin: 8px 0 0; }
.gauge-stufe {
  display: block;
  font-size: 1.3rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.gauge-punkte { display: block; color: var(--teal-muted); font-size: 0.95rem; }

/* Diagnose im dunklen Band als Blickfang */
.band-dark {
  background: var(--slate);
  border: 1px solid var(--slate-soft);
  border-radius: var(--radius);
  padding: 22px 24px;
  color: var(--bg);
}
.band-kicker {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--teal-onDark);
  margin-bottom: 8px;
}
.band-dark p { margin: 0; font-size: 1.15rem; line-height: 1.45; }

.result-block h3 {
  font-size: 1.05rem;
  margin: 0 0 6px;
  font-weight: 700;
}
.result-block p { margin: 0; }

.result-action { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.mail-note { font-size: 0.9rem; color: var(--teal-muted); margin: 0; }

/* --- Footer --------------------------------------------------------------- */
.site-footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 24px 16px 40px;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--teal-muted);
}
.site-footer nav a { color: var(--teal); text-decoration: none; }
.site-footer nav a:hover { text-decoration: underline; }
.site-footer nav span { margin: 0 8px; }
.footer-note { margin: 8px 0 0; }

/* --- Ab Tablet etwas groessere Ueberschrift ------------------------------- */
@media (min-width: 560px) {
  h1 { font-size: 1.9rem; }
}

/* Auf schmalen Screens Paddings verkleinern, damit die 3 Optionen passen */
@media (max-width: 460px) {
  .card { padding: 18px; }
  .opt { padding: 11px 8px; min-width: 76px; }
  .options { gap: 8px; }
  body { font-size: 16px; }
}

/* Reduzierte Bewegung respektieren */
@media (prefers-reduced-motion: reduce) {
  #needle { transition: none; }
}
