/* ───────────────────────────────────────────────────────────────────────────
   Hit-Liste – App CSS  ·  WIMASU CI (Lila-led)
   Handgepflegt; nutzbar ohne Build-Step. CSS-Variablen für CI-Tokens.
   ─────────────────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* WIMASU Core */
  --w-lila:      #7D64DD;
  --w-lila-dk:   #5F46BF;
  --w-lila-tint: #EFEAFB;
  --w-red:       #FF6B6B;
  --w-red-dk:    #E25555;
  --w-red-tint:  #FFE1E1;
  --w-green:     #34A798;
  --w-green-dk:  #2A8A7D;
  --w-green-tint:#D6EFEB;
  --w-yellow:    #FDC842;
  --w-yellow-dk: #D9A82A;
  --w-yellow-tint:#FFF4D1;
  --w-gray:      #F3F4F5;
  --w-gray-2:    #E3E5E8;
  --w-charcoal:  #25282A;
  --w-blue:      #2274AE;  /* nur für a:hover, sonst nicht */

  /* Semantic */
  --c-text:    var(--w-charcoal);
  --c-muted:   #6b7280;
  --c-border:  var(--w-gray-2);
  --c-bg:      var(--w-gray);
  --c-surface: #ffffff;

  --radius:    .6rem;
  --radius-lg: 1rem;
  --shadow-sm: 0 1px 2px rgba(37,40,42,.06);
  --shadow:    0 1px 3px rgba(37,40,42,.08), 0 1px 2px rgba(37,40,42,.06);
  --shadow-lg: 0 12px 28px -8px rgba(124,91,217,.20), 0 8px 12px -6px rgba(37,40,42,.06);

  font-size: 16px;
}

/* ── Typography ─────────────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }
body {
  font-family: "Azo Sans", Calibri, "Helvetica Neue", system-ui, -apple-system, sans-serif;
  color: var(--c-text);
  background: var(--c-bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-weight: 700; letter-spacing: -.015em; line-height: 1.2; }
h1 { font-size: 2rem; }
h2 { font-size: 1.375rem; margin-bottom: .5rem; }
h3 { font-size: 1.125rem; margin-bottom: .25rem; }

a { color: var(--w-lila-dk); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--w-blue); }

/* ── Layout shell ───────────────────────────────────────────────────────── */
.site-header {
  background: var(--w-lila);
  padding: .8rem 1rem;
  box-shadow: var(--shadow-sm);
}
.site-header__inner {
  max-width: 72rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: .9rem;
}
.site-header__logo {
  height: 2.4rem;
  width: auto;
  display: block;
}
.site-header__brand {
  color: #fff;
  text-decoration: none;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1;
}
.site-header__slogan {
  color: #fff;
  opacity: .9;
  font-size: .8rem;
  margin-left: auto;
  font-style: italic;
}
.site-header__slogan strong { font-style: normal; font-weight: 700; }
@media (max-width: 640px) { .site-header__slogan { display: none; } }

.container {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}
.container--narrow { max-width: 44rem; }

.site-footer {
  text-align: center;
  padding: 1.5rem 1rem 2rem;
  color: var(--c-muted);
  font-size: .8125rem;
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
}
.site-footer a { color: var(--w-lila-dk); }
.site-footer__slogan {
  margin-top: .5rem;
  font-style: italic;
  color: var(--w-charcoal);
}
.site-footer__slogan strong { font-style: normal; font-weight: 700; color: var(--w-red); }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: .65rem 1.4rem;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  font-family: inherit;
  transition: background .15s ease, transform .05s ease, box-shadow .15s ease;
  line-height: 1.2;
  min-height: 44px;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--w-yellow); outline-offset: 2px; }

.btn-primary {
  background: var(--w-lila);
  color: #fff;
  box-shadow: 0 4px 10px rgba(125,100,221,.30);
}
.btn-primary:hover { background: var(--w-lila-dk); }

.btn-outline {
  background: transparent;
  border-color: var(--w-lila);
  color: var(--w-lila);
}
.btn-outline:hover { background: var(--w-lila); color: #fff; }

.btn-danger {
  background: var(--w-red);
  color: #fff;
}
.btn-danger:hover { background: var(--w-red-dk); }

.btn-ghost {
  background: transparent;
  color: var(--w-lila-dk);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--w-lila-tint); }

