/* Lippmann Consulting Umfrage-Plattform — Mobile First */

@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/montserrat-400.woff2") format("woff2");
}
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/montserrat-600.woff2") format("woff2");
}
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/montserrat-700.woff2") format("woff2");
}

:root {
  --primary: #474972;
  --primary-dark: #35365a;
  --accent: #DCB95B;
  --accent-soft: #f7efdc;
  --text: #2b2c45;
  --text-muted: #5f6079;
  --bg: #fafafc;
  --surface: #ffffff;
  --border: #d9dae6;
  --error: #b3261e;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(71, 73, 114, 0.08), 0 4px 16px rgba(71, 73, 114, 0.06);
}

* { box-sizing: border-box; }

/* hidden-Attribut muss auch gegen display:flex gewinnen */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  font-family: "Montserrat", "Segoe UI", system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

.page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.content {
  width: 100%;
  max-width: 42rem;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 3rem;
  flex: 1;
}

h1 { font-size: 1.6rem; line-height: 1.3; color: var(--primary); }
h2 { font-size: 1.3rem; line-height: 1.35; color: var(--primary); }
h1, h2, h3 { font-weight: 700; }

a { color: var(--primary); }

.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;
}

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

/* ---------------------------------------------------------------- screens */

.screen { animation: screen-in 0.3s ease both; }

@keyframes screen-in {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: none; }
}

.screen.from-back { animation-name: screen-in-back; }

@keyframes screen-in-back {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .screen, .screen.from-back { animation: none; }
  * { transition: none !important; }
}

.intro-text { color: var(--text); }
.intro-hint { color: var(--text-muted); font-size: 0.95rem; }

/* --------------------------------------------------------------- progress */

.progress { margin-bottom: 1.75rem; }

.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.progress-text {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* -------------------------------------------------------------- questions */

.block-title { margin: 0.25rem 0 1.5rem; }

.question {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.1rem 1.2rem;
  margin-bottom: 1.25rem;
}

.question fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}

legend, .q-label {
  display: block;
  font-weight: 600;
  padding: 0;
  margin-bottom: 0.35rem;
  color: var(--text);
}

.q-label { margin-bottom: 0.5rem; }

