/* =========================================================================
   Umfragetool – Basis-Styles (Teilnehmer, Login, gemeinsame Komponenten)
   Farbschema und Schrift nach purematic.com. Alles Styling über Tokens.
   ========================================================================= */

/* Exo wird lokal ausgeliefert (keine Übertragung an Google Fonts). */
@font-face { font-family: 'Exo'; font-style: normal; font-weight: 400; font-display: swap; src: url('/assets/fonts/Exo-Regular.ttf') format('truetype'); }
@font-face { font-family: 'Exo'; font-style: normal; font-weight: 500; font-display: swap; src: url('/assets/fonts/Exo-Medium.ttf') format('truetype'); }
@font-face { font-family: 'Exo'; font-style: normal; font-weight: 600; font-display: swap; src: url('/assets/fonts/Exo-SemiBold.ttf') format('truetype'); }
@font-face { font-family: 'Exo'; font-style: normal; font-weight: 700; font-display: swap; src: url('/assets/fonts/Exo-Bold.ttf') format('truetype'); }

:root {
  --brand: #13437B;
  --brand-dark: #0F3866;
  --brand-light: #BACEE3;
  --accent: #1A5599;
  --accent-hover: #0F3866;
  --accent-soft: color-mix(in srgb, var(--accent) 8%, #FFFFFF);
  --star: var(--accent);
  --ink: #2E3F52;
  --ink-2: #4F6178;
  --ink-3: #5E6E82;
  --on-brand: #FFFFFF;
  --on-brand-2: #DFE5EC;
  --on-brand-3: #B8C5D6;
  --line: #D3DCE6;
  --line-soft: #E3E9F0;
  --field: #7E8FA4;
  --ground: #EAEEF1;
  --surface: #FFFFFF;
  --surface-2: #F4F6F9;
  --error: #C53E3E;
  --error-soft: #FBEAEA;
  --success: #1E6B3E;
  --success-soft: #E7F4EC;
  --radius: 0px;
  --cut: 14px;
  --chamfer: 24px;
  --font: 'Exo', 'Open Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  --shadow: 0 1px 2px rgba(19, 67, 123, 0.06), 0 8px 24px rgba(19, 67, 123, 0.08);
  --focus: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.5; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.25; color: var(--ink); }
p { margin: 0; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
button, input, textarea, select { font: inherit; color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 50; padding: 10px 16px; background: var(--surface); color: var(--ink); }
.skip-link:focus { top: 12px; }
.muted { color: var(--ink-2); }
.loading { color: var(--ink-3); padding: 32px 0; text-align: center; }
.stack-6 { display: flex; flex-direction: column; gap: 6px; }
.stack-12 { display: flex; flex-direction: column; gap: 12px; }
.icon { flex: none; }

/* ---------- Seitenrahmen ---------- */

.page { min-height: 100vh; display: flex; flex-direction: column; }
.site-header { background: var(--brand); color: var(--on-brand); box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2); position: relative; z-index: 5; }
.site-header-inner { max-width: 1120px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-header-wide { max-width: 1440px; }
.brand { display: flex; align-items: center; gap: 16px; min-width: 0; }
.brand-logo { display: block; height: 38px; width: auto; max-width: 200px; object-fit: contain; }
.brand-divider { width: 1px; height: 28px; background: rgba(255, 255, 255, 0.3); }
.brand-title { font-size: 15px; font-weight: 500; color: #EAEEF1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-link { text-decoration: none; }
.brand-link:hover { color: #FFFFFF; text-decoration: underline; }
.page-main { width: 100%; flex: 1 0 auto; }
.header-actions { display: flex; align-items: center; gap: 12px; }

/* Sprachumschalter (Segment-Control auf dem Navy-Header) */
.lang-switch { display: inline-flex; border: 1px solid rgba(255, 255, 255, 0.55); }
.lang-btn { min-width: 44px; min-height: 42px; padding: 0 10px; border: 0; background: transparent; color: var(--on-brand-2); font-size: 13px; font-weight: 600; letter-spacing: 0.06em; cursor: pointer; }
.lang-btn + .lang-btn { border-left: 1px solid rgba(255, 255, 255, 0.35); }
.lang-btn:hover { background: rgba(255, 255, 255, 0.1); color: #FFFFFF; }
.lang-btn[aria-pressed="true"] { background: #FFFFFF; color: var(--brand); }
.lang-btn:focus-visible { outline: 2px solid #FFFFFF; outline-offset: 2px; }

.site-footer { background: var(--brand); color: var(--on-brand-3); clip-path: polygon(0 32px, 100% 0, 100% 100%, 0 100%); margin-top: 24px; }
.site-footer-inner { max-width: 1120px; margin: 0 auto; padding: 56px 24px 28px; display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; font-size: 13px; }
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: #EAEEF1; }
.footer-links a:hover { color: #FFFFFF; }

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

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 1px solid transparent; border-radius: var(--radius); font-size: 15px; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer; transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease; white-space: nowrap; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #FFFFFF; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); color: #FFFFFF; }
.btn-secondary { background: var(--surface); border-color: var(--line); color: var(--ink); font-weight: 500; }
.btn-secondary:hover:not(:disabled) { border-color: var(--field); color: var(--ink); }
.btn-danger { background: var(--surface); border-color: #E5B4B4; color: var(--error); font-weight: 500; }
.btn-danger:hover:not(:disabled) { background: var(--error-soft); color: var(--error); }
.btn-danger-solid { background: var(--error); color: #FFFFFF; }
.btn-danger-solid:hover:not(:disabled) { background: #A83434; color: #FFFFFF; }
.btn-ghost-light { background: transparent; border-color: rgba(255, 255, 255, 0.55); color: #FFFFFF; font-size: 14px; font-weight: 500; }
.btn-ghost-light:hover { background: rgba(255, 255, 255, 0.1); border-color: #FFFFFF; color: #FFFFFF; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn-lg { min-height: 48px; padding: 0 24px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-cut { clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%); }
.btn-cut:focus-visible { outline-offset: -4px; outline-color: #FFFFFF; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; border: 1px solid transparent; border-radius: var(--radius); background: transparent; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.icon-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.icon-btn.is-danger:hover:not(:disabled) { color: var(--error); background: var(--error-soft); border-color: #E5B4B4; }

/* ---------- Formularfelder ---------- */

.field { width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--field); border-radius: var(--radius); background: var(--surface); color: var(--ink); }
textarea.field { min-height: 132px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.field-sm { min-height: 40px; font-size: 15px; }
textarea.field-sm { min-height: 88px; padding: 10px 12px; }
.field:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.field::placeholder { color: #6E7E92; }
select.field { padding-right: 36px; }
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row > label, .label { font-size: 14px; font-weight: 600; color: var(--ink); }
.hint { font-size: 13px; color: var(--ink-3); }
.form-status { min-height: 1.5em; font-size: 14px; color: var(--ink-2); }
.form-status.is-error { color: var(--error); font-weight: 500; }

/* ---------- Umfrage ---------- */

.survey { --accent-soft: color-mix(in srgb, var(--accent) 8%, #FFFFFF); width: 100%; max-width: 760px; margin: 0 auto; padding: 40px 24px 40px; display: flex; flex-direction: column; gap: 20px; outline: none; }

.progress-card { background: var(--brand); color: var(--on-brand); clip-path: polygon(var(--chamfer) 0, 100% 0, 100% calc(100% - var(--chamfer)), calc(100% - var(--chamfer)) 100%, 0 100%, 0 var(--chamfer)); padding: 32px; display: flex; flex-direction: column; gap: 20px; }
.progress-head { display: flex; flex-direction: column; gap: 6px; }
.progress-eyebrow { font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--brand-light); }
.progress-title { font-size: 30px; letter-spacing: -0.01em; color: #FFFFFF; outline: none; }
.progress-intro { color: var(--on-brand-2); white-space: pre-line; }
.progress-stats { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; font-size: 14px; }
.progress-stats strong { font-weight: 600; }
.progress-stats span { color: var(--on-brand-3); }
.progress-steps { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(var(--steps, 3), minmax(0, 1fr)); gap: 8px; }
.step { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.step-track { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.16); overflow: hidden; }
.step.is-current .step-track { background: rgba(255, 255, 255, 0.32); }
.step-fill { height: 100%; width: 0; background: #FFFFFF; border-radius: 3px; transition: width 0.25s ease; }
.step-meta { display: flex; justify-content: space-between; gap: 6px; font-size: 13px; color: var(--on-brand-3); }
.step.is-current .step-meta { color: #FFFFFF; font-weight: 600; }
.step-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step-count { font-family: var(--mono); font-size: 12px; font-weight: 400; color: var(--on-brand-3); }

.q-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; gap: 18px; scroll-margin-top: 24px; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.q-card.has-error { border-color: var(--error); box-shadow: 0 0 0 3px #F6D5D5; }
.q-head { display: flex; gap: 14px; align-items: flex-start; }
.q-num { flex: none; min-width: 32px; height: 32px; padding: 0 6px; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.q-head-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding-top: 2px; }
.q-title { font-size: 18px; line-height: 1.4; overflow-wrap: anywhere; }
.q-req { color: var(--error); }
.q-help { font-size: 14px; color: var(--ink-2); white-space: pre-line; }
.q-error { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: var(--error); }
.counter { align-self: flex-end; font-family: var(--mono); font-size: 13px; color: var(--ink-3); }

.options { display: flex; flex-direction: column; gap: 8px; }
.option { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); transition: border-color 0.12s ease, background-color 0.12s ease; }
.option:hover { border-color: var(--field); }
.option.is-selected { border-color: var(--accent); background: var(--accent-soft); }
.option-label { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 10px 16px; cursor: pointer; }
.option.is-selected .option-text { font-weight: 600; }
.option-hint { margin-left: auto; font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.choice-input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.option-follow { padding: 0 16px 16px 48px; display: flex; flex-direction: column; gap: 6px; }
.follow-label { font-size: 14px; font-weight: 500; color: var(--ink-2); }

.visually-hidden-input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }

.stars-row { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.stars { display: flex; gap: 2px; }
.star { position: relative; display: flex; cursor: pointer; }
.star-face { display: flex; align-items: center; justify-content: center; width: 54px; height: 54px; transition: transform 0.12s ease; }
.star svg { fill: transparent; stroke: var(--field); }
.star.is-on svg { fill: var(--star); stroke: var(--star); }
.star.is-hover .star-face { transform: scale(1.12); }
.visually-hidden-input:focus-visible + .star-face, .visually-hidden-input:focus-visible + .thumb-face { outline: 2px solid var(--accent); outline-offset: 2px; }
.stars-meta { display: flex; flex-direction: column; gap: 2px; min-width: 150px; }
.stars-text { font-size: 17px; font-weight: 600; }
.stars-text.is-empty { font-weight: 400; color: var(--ink-3); }
.stars-count { font-family: var(--mono); font-size: 13px; color: var(--ink-3); }

.thumbs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.thumb { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 124px; padding: 18px 12px; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; text-align: center; transition: border-color 0.12s ease, background-color 0.12s ease; }
.thumb:hover { border-color: var(--field); }
.thumb.is-selected { border-color: var(--accent); background: var(--accent-soft); }
.thumb-face { width: 56px; height: 56px; border-radius: 50%; background: #EDF1F5; color: var(--ink-2); display: flex; align-items: center; justify-content: center; transition: background-color 0.12s ease, color 0.12s ease; }
.thumb.is-selected .thumb-face { background: var(--accent); color: #FFFFFF; }
.thumb.is-selected .thumb-label { font-weight: 600; }
.thumb-follow { display: flex; flex-direction: column; gap: 6px; padding: 16px; background: var(--accent-soft); }

.survey-nav-wrap { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.survey-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.req-hint { font-size: 14px; color: var(--ink-3); }
.survey-nav .form-status { text-align: right; }

.done-card, .message-card { background: var(--surface); border: 1px solid var(--line); padding: 48px 32px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; }
.done-card h1, .message-card h1 { font-size: 28px; }
.done-card p, .message-card p { max-width: 520px; color: var(--ink-2); white-space: pre-line; }
.done-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.preview-note { padding: 10px 14px; background: #FFF4E5; color: #7A4306; font-size: 14px; font-weight: 500; }

/* ---------- Kopfgrafik ---------- */

.hero { margin: 0; }
.hero-img { display: block; width: 100%; height: auto; }
.hero-content { clip-path: polygon(var(--chamfer) 0, 100% 0, 100% calc(100% - var(--chamfer)), calc(100% - var(--chamfer)) 100%, 0 100%, 0 var(--chamfer)); background: var(--line-soft); }
.hero-content + .progress-card { margin-top: -8px; }
.hero-wide { background: var(--brand-dark); }
.hero-wide .hero-img { max-height: min(46vh, 480px); object-fit: cover; }

/* ---------- Login ---------- */

.login-main { display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.login-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--brand); padding: 40px 36px; display: flex; flex-direction: column; gap: 20px; box-shadow: var(--shadow); }
.login-card h1 { font-size: 26px; }
.login-icon { width: 44px; height: 44px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; }

@media (max-width: 640px) {
  .survey { padding: 24px 16px 32px; }
  .progress-card { padding: 24px 20px; }
  .progress-title { font-size: 24px; }
  .q-card { padding: 20px 16px; }
  .q-head { gap: 10px; }
  .option-follow { padding-left: 16px; }
  .star-face { width: 46px; height: 46px; }
  .star-face svg { width: 34px; height: 34px; }
  .progress-steps { grid-template-columns: 1fr; }
  .survey-nav .req-hint { order: 3; width: 100%; }
  .login-card { padding: 28px 20px; }
  .brand-title { max-width: 46vw; }
}

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