.btn-large {
  font-size: 1.125rem;
  padding: .85rem 2rem;
}
.btn-hero {
  font-size: 1.1875rem;
  padding: .95rem 2.5rem;
  border-radius: 999px;
  margin-top: .5rem;
}
.btn-block { width: 100%; }
.inline-form { display: inline-block; }

/* ── Alerts & Notices ───────────────────────────────────────────────────── */
.alert {
  padding: .85rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  border-left: 4px solid;
  background: var(--c-surface);
}
.alert-error { background: var(--w-red-tint); border-color: var(--w-red); }
.alert ul { padding-left: 1.25rem; }
.notice { padding: 1rem 1.25rem; border-radius: var(--radius); margin: 1rem 0; background: var(--c-surface); }
.notice-warn { background: var(--w-yellow-tint); border-left: 4px solid var(--w-yellow); }

/* ── Hero & Home concept ────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 3rem 1rem 3.5rem;
  background: linear-gradient(180deg, #fff 0%, var(--w-lila-tint) 100%);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.hero h1 {
  font-size: 2.75rem;
  margin-bottom: .5rem;
  color: var(--w-charcoal);
}
.hero h1 span { color: var(--w-red); }
.lead {
  color: var(--c-muted);
  max-width: 36rem;
  margin: 0 auto 1.75rem;
  font-size: 1.0625rem;
}
.concept-card {
  margin-top: 2rem;
  background: var(--c-surface);
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  border-left: 4px solid var(--w-yellow);
  box-shadow: var(--shadow-sm);
  text-align: left;
  max-width: 38rem;
  margin-left: auto;
  margin-right: auto;
}
.concept-card h2 { font-size: 1.125rem; margin-bottom: .5rem; color: var(--w-lila-dk); }
.concept-card p { color: var(--c-text); font-size: .9375rem; }

/* ── Wizard / mode cards ────────────────────────────────────────────────── */
.wizard-step {
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.wizard-step__num {
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  color: var(--w-lila);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: .25rem;
}

.mode-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  margin-top: 1rem;
}
.mode-card {
  display: block;
  background: var(--c-surface);
  border: 2px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  position: relative;
  transition: border-color .15s, box-shadow .15s, transform .05s;
}
.mode-card:hover { border-color: var(--w-lila); box-shadow: var(--shadow-lg); }
.mode-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.mode-card input[type="radio"]:checked ~ .mode-card__inner {
  /* style applied through wrapper instead below */
}
.mode-card--active {
  border-color: var(--w-lila);
  background: var(--w-lila-tint);
  box-shadow: var(--shadow-lg);
}
.mode-card__icon {
  font-size: 1.75rem;
  margin-bottom: .5rem;
  display: block;
}
.mode-card__title {
  font-weight: 700;
  font-size: 1.0625rem;
  margin-bottom: .25rem;
  color: var(--w-charcoal);
}
.mode-card__desc {
  font-size: .875rem;
  color: var(--c-muted);
  line-height: 1.45;
}

/* ── Forms ──────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-row {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  margin-bottom: 1.25rem;
}
label {
  display: block;
  font-weight: 700;
  margin-bottom: .3rem;
  font-size: .9rem;
  color: var(--w-charcoal);
}
.label-hint {
  font-weight: 400;
  font-size: .8rem;
  color: var(--c-muted);
  display: block;
  margin-top: -.15rem;
  margin-bottom: .35rem;
}
input[type="text"],
input[type="number"],
input[type="email"],
select,
textarea {
  display: block;
  width: 100%;
  padding: .65rem .85rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  font-size: 1rem;
  background: #fff;
  color: var(--c-text);
  font-family: inherit;
  appearance: auto;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--w-lila);
  box-shadow: 0 0 0 3px var(--w-lila-tint);
}

/* Radio group ("Geschlecht", "Format") as a chip-row */
.chip-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip-row label {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .45rem .85rem;
  border: 2px solid var(--c-border);
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: .9rem;
  user-select: none;
  background: #fff;
  transition: border-color .15s, background .15s;
  margin-bottom: 0;
}
.chip-row input[type="radio"] {
  appearance: none;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--c-muted);
  border-radius: 50%;
  display: inline-block;
  position: relative;
  background: #fff;
}
.chip-row input[type="radio"]:checked {
  background: var(--w-lila);
  border-color: var(--w-lila);
  box-shadow: inset 0 0 0 2.5px #fff;
}
.chip-row label:has(input:checked) {
  border-color: var(--w-lila);
  background: var(--w-lila-tint);
  color: var(--w-lila-dk);
}