.help {
  margin: 0.1rem 0 0.75rem;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.required-mark { color: var(--error); font-weight: 700; }
.optional-mark { color: var(--text-muted); font-weight: 400; font-size: 0.92rem; }

.question.has-error { border-color: var(--error); }

.error {
  margin: 0.6rem 0 0;
  color: var(--error);
  font-size: 0.95rem;
  font-weight: 600;
}

.global-error { margin: 1rem 0 0; text-align: center; }

/* options: radio + checkbox */

.options { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.6rem; }

.option {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  min-height: 44px;
  padding: 0.55rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.option:hover { border-color: var(--accent); }

.option input {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin: 0.15rem 0 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.option:has(input:checked) {
  border-color: var(--primary);
  background: var(--accent-soft);
}

.option:has(input:focus-visible) {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

.other-wrap { margin: 0.25rem 0 0.25rem 0.25rem; }

.other-input,
textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  padding: 0.65rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.other-input:focus, textarea:focus { border-color: var(--primary); outline: none; }

textarea {
  resize: vertical;
  min-height: 5.2rem;
  overflow: hidden;
}

/* scale 1-5 */

.scale { margin-top: 0.6rem; }

.scale-options {
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
  margin: 0.5rem 0;
}

.scale-option {
  flex: 1;
  display: flex;
  justify-content: center;
  cursor: pointer;
}

.scale-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.scale-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 2px solid var(--border);
  border-radius: 50%;
  font-weight: 600;
  transition: border-color 0.15s ease, background-color 0.15s ease,
              color 0.15s ease;
}

.scale-option:hover .scale-circle { border-color: var(--accent); }

.scale-option input:checked + .scale-circle {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.scale-option input:focus-visible + .scale-circle {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

.scale-label {
  display: block;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.scale-label-max { text-align: right; }

/* ranking */

.ranking {
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rank-btn {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  min-height: 48px;
  padding: 0.55rem 0.75rem;
  font: inherit;
  text-align: left;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.rank-btn:hover { border-color: var(--accent); }

.rank-badge {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 2px dashed var(--border);
  border-radius: 50%;
  font-size: 0.9rem;
  font-weight: 700;
  color: transparent;
}

.rank-btn[aria-pressed="true"] {
  border-color: var(--primary);
  background: var(--accent-soft);
}

.rank-btn[aria-pressed="true"] .rank-badge {
  border: 2px solid var(--accent);
  background: var(--accent);
  color: var(--primary-dark);
}

.ranking-item.dragging { opacity: 0.5; }

/* ------------------------------------------------------------ navigation */

.nav {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.nav-intro { justify-content: flex-start; }

.nav-blocks { justify-content: space-between; max-width: 42rem; margin: 1.75rem auto 0; padding: 0 1.25rem; }

.btn {
  font: inherit;
  font-weight: 600;
  min-height: 48px;
  padding: 0.65rem 1.6rem;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease,
              border-color 0.15s ease;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover { background: var(--primary-dark); border-color: var(--accent); }

.btn-primary:disabled { opacity: 0.6; cursor: wait; }

.btn-secondary {
  background: transparent;
  color: var(--primary);
  border-color: var(--border);
}

.btn-secondary:hover { border-color: var(--accent); }

/* --------------------------------------------------------------- footer */

.footer {
  border-top: 1px solid var(--border);
  padding: 1.1rem 1.25rem calc(1.1rem + env(safe-area-inset-bottom));
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-brand { margin: 0 0 0.25rem; font-weight: 600; color: var(--primary); }

.footer-links { display: flex; justify-content: center; gap: 0.6rem; }

.footer-links a { color: var(--text-muted); }

/* --------------------------------------------------------------- thanks */

.thanks-screen, .notfound-screen { text-align: center; padding-top: 3rem; }

.thanks-check {
  display: inline-flex;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

/* ---------------------------------------------------------------- admin */

.admin-screen h1 { margin-bottom: 0.25rem; }

.admin-meta { color: var(--text-muted); margin-top: 0; }

.admin-block { margin-top: 2.25rem; }

.admin-question {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem;
  margin-bottom: 1.25rem;
}

.admin-q-text { margin: 0 0 0.2rem; font-size: 1.05rem; }

.admin-q-meta { margin: 0 0 0.9rem; font-size: 0.88rem; color: var(--text-muted); }

.chart { display: flex; flex-direction: column; gap: 0.55rem; }

.chart-row {
  display: grid;
  grid-template-columns: minmax(7rem, 14rem) 1fr 2.5rem;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.92rem;
}

.chart-label { overflow-wrap: anywhere; }

.chart-track {
  display: block;
  height: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.chart-fill { fill: var(--primary); }

.chart-count { text-align: right; font-weight: 600; }

.admin-average { margin: 0.9rem 0 0; }

.admin-ranking { padding-left: 1.4rem; display: flex; flex-direction: column; gap: 0.5rem; }

.ranking-option { font-weight: 600; display: block; }

.ranking-stats { font-size: 0.9rem; color: var(--text-muted); }

.text-list {
  margin: 0.6rem 0 0;
  padding-left: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.admin-other summary { cursor: pointer; font-weight: 600; margin-top: 0.8rem; }

.admin-empty { color: var(--text-muted); font-style: italic; }

/* --------------------------------------------------------------- desktop */

@media (min-width: 640px) {
  body { font-size: 1.0625rem; }
  h1 { font-size: 2rem; }
  .content { padding-top: 3rem; }
  .scale-options { max-width: 22rem; }
  .chart-row { font-size: 0.95rem; }
}
