/* ==========================================================================
   SV Westrich 55 e.V. – Anonyme Feedbackplattform
   Mobile First · keine externen Schriften · keine Animationen
   ========================================================================== */

/* Vereinsfarben – exakt aus dem offiziellen Wappen ermittelt
   (Vollflächen des Wappens auf svwestrich.de):
   Rot  #BB1C1C  = rgb(187, 28, 28)
   Grün #066B2C  = rgb(6, 107, 44)                                          */
:root {
  --club-red: #BB1C1C;
  --club-green: #066B2C;
  --club-red-dark: #961616;     /* nur für Hover/aktive Zustände */
  --club-green-dark: #05521F;   /* nur für Hover/aktive Zustände */

  --color-bg: #ffffff;
  --color-surface: #f6f7f7;
  --color-border: #d5d9dc;
  --color-text: #1b1d1f;
  --color-muted: #5b6267;
  --color-error-bg: #fdeeee;
  --color-success-bg: #e9f4ed;
  --color-placeholder: #fff3a8;

  --bar-height: 80px;           /* roter und grüner Balken: immer gleich hoch */
  --radius: 12px;
  --radius-small: 8px;
  --tap: 52px;                  /* Mindesthöhe für Schaltflächen */
  --gutter: 16px;
  --content-width: 40rem;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  color-scheme: light;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font);
  font-size: 1.0625rem;          /* 17px – gut lesbar auf dem Handy */
  line-height: 1.55;
  overflow-x: hidden;
  overflow-wrap: break-word;
}

img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }

h1, h2 { line-height: 1.2; margin: 0 0 0.75rem; }
h1 { font-size: 1.75rem; font-weight: 800; color: var(--club-red); letter-spacing: -0.01em; }
h2 { font-size: 1.25rem; font-weight: 700; margin-top: 1.75rem; }
p { margin: 0 0 0.9rem; }
a { color: var(--club-green); text-underline-offset: 2px; }
a:hover { color: var(--club-green-dark); }

:focus-visible {
  outline: 3px solid var(--club-green);
  outline-offset: 2px;
}

.muted { color: var(--color-muted); }

/* --------------------------------------------------------------------------
   Kopfbereich: roter Balken mit Wappen
   -------------------------------------------------------------------------- */