/* ── Intro text block (Schüler:innen) ───────────────────────────────────── */
.intro {
  background: var(--c-surface);
  border-left: 4px solid var(--w-yellow);
  border-radius: var(--radius);
  padding: 1.1rem 1.35rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  white-space: pre-wrap;
  line-height: 1.6;
  font-size: .9375rem;
}
.intro details summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--w-lila-dk);
  margin-bottom: .5rem;
}
.intro__greeting {
  font-weight: 700;
  margin-bottom: .25rem;
  color: var(--w-charcoal);
}
.intro__name {
  color: var(--w-lila-dk);
}
.intro__body { display: block; }

/* ── Hit-List Rows (Schüler:innen) ──────────────────────────────────────── */
.hitlist {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  margin: 1rem 0 1.5rem;
}
.hit-row {
  display: grid;
  grid-template-columns: minmax(4.5rem, auto) auto 1fr;
  align-items: center;
  gap: .65rem;
  padding: .55rem .8rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: var(--c-surface);
  box-shadow: var(--shadow-sm);
}
.hit-row__notation {
  font-weight: 700;
  font-size: 1.15rem;
  white-space: nowrap;
  text-align: center;
  letter-spacing: .04em;
  min-width: 3.5rem;
}
.hit-row__icon {
  width: 28px;
  height: 28px;
  display: inline-block;
}
.hit-row input[type="text"] {
  background: rgba(255,255,255,.7);
  border-color: transparent;
}
.hit-row input[type="text"]:focus {
  background: #fff;
  border-color: var(--w-lila);
}

.hit-row--love {
  background: var(--w-green-tint);
  border-color: var(--w-green);
}
.hit-row--love .hit-row__notation,
.hit-row--love .hit-row__icon { color: var(--w-green-dk); }

.hit-row--mid {
  background: var(--w-yellow-tint);
  border-color: var(--w-yellow);
}
.hit-row--mid .hit-row__notation,
.hit-row--mid .hit-row__icon { color: var(--w-yellow-dk); }

.hit-row--hate {
  background: var(--w-red-tint);
  border-color: var(--w-red);
}
.hit-row--hate .hit-row__notation,
.hit-row--hate .hit-row__icon { color: var(--w-red-dk); }

/* Intensity nuance: stronger tint at the outer rows */
.hit-row--love.is-strong-3 { background: color-mix(in srgb, var(--w-green-tint) 70%, var(--w-green) 8%); }
.hit-row--hate.is-strong-3 { background: color-mix(in srgb, var(--w-red-tint)   70%, var(--w-red)   8%); }

/* On mobile, stack the input below the label */
@media (max-width: 520px) {
  .hit-row {
    grid-template-columns: auto auto 1fr;
  }
}

/* ── Autocomplete dropdown ──────────────────────────────────────────────── */
.suggest-wrapper { position: relative; }
.suggest-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: #fff;
  border: 1px solid var(--c-border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  max-height: 14rem;
  overflow-y: auto;
  z-index: 100;
  box-shadow: var(--shadow-lg);
}
.suggest-item {
  padding: .55rem .85rem;
  cursor: pointer;
  font-size: .95rem;
}
.suggest-item:hover,
.suggest-item.active { background: var(--w-lila-tint); color: var(--w-lila-dk); font-weight: 600; }

/* ── Created page ───────────────────────────────────────────────────────── */
.created-headline { margin-bottom: 1rem; }
.id-badge {
  display: inline-block;
  font-size: .95rem;
  color: var(--c-muted);
  background: var(--c-surface);
  padding: .3rem .9rem;
  border-radius: 999px;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}
.id-badge strong {
  display: inline-block;
  font-size: 1.4rem;
  letter-spacing: .15em;
  color: var(--w-charcoal);
  margin-left: .35rem;
}

.qr-card {
  background: var(--c-surface);
  border: 3px solid var(--w-green);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow);
  max-width: 22rem;
  margin: 1rem 0;
}
.qr-card h2 { color: var(--w-green-dk); margin-bottom: .5rem; }
.qr-card img { max-width: 100%; height: auto; display: block; margin: .75rem auto; }
.qr-card .qr-url {
  word-break: break-all;
  font-size: .8rem;
  color: var(--c-muted);
  margin-top: .25rem;
}

