/* ==================================================================
   GLOBOGATE · 360°-Feedback Train the Trainer
   Design: globogate.de CI — Navy/Aurora, Fraunces Display + DM Sans
   ================================================================== */

/* Schriften self-hosted — kein externer CDN-Aufruf (DSGVO) */
@font-face { font-family: 'Fraunces'; src: url('assets/fonts/fraunces-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('assets/fonts/fraunces-600.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('assets/fonts/fraunces-700.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('assets/fonts/fraunces-400-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'DM Sans'; src: url('assets/fonts/dmsans-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'DM Sans'; src: url('assets/fonts/dmsans-500.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'DM Sans'; src: url('assets/fonts/dmsans-700.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'DM Sans'; src: url('assets/fonts/dmsans-400-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  /* Marke */
  --navy:        #15005A;
  --navy-deep:   #0E0040;
  --purple2:     #24107A;
  --accent:      #5647F5;
  --accent-dark: #4a3ce8;
  --lavender:    #C2BCFF;
  --mint:        #DBFFDC;

  /* Flächen */
  --page:        #F5F4FB;
  --boxbg:       #F0EEFF;
  --white:       #FFFFFF;

  /* Text */
  --ink:         #1A1A1A;
  --muted:       #6B6B7B;
  --line:        #8A8A99;   /* 3.4:1 auf Weiss — WCAG 1.4.11 */
  --line-soft:   #E9E7F5;

  /* Semantik */
  --err:         #C0264A;
  --err-bg:      #FDF2F5;
  --ok:          #2BB673;

  /* Typo */
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans:  'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Maße */
  --radius:    14px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --shell:     880px;
  --shadow:    0 1px 2px rgba(21,0,90,.05), 0 8px 28px rgba(21,0,90,.06);
  --shadow-lg: 0 2px 4px rgba(21,0,90,.06), 0 22px 60px rgba(21,0,90,.12);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
}

/* ---------------- Aurora-Hintergrund (CI-Motiv) ---------------- */

.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.aurora::before,
.aurora::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .55;
}
.aurora::before {
  width: 780px; height: 780px;
  top: -340px; left: -220px;
  background: radial-gradient(circle at 40% 40%, rgba(95,80,255,.42), rgba(194,188,255,0) 70%);
}
.aurora::after {
  width: 640px; height: 640px;
  top: 180px; right: -300px;
  background: radial-gradient(circle at 50% 50%, rgba(219,255,220,.55), rgba(194,188,255,0) 68%);
}

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

.site-header {
  position: relative;
  z-index: 2;
  background: var(--navy);
  color: #fff;
  overflow: hidden;
}
.site-header::after {
  /* Arc-Motiv */
  content: '';
  position: absolute;
  width: 520px; height: 520px;
  right: -220px; bottom: -340px;
  border: 1px solid rgba(194,188,255,.28);
  border-radius: 50%;
  pointer-events: none;
}
.header-inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: relative;
  z-index: 1;
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand img { height: 26px; width: auto; display: block; }
.brand-sep { width: 1px; height: 24px; background: rgba(194,188,255,.32); flex: 0 0 auto; }
.brand-text {
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--lavender);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Sprachumschalter */
.lang-switch {
  display: inline-flex;
  background: rgba(255,255,255,.09);
  border: 1px solid rgba(194,188,255,.26);
  border-radius: 999px;
  padding: 3px;
  flex: 0 0 auto;
}
.lang-switch button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--lavender);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  padding: 6px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
  min-height: 30px;
}
.lang-switch button:hover { color: #fff; }
.lang-switch button[aria-pressed="true"] { background: #fff; color: var(--navy); }
.lang-switch button:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }

/* --------------------------- Progress --------------------------- */

.progress-wrap {
  position: relative;
  z-index: 2;
  background: var(--white);
  border-bottom: 1px solid var(--line-soft);
}
.progress-inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 12px 24px 14px;
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 9px;
}
.progress-meta strong { color: var(--navy); font-weight: 700; }
.progress-track {
  height: 6px;
  background: var(--boxbg);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 999px;
  transition: width .38s cubic-bezier(.4,0,.2,1);
}

/* ----------------------------- Shell ---------------------------- */

main {
  position: relative;
  z-index: 1;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 44px 24px 80px;
}

.card {
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 44px 48px;
}

/* ----------------------------- Typo ----------------------------- */

.kicker {
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin: 0 0 16px;
}

h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.12;
  letter-spacing: -.015em;
  color: var(--navy);
  margin: 0 0 20px;
}

h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(22px, 3.4vw, 28px);
  line-height: 1.22;
  letter-spacing: -.01em;
  color: var(--navy);
  margin: 0 0 8px;
}

/* Schrittüberschrift: h1 für die Dokumentstruktur, optisch auf h2-Größe */
h1.step-title {
  font-size: clamp(22px, 3.4vw, 28px);
  line-height: 1.22;
  letter-spacing: -.01em;
  margin: 0 0 8px;
}
h1.step-title:focus { outline: none; }
h1.step-title:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }

