/* PosithINK Umfrage – Styles
   Graphit, gedecktes Gold, ruhig. Eine Frage pro Screen, große Tippflächen. */

:root {
  --bg: #1b1b1d;
  --surface: #232326;
  --raised: #2b2b2f;
  --line: #36363b;
  --text: #ece8df;
  --muted: #a39e94;
  --gold: #c8a962;
  --gold-deep: #8f7947;
  --gold-soft: rgba(200, 169, 98, 0.14);
  --danger: #d98484;
  --focus: #e6cf8a;
  --radius: 12px;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Cormorant Garamond", "Cormorant", Georgia, "Times New Roman", serif;
  --dur: 200ms;
  --ease: cubic-bezier(.2,.7,.2,1);
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: inherit; }
html { scroll-padding-top: env(safe-area-inset-top, 0px); -webkit-text-size-adjust: 100%; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
@media (prefers-reduced-motion: reduce) {
  :root { --dur: 0ms; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Rahmen ---------- */
.app { min-height: 100%; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 10px;
  max-width: 560px; width: 100%; margin: 0 auto;
}
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; color: inherit; }
.brand img { height: 28px; width: auto; display: block; }
.brand .name { font-family: var(--font-display); font-size: 26px; font-weight: 600; letter-spacing: 0.01em; line-height: 1; }
.brand .sub { font-size: 12px; color: var(--muted); }

/* Wortmarke + Emblem: das Emblem steht als Marke links, der Text bleibt lesbar. */
.brand.has-logo { align-items: center; gap: 12px; }
.brand.has-logo img.mark { height: 42px; width: 42px; flex: none; }
.brand.has-logo .name { font-size: 22px; }
.brand.has-logo .sub { align-self: flex-end; padding-bottom: 2px; }
@media (max-width: 380px) {
  .brand.has-logo { gap: 9px; }
  .brand.has-logo img.mark { height: 36px; width: 36px; }
  .brand.has-logo .name { font-size: 20px; }
  .brand.has-logo .sub { display: none; }
}

/* Emblem groß über der Startseite */
.hero-logo {
  display: block; width: 168px; height: 168px; margin: 4px auto 18px;
  animation: hero-in 520ms var(--ease) both;
}
@keyframes hero-in { from { opacity: 0; transform: translateY(6px) scale(.985); } to { opacity: 1; transform: none; } }
@media (max-height: 680px) { .hero-logo { width: 124px; height: 124px; margin-bottom: 12px; } }
.demo-banner {
  background: var(--gold-soft); color: var(--gold);
  border-bottom: 1px solid var(--line);
  text-align: center; font-size: 13px; padding: 8px 16px;
}
main { flex: 1; width: 100%; max-width: 560px; margin: 0 auto; padding: 8px 20px 32px; }
footer {
  max-width: 560px; width: 100%; margin: 0 auto; padding: 16px 20px 24px;
  font-size: 13px; color: var(--muted); display: flex; gap: 18px; flex-wrap: wrap;
}
footer a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--line); }
footer a:hover, footer a:focus-visible { color: var(--text); border-color: var(--gold-deep); }

/* ---------- Fortschritt ---------- */
.progress { margin: 6px 0 22px; }
.progress .track { height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.progress .bar { height: 100%; width: 0; background: var(--gold); transition: width var(--dur) var(--ease); }
.progress .label { font-size: 13px; color: var(--muted); margin-top: 8px; display: flex; justify-content: space-between; }

/* ---------- Screens ---------- */
.screen { opacity: 1; transform: none; transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease); }
.screen.enter { opacity: 0; transform: translateY(8px); }
.screen.leave { opacity: 0; transform: translateY(-6px); pointer-events: none; }

.back {
  appearance: none; background: none; border: 0; color: var(--muted); font: inherit; font-size: 15px;
  padding: 8px 0; margin: 0 0 6px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.back:hover, .back:focus-visible { color: var(--text); }
.back svg { width: 16px; height: 16px; }

h1, h2 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; margin: 0; letter-spacing: 0.005em; }
h1 { font-size: 42px; }
h2 { font-size: 30px; }
h2:focus { outline: none; }
.intro h1 { font-style: italic; font-size: 46px; margin-top: 28px; }
.intro .rule { width: 56px; height: 1px; background: var(--gold); margin: 22px 0; }
.intro p { color: var(--text); font-size: 18px; max-width: 34em; }
.intro .meta { color: var(--muted); font-size: 15px; margin-top: 6px; }
.intro .privacy { color: var(--muted); font-size: 14px; margin-top: 18px; }
.intro .actions { margin-top: 26px; }

.q-title { margin-bottom: 6px; }
.q-optional { display: inline-block; font-family: var(--font-body); font-size: 13px; color: var(--gold); border: 1px solid var(--gold-deep); border-radius: 999px; padding: 1px 9px; vertical-align: middle; margin-left: 8px; }
.help { color: var(--muted); font-size: 15px; margin: 6px 0 0; }
.note { color: var(--muted); font-size: 14px; margin: 12px 0 0; padding: 10px 14px; border-left: 2px solid var(--gold-deep); background: var(--surface); border-radius: 0 8px 8px 0; }