.teacher-link {
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--w-lila);
  margin: 1rem 0;
}
.teacher-link h2 { color: var(--w-lila-dk); margin-bottom: .35rem; }
.teacher-link__warn {
  color: var(--w-red);
  font-weight: 600;
  font-size: .85rem;
  margin-bottom: .65rem;
}
.teacher-link__row {
  display: flex;
  gap: .5rem;
  align-items: stretch;
}
.teacher-link__input {
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-size: .85rem;
  background: var(--c-bg);
  flex: 1;
}
.copy-btn { white-space: nowrap; }
.copy-btn[data-state="copied"] { background: var(--w-green); }

.created-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1.25rem; }

/* ── Results page ───────────────────────────────────────────────────────── */
.results-header {
  background: var(--c-surface);
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.meta-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .25rem .85rem;
  margin: .75rem 0;
  font-size: .9rem;
}
.meta-grid dt { font-weight: 700; color: var(--c-muted); }
.status-open   { color: var(--w-green-dk); font-weight: 700; }
.status-closed { color: var(--c-muted); }

.gender-bar { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0; font-size: .85rem; }
.gender-bar > span {
  background: var(--c-bg);
  padding: .25rem .7rem;
  border-radius: 999px;
}

/* Histogram for target item (subject / spotlight modes) */
.histogram {
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
  border-top: 4px solid var(--w-lila);
}
.histogram h2 { color: var(--w-lila-dk); margin-bottom: .25rem; }
.histogram__avg { font-size: .9rem; color: var(--c-muted); margin-bottom: 1rem; }
.histogram__rows {
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.histogram__row {
  display: grid;
  grid-template-columns: 3rem 1fr 2.5rem;
  align-items: center;
  gap: .6rem;
  font-size: .875rem;
}
.histogram__notation {
  font-weight: 700;
  text-align: center;
  letter-spacing: .04em;
}
.histogram__bar {
  background: var(--c-bg);
  border-radius: 999px;
  height: 1.1rem;
  overflow: hidden;
}
.histogram__fill {
  height: 100%;
  border-radius: 999px;
  background: var(--w-lila);
  transition: width .3s ease;
}
.histogram__row[data-category="love"] .histogram__fill { background: var(--w-green); }
.histogram__row[data-category="mid"]  .histogram__fill { background: var(--w-yellow); }
.histogram__row[data-category="hate"] .histogram__fill { background: var(--w-red); }
.histogram__count { text-align: right; font-variant-numeric: tabular-nums; color: var(--c-muted); }

/* Rankings */
.rankings {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  margin-bottom: 1.25rem;
}
.ranking {
  background: var(--c-surface);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-lg);
  border-top: 4px solid;
  box-shadow: var(--shadow-sm);
}
.ranking--love { border-top-color: var(--w-green); }
.ranking--hate { border-top-color: var(--w-red); }
.ranking--love h2 { color: var(--w-green-dk); }
.ranking--hate h2 { color: var(--w-red-dk); }
.ranking ol { padding-left: 1.5rem; margin-top: .35rem; }
.ranking li { padding: .25rem 0; }
.score { color: var(--c-muted); font-size: .85rem; }

.individual-responses { margin: 1.25rem 0; }
.individual-responses summary {
  cursor: pointer;
  font-weight: 700;
  padding: .55rem 0;
  color: var(--w-lila-dk);
}
.table-scroll {
  overflow-x: auto;
  background: var(--c-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.responses-table { border-collapse: collapse; font-size: .85rem; min-width: 100%; }
.responses-table th, .responses-table td {
  border: 1px solid var(--c-border);
  padding: .4rem .65rem;
  white-space: nowrap;
}
.responses-table th { background: var(--c-bg); font-weight: 700; }
.results-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1.5rem; }

/* ── Thanks ─────────────────────────────────────────────────────────────── */
.thanks { text-align: center; padding: 3rem 1rem; }
.thanks-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 50%;
  background: var(--w-green);
  color: #fff;
  font-size: 3rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 8px 24px -8px rgba(52,167,152,.6);
}
.thanks h1 { font-size: 2rem; margin-bottom: .5rem; }

/* ── Error ──────────────────────────────────────────────────────────────── */
.error-page { text-align: center; padding: 3rem 1rem; }
.error-page h1 { font-size: 2rem; margin-bottom: 1rem; color: var(--w-red); }

/* ── Print ──────────────────────────────────────────────────────────────── */
@media print {
  .site-header, .site-footer, .created-actions, .results-actions, .copy-btn { display: none; }
  body { background: #fff; }
  .qr-card { box-shadow: none; border-color: #000; max-width: none; }
}