h3 {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 6px;
}

.lead {
  font-size: 17px;
  line-height: 1.62;
  color: #3a3a48;
  margin: 0 0 28px;
  max-width: 62ch;
}

.section-note {
  font-size: 13px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  margin: 0 0 22px;
}

.section-intro {
  font-size: 15px;
  line-height: 1.6;
  color: #43434f;
  margin: 0 0 20px;
  max-width: 64ch;
}

.topics-box {
  background: var(--boxbg);
  border-radius: var(--radius);
  padding: 18px 20px;
  font-size: 13.5px;
  line-height: 1.65;
  color: #43434f;
  margin: 0 0 30px;
}
.topics-box strong {
  display: block;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: 7px;
  font-weight: 700;
}

.section-head { margin-bottom: 30px; }

.divider { height: 1px; background: var(--line-soft); border: 0; margin: 40px 0; }

/* --------------------------- Rollenwahl -------------------------- */

.role-list { display: grid; gap: 14px; margin: 4px 0 0; }

.role-card {
  display: block;
  width: 100%;
  text-align: left;
  appearance: none;
  background: var(--white);
  border: 1.5px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 20px 22px;
  cursor: pointer;
  font-family: var(--sans);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
  position: relative;
}
.role-card:hover {
  border-color: var(--accent);
  box-shadow: 0 6px 22px rgba(95,80,255,.13);
  transform: translateY(-1px);
}
.role-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.role-card[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--boxbg);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.role-card .r-label {
  /* Ohne display:block klebt die Beschreibung direkt am Namen —
     benachbarte Inline-Spans erzeugen keinen Zeilenumbruch. */
  display: block;
  font-size: 17px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 3px;
}
.role-card .r-desc { font-size: 14px; color: #4a4a58; margin-bottom: 7px; }
.role-card .r-who { font-size: 12.5px; color: var(--muted); line-height: 1.5; }

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

fieldset { border: 0; margin: 0; padding: 0; }
legend { padding: 0; }

.field { margin-bottom: 26px; }

.field-label {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 7px;
}
.field-hint { font-size: 13px; color: var(--muted); margin: -2px 0 9px; }

input[type="text"],
input[type="date"],
textarea {
  width: 100%;
  font-family: var(--sans);
  /* 16px — darunter zoomt iOS Safari die Seite beim Fokus */
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  transition: border-color .16s ease, box-shadow .16s ease;
}
textarea { min-height: 112px; resize: vertical; }
input:focus, textarea:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(95,80,255,.14);
}
input::placeholder, textarea::placeholder { color: var(--muted); }

/* ------------------------ Rating (Smileys) ---------------------- */

.rating-block { padding: 0 0 4px; }
.rating-block + .rating-block {
  border-top: 1px solid var(--line-soft);
  margin-top: 22px;
  padding-top: 22px;
}

.rating-q {
  font-size: 15.5px;
  line-height: 1.5;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 14px;
  display: block;
}