.site-header {
  background: var(--club-red);
  color: #fff;
  padding-top: var(--safe-top);
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}
.site-header__inner {
  max-width: calc(var(--content-width) + 2 * var(--gutter));
  margin: 0 auto;
  min-height: var(--bar-height);
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.site-header__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
  min-width: 0;
}
.site-header__brand:hover { color: #fff; }
.site-header__logo { width: 56px; height: 56px; flex: none; }
.site-header__text { display: flex; flex-direction: column; min-width: 0; }
.site-header__club { font-weight: 700; font-size: 1.05rem; line-height: 1.2; }
.site-header__subtitle { font-size: 0.85rem; opacity: 0.9; line-height: 1.3; }
.site-header__action { margin: 0; flex: none; }

/* --------------------------------------------------------------------------
   Inhaltsbereich
   -------------------------------------------------------------------------- */
.site-main {
  flex: 1 0 auto;
  width: 100%;
  background: var(--color-bg);
}
.container {
  max-width: calc(var(--content-width) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 24px calc(var(--gutter) + var(--safe-right)) 28px calc(var(--gutter) + var(--safe-left));
}
.container--narrow { max-width: calc(26rem + 2 * var(--gutter)); }

.intro .lead { font-size: 1.125rem; }

/* Formular */
.feedback-form { margin-top: 1.25rem; }
.field-label {
  display: block;
  font-weight: 700;
  margin: 0 0 0.4rem;
}
textarea,
.input {
  display: block;
  width: 100%;
  font: inherit;
  font-size: 1.0625rem;          /* ≥ 16px verhindert Auto-Zoom auf iOS */
  color: var(--color-text);
  background: #fff;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  -webkit-appearance: none;
  appearance: none;
}
textarea {
  min-height: 13rem;
  resize: vertical;
  line-height: 1.5;
}
textarea:focus,
.input:focus {
  border-color: var(--club-green);
  outline: none;
  box-shadow: 0 0 0 3px rgba(6, 107, 44, 0.2);
}
textarea::placeholder { color: #8a9095; }
.input { min-height: var(--tap); margin-bottom: 1.1rem; }

.field-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0 12px;
  margin-top: 0.5rem;
}
.hint { font-size: 0.9rem; color: var(--color-muted); margin: 0; flex: 1 1 16rem; }
.counter { font-size: 0.85rem; color: var(--color-muted); margin: 0; white-space: nowrap; }

/* Meldungen */
.alert {
  border-radius: var(--radius-small);
  padding: 12px 14px;
  margin: 1rem 0;
  font-size: 1rem;
}
.alert--error { background: var(--color-error-bg); color: #8a1414; border-left: 4px solid var(--club-red); }
.alert--success { background: var(--color-success-bg); color: #064a20; border-left: 4px solid var(--club-green); }

/* Erfolgsbestätigung */
.success { text-align: center; padding: 2rem 0 1rem; outline: none; }
.success__icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--club-green);
  color: #fff;
}
.success h1 { color: var(--club-green); }

/* Impressum / Datenschutz-Links */
.legal-links {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 2rem;
  font-size: 0.9rem;
  color: var(--color-muted);
}
.legal-links a { color: var(--color-muted); padding: 6px 2px; }

/* --------------------------------------------------------------------------
   Fußbereich: grüner Balken mit Absende-Schaltfläche (bleibt am unteren Rand
   erreichbar, berücksichtigt die Safe Area von iPhones)
   -------------------------------------------------------------------------- */
.action-bar {
  position: sticky;
  bottom: 0;
  z-index: 10;
  background: var(--club-green);
  padding: 0 calc(var(--gutter) + var(--safe-right)) var(--safe-bottom) calc(var(--gutter) + var(--safe-left));
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.12);
}
.action-bar__inner {
  max-width: var(--content-width);
  min-height: var(--bar-height);
  margin: 0 auto;
  display: flex;
  align-items: center;
}

/* Grüner Fußbalken auf allen übrigen Seiten – gleiche Höhe wie der rote Kopfbalken */
.site-footer {
  background: var(--club-green);
  color: #fff;
  padding: 0 calc(var(--gutter) + var(--safe-right)) var(--safe-bottom) calc(var(--gutter) + var(--safe-left));
}
.site-footer__inner {
  min-height: var(--bar-height);
  display: flex;
  align-items: center;
  justify-content: center;
}
.site-footer .legal-links { margin: 0; color: rgba(255, 255, 255, 0.8); }
.site-footer .legal-links a { color: #fff; }

/* --------------------------------------------------------------------------
   Schaltflächen
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: var(--tap);
  padding: 12px 22px;
  border: 2px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn:disabled { opacity: 0.7; cursor: progress; }
.btn--block { display: flex; width: 100%; }

/* Haupt-Schaltfläche im grünen Balken: weiß, maximal sichtbar */
.btn--primary {
  display: flex;
  width: 100%;
  min-height: 56px;
  font-size: 1.15rem;
  background: #fff;
  color: var(--club-green);
}
.btn--primary:hover { background: #f0f5f2; color: var(--club-green-dark); }

.btn--green { background: var(--club-green); color: #fff; }
.btn--green:hover { background: var(--club-green-dark); color: #fff; }

.btn--secondary { background: #fff; color: var(--color-text); border-color: var(--color-border); }
.btn--secondary:hover { background: var(--color-surface); color: var(--color-text); }

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

.btn--danger-outline { background: #fff; color: var(--club-red); border-color: var(--club-red); }
.btn--danger-outline:hover { background: var(--color-error-bg); }

.btn--small { min-height: 44px; padding: 8px 16px; font-size: 0.98rem; }

.btn--header {
  min-height: 44px;
  padding: 8px 14px;
  font-size: 0.95rem;
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.75);
}
.btn--header:hover { background: rgba(255, 255, 255, 0.15); }

.link-button { font-weight: 700; }

/* --------------------------------------------------------------------------
   Login
   -------------------------------------------------------------------------- */
.login-form { margin-top: 1.25rem; }
.login-form .btn { margin-top: 0.5rem; }

/* --------------------------------------------------------------------------
   Vorstandsbereich: Feedbackliste
   -------------------------------------------------------------------------- */
.poster-link { margin: 0.25rem 0 1.5rem; }
.empty {
  text-align: center;
  color: var(--color-muted);
  padding: 2.5rem 1rem;
  background: var(--color-surface);
  border-radius: var(--radius);
}
.feedback-list { list-style: none; margin: 0; padding: 0; }
.feedback-item {
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--club-green);
  border-radius: var(--radius);
  padding: 14px 16px 12px;
  margin-bottom: 14px;
  background: #fff;
}
.feedback-item__date {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-muted);
  margin-bottom: 0.4rem;
}
.feedback-item__text {
  white-space: pre-wrap;          /* Zeilenumbrüche erhalten */
  overflow-wrap: anywhere;        /* lange Wörter/Links umbrechen – kein Querscrollen */
  margin-bottom: 0.75rem;
}
.feedback-item--preview { margin: 1.25rem 0; }
.delete-form { display: flex; justify-content: flex-end; margin: 0; }

/* Sicherheitsabfrage */
.dialog {
  width: calc(100% - 2 * var(--gutter));
  max-width: 26rem;
  border: 0;
  border-radius: var(--radius);
  padding: 22px 20px 18px;
  color: var(--color-text);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}
.dialog::backdrop { background: rgba(0, 0, 0, 0.5); }
.dialog h2 { margin-top: 0; font-size: 1.2rem; }
.dialog__actions {
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  margin-top: 1.25rem;
}
.dialog__actions .btn { width: 100%; }
.confirm-box h1 { font-size: 1.4rem; }

/* --------------------------------------------------------------------------
   Rechtliche Seiten
   -------------------------------------------------------------------------- */
.legal h1 { font-size: 1.6rem; }
.legal h2 { font-size: 1.15rem; color: var(--club-green); }
.legal ul { padding-left: 1.25rem; margin: 0 0 0.9rem; }
.legal li { margin-bottom: 0.35rem; }
.placeholder {
  background: var(--color-placeholder);
  color: #5a4a00;
  padding: 0 4px;
  border-radius: 4px;
  font-weight: 600;
}
.back-link { display: inline-block; margin-top: 1.5rem; font-weight: 700; }

/* --------------------------------------------------------------------------
   Installer
   -------------------------------------------------------------------------- */
.setup fieldset {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 14px 16px 4px;
  margin: 0 0 1.25rem;
  min-width: 0;
}
.setup legend { font-weight: 800; padding: 0 6px; color: var(--club-green); }
.setup .help { font-size: 0.88rem; color: var(--color-muted); margin: -0.7rem 0 1rem; }
.setup .help--top { margin-top: 0; }
.setup ol { padding-left: 1.25rem; }
.setup code, .setup .code {
  font-family: ui-monospace, SFMono-Regular, Consolas, Menlo, monospace;
  font-size: 0.9rem;
  background: var(--color-surface);
  padding: 1px 5px;
  border-radius: 4px;
  overflow-wrap: anywhere;
}
.setup textarea.code { min-height: 18rem; font-size: 0.8rem; white-space: pre; }

/* --------------------------------------------------------------------------
   Desktop: etwas großzügiger
   -------------------------------------------------------------------------- */
@media (min-width: 48rem) {
  :root { --bar-height: 92px; }
  h1 { font-size: 2.1rem; }
  .container { padding-top: 36px; }
  .site-header__logo { width: 64px; height: 64px; }
  .dialog__actions { flex-direction: row; justify-content: flex-end; }
  .dialog__actions .btn { width: auto; }
  .action-bar { position: static; }
  .page-feedback .site-main { flex-grow: 1; }
}

/* ==========================================================================
   QR-Code-Aushang (DIN A4, Hochformat)
   Der Bogen skaliert am Bildschirm über Container-Einheiten (cqw); im Druck ist
   er exakt 210 × 297 mm groß – Vorschau und Ausdruck sind damit identisch.
   ========================================================================== */
.poster-page { background: #e9ecee; }
.poster-main { background: transparent; }
.poster-toolbar {
  max-width: 210mm;
  margin: 0 auto;
  padding: calc(16px + var(--safe-top)) calc(var(--gutter) + var(--safe-right)) 8px calc(var(--gutter) + var(--safe-left));
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.poster-toolbar .btn { flex: 1 1 12rem; }
.poster-toolbar__hint { flex-basis: 100%; font-size: 0.88rem; color: var(--color-muted); margin: 4px 0 0; }

.poster-stage {
  padding: 8px calc(var(--gutter) + var(--safe-right)) calc(24px + var(--safe-bottom)) calc(var(--gutter) + var(--safe-left));
}

.sheet {
  container-type: inline-size;
  width: 100%;
  max-width: 210mm;
  aspect-ratio: 210 / 297;
  margin: 0 auto;
  background: #fff;
  color: #1b1d1f;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

/* Roter und grüner Balken sind exakt gleich hoch. */
.sheet { --sheet-bar: 14cqw; }

.sheet__top {
  position: relative;
  flex: none;
  height: var(--sheet-bar);
  background: var(--club-red);
}
.sheet__logo {
  position: absolute;
  left: 50%;
  top: 2.5cqw;
  width: 23cqw;
  height: 23cqw;
  transform: translateX(-50%);
}

.sheet__body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  gap: 1cqw;
  text-align: center;
  padding: 13cqw 8cqw 3cqw;
}
.sheet__headline {
  margin: 0;
  font-size: 7.6cqw;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.015em;
  text-transform: uppercase;
  color: var(--club-red);
}
.sheet__question {
  margin: 0;
  font-size: 4.4cqw;
  font-weight: 800;
  line-height: 1.2;
  color: var(--club-green);
}
.sheet__text {
  margin: 0;
  font-size: 2.8cqw;
  line-height: 1.45;
  color: #3a4044;
}
.sheet__qr-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.6cqw;
  padding: 2.4cqw 2.4cqw 2.2cqw;
  border: 0.55cqw solid var(--club-green);
  border-radius: 4cqw;
  background: #fff;
}
.sheet__qr { width: 38cqw; height: 38cqw; }
.sheet__qr svg { width: 100%; height: 100%; }
.sheet__cta {
  margin: 0;
  padding: 1.3cqw 3.2cqw;
  border-radius: 999px;
  background: var(--club-green);
  color: #fff;
  font-size: 3.1cqw;
  font-weight: 800;
  line-height: 1.2;
}
.sheet__pills {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.6cqw;
}
.sheet__pills li {
  padding: 0.9cqw 2.6cqw;
  border: 0.35cqw solid var(--club-red);
  border-radius: 999px;
  color: var(--club-red);
  font-size: 2.7cqw;
  font-weight: 700;
  line-height: 1.2;
}
.sheet__url {
  margin: 0;
  font-size: 3.3cqw;
  font-weight: 800;
  color: var(--club-green);
  overflow-wrap: anywhere;
}
.sheet__url span { font-weight: 500; color: #5b6267; font-size: 2.7cqw; }
.sheet__bottom {
  flex: none;
  height: var(--sheet-bar);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--club-green);
  color: #fff;
  font-size: 4.6cqw;
  font-weight: 800;
  letter-spacing: 0.03em;
}

@page {
  size: A4 portrait;
  margin: 0;
}

@media print {
  html, body { background: #fff !important; min-height: 0 !important; height: auto; }
  body { display: block; }
  .poster-toolbar { display: none !important; }
  .poster-stage { padding: 0; }
  .sheet {
    width: 210mm;
    max-width: none;
    height: 296.5mm;          /* minimal kleiner als A4, verhindert eine leere 2. Seite */
    aspect-ratio: auto;
    margin: 0;
    box-shadow: none;
    break-inside: avoid;
    page-break-inside: avoid;
  }
}