/* ---------- Optionen ---------- */
.options { list-style: none; margin: 22px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.opt {
  appearance: none; width: 100%; text-align: left; cursor: pointer;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 16px 15px 18px; font: inherit; font-size: 17px; line-height: 1.35; min-height: 56px;
  display: flex; align-items: center; gap: 12px;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), transform 120ms var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.opt .mark { flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--gold-deep); position: relative; }
.opt.multi .mark { border-radius: 5px; }

/* Option mit erklärender Unterzeile (Abschluss-Screen) */
.opt.has-hint { align-items: flex-start; flex-wrap: wrap; padding-top: 14px; padding-bottom: 14px; }
.opt.has-hint .mark { margin-top: 2px; }
.opt.has-hint .opt-label { flex: 1; }
.opt-hint {
  flex-basis: 100%; margin-left: 32px; margin-top: 4px;
  font-size: 14px; line-height: 1.4; color: var(--muted);
}
.opt .mark::after { content: ""; position: absolute; inset: 4px; border-radius: inherit; background: var(--gold); opacity: 0; transform: scale(.6); transition: opacity var(--dur), transform var(--dur); }
.opt:hover { background: var(--raised); }
.opt:active { transform: scale(.995); }
.opt[aria-checked="true"], .opt[aria-pressed="true"] { border-color: var(--gold); background: var(--raised); }
.opt[aria-checked="true"] .mark::after, .opt[aria-pressed="true"] .mark::after { opacity: 1; transform: scale(1); }
.opt:focus-visible, .btn:focus-visible, .back:focus-visible, .field:focus-visible, .chip:focus-visible, .check input:focus-visible + .box {
  outline: 2px solid var(--focus); outline-offset: 2px;
}
.options.locked .opt { pointer-events: none; }

/* ---------- Eingaben ---------- */
.field {
  width: 100%; margin-top: 20px; background: var(--surface); color: var(--text); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 15px 16px; font: inherit; font-size: 17px; line-height: 1.4;
}
.field::placeholder { color: #6f6b64; }
.field:focus { border-color: var(--gold); outline: none; }
textarea.field { min-height: 128px; resize: vertical; }
.field.invalid { border-color: var(--danger); }
.field-label { display: block; font-size: 14px; color: var(--muted); margin: 16px 0 -12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip {
  appearance: none; background: none; color: var(--muted); border: 1px solid var(--line); border-radius: 999px;
  font: inherit; font-size: 14px; padding: 6px 12px; cursor: pointer;
}
.chip:hover { color: var(--text); border-color: var(--gold-deep); }
.counter { font-size: 13px; color: var(--muted); text-align: right; margin-top: 6px; }
.error { color: var(--danger); font-size: 15px; margin: 12px 0 0; }

.check { display: flex; gap: 12px; align-items: flex-start; margin-top: 18px; font-size: 15px; line-height: 1.45; cursor: pointer; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check .box { flex: 0 0 auto; width: 22px; height: 22px; margin-top: 2px; border-radius: 6px; border: 1.5px solid var(--gold-deep); position: relative; }
.check .box::after { content: ""; position: absolute; inset: 5px; border-radius: 2px; background: var(--gold); opacity: 0; }
.check input:checked + .box::after { opacity: 1; }

/* ---------- Buttons ---------- */
.actions { display: flex; align-items: center; gap: 18px; margin-top: 26px; flex-wrap: wrap; }
.btn {
  appearance: none; cursor: pointer; font: inherit; font-size: 17px; font-weight: 500;
  border-radius: var(--radius); padding: 15px 24px; min-height: 54px; border: 1px solid transparent;
  transition: background var(--dur), color var(--dur), opacity var(--dur);
}
.btn.primary { background: var(--gold); color: #1a1710; }
.btn.primary:hover { background: #d4b775; }
.btn.primary:disabled { opacity: .45; cursor: default; }
.btn.secondary { background: none; color: var(--text); border-color: var(--line); }
.btn.secondary:hover { border-color: var(--gold-deep); }
.btn.link { background: none; color: var(--muted); padding: 10px 4px; min-height: 0; }
.btn.link:hover { color: var(--text); }
.btn.block { width: 100%; }

/* ---------- Status-Screens ---------- */
.status { padding: 40px 0 20px; }
.status h2 { margin-bottom: 10px; }
.status p { color: var(--muted); }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--gold); animation: spin 900ms linear infinite; margin-bottom: 22px; }
@keyframes spin { to { transform: rotate(360deg); } }
.thanks h2 { font-size: 40px; font-style: italic; }
.thanks .rule { width: 56px; height: 1px; background: var(--gold); margin: 18px 0; }
.thanks p { color: var(--text); font-size: 18px; }
.thanks .demo-note { color: var(--gold); font-size: 14px; margin-top: 14px; }
details.debug { margin-top: 26px; font-size: 13px; color: var(--muted); }
details.debug pre { background: var(--surface); padding: 12px; border-radius: 8px; overflow-x: auto; font-size: 12px; color: var(--text); }

@media (min-width: 600px) {
  body { font-size: 18px; }
  h2 { font-size: 34px; }
  .intro h1 { font-size: 54px; }
}