.rating-options {
  display: grid;
  /* minmax(0,1fr) statt 1fr: ohne die 0 friert die Spalte mit dem
     laengsten Label auf ihrer min-content-Breite ein und die Skala
     wird auf Tablets sichtbar schief. Lange Woerter werden getrennt. */
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.rating-opt {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: 12px 6px 11px;
  min-height: 104px;
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: center;
  transition: border-color .16s ease, background .16s ease, transform .12s ease;
}
.rating-opt:hover { border-color: var(--accent); background: #FBFAFF; }
.rating-opt input {
  /* deckungsgleich mit der Karte: Trefferflaeche und AT-Fokusrahmen passen */
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  opacity: 0;
  margin: 0;
  appearance: none;
  cursor: pointer;
}
.rating-opt .o-emoji {
  font-size: 25px;
  line-height: 1;
  filter: grayscale(.3);
  opacity: .85;
  transition: filter .16s ease, opacity .16s ease, transform .16s ease;
}
.rating-opt .o-label {
  font-size: 12px;
  line-height: 1.3;
  overflow-wrap: break-word;
  hyphens: auto;
  color: var(--muted);
  font-weight: 500;
  transition: color .16s ease;
}
.rating-opt.is-na .o-emoji { font-size: 19px; padding-top: 4px; }

.rating-opt:has(input:checked) {
  border-color: var(--accent);
  background: var(--boxbg);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.rating-opt:has(input:checked) .o-emoji { filter: none; opacity: 1; transform: scale(1.14); }
.rating-opt:has(input:checked) .o-label { color: var(--navy); font-weight: 700; }
.rating-opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Fallback ohne :has() — sonst gaebe es gar keinen Fokusindikator */
.rating-opt:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Fallback für Browser ohne :has() */
.rating-opt.checked {
  border-color: var(--accent);
  background: var(--boxbg);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.rating-opt.checked .o-emoji { filter: none; opacity: 1; transform: scale(1.14); }
.rating-opt.checked .o-label { color: var(--navy); font-weight: 700; }

/* Skalen-Legende */
.scale-legend {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line-soft);
}

/* ----------------------------- Fehler --------------------------- */

.has-error input[type="text"],
.has-error input[type="date"],
.has-error textarea { border-color: var(--err); background: var(--err-bg); }

.rating-block.has-error .rating-options {
  outline: 1.5px solid var(--err);
  outline-offset: 6px;
  border-radius: var(--radius-sm);
}

.err-msg {
  display: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--err);
  margin-top: 8px;
}
.has-error .err-msg { display: block; }

/* Hinweis auf einen wiederhergestellten Stand — mit Ausweg, falls er
   von einer anderen Person am selben Gerät stammt */
.resume-note {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  background: var(--boxbg);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin: 0 0 26px;
  font-size: 14.5px;
  color: #43434f;
}

.link-btn {
  appearance: none;
  border: 0;
  background: none;
  padding: 4px 0;
  font: inherit;
  font-weight: 700;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.link-btn:hover { color: var(--navy); }
.link-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

.form-alert {
  display: none;
  background: var(--err-bg);
  border: 1px solid rgba(192,38,74,.28);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--err);
  margin-bottom: 26px;
}
.form-alert.show { display: block; }

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

.actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 38px;
  padding-top: 30px;
  border-top: 1px solid var(--line-soft);
}
.actions .spacer { flex: 1; }

.btn {
  appearance: none;
  font-family: var(--sans);
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: .01em;
  border-radius: 999px;
  padding: 14px 30px;
  min-height: 50px;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .12s ease, box-shadow .18s ease;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.btn-primary {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 3px 14px rgba(21,0,90,.2);
}
.btn-primary:hover { background: var(--purple2); transform: translateY(-1px); box-shadow: 0 6px 22px rgba(21,0,90,.26); }
.btn-primary:disabled { background: #726E88; box-shadow: none; cursor: progress; transform: none; }

.btn-ghost { background: transparent; color: var(--navy); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--navy); background: var(--boxbg); }

.btn-arrow { font-size: 17px; line-height: 1; }

/* ---------------------------- Danke ----------------------------- */

.thanks { text-align: center; padding: 60px 40px; }
.thanks-mark {
  width: 66px; height: 66px;
  border-radius: 50%;
  background: var(--mint);
  color: var(--navy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  margin-bottom: 26px;
}
.thanks h1 { margin-bottom: 16px; }
.thanks .lead { margin: 0 auto; text-align: center; }

/* --------------------------- Datenschutz ------------------------ */

.privacy-note {
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  background: var(--boxbg);
  border-radius: var(--radius-sm);
  padding: 15px 18px;
  margin-top: 30px;
}
.privacy-note a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

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

.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line-soft);
  background: var(--white);
}
.footer-inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 26px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: 13px;
  color: var(--muted);
}
.footer-inner a { color: var(--muted); text-decoration: none; margin-right: 18px; display: inline-block; padding: 6px 0; }
.footer-inner a:hover { color: var(--navy); text-decoration: underline; }

/* -------------------------- Sichtbarkeit ------------------------ */

[hidden] { display: none !important; }

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

.step { animation: rise .32s cubic-bezier(.4,0,.2,1); }
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* --------------------------- Responsive ------------------------- */

@media (max-width: 720px) {
  .card { padding: 30px 22px; border-radius: var(--radius); }
  main { padding: 26px 14px 60px; }
  .header-inner { padding: 16px 14px; }
  .progress-inner { padding: 11px 14px 13px; }
  .footer-inner { padding: 22px 14px; }
  .brand img { height: 22px; }
  .brand-sep, .brand-text { display: none; }
  /* Sprachschalter: 44px Trefferflaeche — wichtigster Schalter der Gruppe */
  .lang-switch button { min-height: 44px; padding: 12px 18px; font-size: 13px; }

  /* Aurora mobil aus: fixierte 90px-Blur-Ebene verursacht Scroll-Ruckeln */
  .aurora { display: none; }

  .rating-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rating-opt {
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    min-height: 56px;
    padding: 10px 12px;
    gap: 10px;
    text-align: left;
  }
  .rating-opt .o-emoji { font-size: 22px; }
  .rating-opt .o-label { font-size: 13px; }
  .actions { flex-wrap: wrap; }
  .actions .spacer { display: none; }
  .btn { flex: 1 1 100%; justify-content: center; }
  .btn-ghost { order: 2; }
}

@media (forced-colors: active) {
  /* box-shadow wird im Kontrastmodus verworfen — Auswahl per outline sichern */
  .rating-opt:has(input:checked),
  .rating-opt.checked,
  .role-card[aria-current="true"] {
    outline: 3px solid Highlight;
    outline-offset: -3px;
  }
  .progress-bar { background: Highlight; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}

@media print {
  .aurora, .lang-switch, .actions, .progress-wrap { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 0; padding: 0; }
}
