/* ============================================================
   FLEXIFEET Support – Stylesheet
   Mobile-first: Die Seite wird fast ausschließlich per QR-Code
   vom Smartphone aus aufgerufen.
   ============================================================ */

/* Markenfarben direkt von der Verpackung abgenommen:
   das Marineblau des Kopfbands und das Gelb des Titelbalkens.
   Gelb trägt auf Weiß keinen Text (zu wenig Kontrast) – es ist hier
   Akzent, kein Textton. Im Dunkelmodus kehrt sich das um: dort ist
   Gelb gut lesbar, das Blau muss dafür aufgehellt werden. */
:root {
  --brand:        #22315a;   /* FLEXIFEET-Marineblau */
  --brand-dark:   #16224a;   /* eine Nuance dunkler, für Hover */
  --accent:       #f3d10d;   /* FLEXIFEET-Gelb */
  --link:         #22315a;   /* Textfarbe für Links und Textschalter */
  --brand-band:   #22315a;   /* Kopfband – bleibt in beiden Modi das Verpackungsblau */
  --brand-line:   #22315a;   /* Symbole, Rahmen, Fokusring – alles, was kein
                                Hintergrund ist und sich abheben muss */
  --wa:           #25d366;   /* WhatsApp-Grün */
  --amazon:       #ff9900;   /* Amazon-Orange */
  --bg:           #f7f8f8;
  --surface:      #ffffff;
  --text:         #16211f;
  --muted:        #5d6b68;
  --line:         #e3e8e7;
  --radius:       14px;
  --shadow:       0 1px 2px rgba(16,24,22,.06), 0 8px 24px rgba(16,24,22,.06);
  --maxw:         720px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:      #0f1420;
    --surface: #182031;
    --text:    #eef1f7;
    --muted:   #a3aec4;
    --line:    #2b3550;
    --shadow:  0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.3);

    /* Das Verpackungsblau wäre hier fast unsichtbar – aufgehellt, aber
       noch dunkel genug, dass weiße Schrift auf Schaltflächen trägt. */
    --brand:      #3c558f;
    --brand-dark: #4a66a8;
    --link:       #ffd84d;
    /* Das aufgehellte Blau ist für Schaltflächen gedacht. Als ganzes
       Kopfband wäre es zu hell und würde über der dunklen Seite leuchten –
       das Band bleibt deshalb beim Verpackungston, nur eine Spur tiefer. */
    --brand-band: #1a2444;
    /* Auf der dunklen Karte kommt das Blau nur auf 2,2:1 – Symbole und
       Rahmen verschwinden darin fast. Aufgehellt sind es 7,8:1. Als
       Schaltflächenfarbe taugt dieser Ton nicht (weiße Schrift darauf
       wäre unlesbar), deshalb ein eigenes Token. */
    --brand-line: #9db4e8;
  }
}

* { box-sizing: border-box; }

/* Kacheln sind display:grid – das würde das hidden-Attribut überstimmen.
   Diese Zeile sorgt dafür, dass ausgeblendet auch ausgeblendet bleibt. */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

h1 { font-size: 1.7rem; line-height: 1.25; margin: 0 0 8px; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; margin: 0 0 4px; letter-spacing: -.005em; }
p  { margin: 0 0 12px; }
a  { color: var(--link); }

.muted { color: var(--muted); }
.small { font-size: .875rem; }
.footnote { margin-top: 16px; margin-bottom: 0; }

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

/* ---------- Kopfbereich ----------
   Marineblaues Band mit gelbem Abschluss, wie der Kopf der Verpackung.
   Wer den QR-Code scannt, soll die Marke sofort wiedererkennen. */
.site-header {
  background: var(--brand-band);
  border-bottom: 3px solid var(--accent);
  color: #fff;
  position: sticky; top: 0; z-index: 10;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; min-height: 58px;
}
/* Logo und Zusatz stehen auf derselben Grundlinie. Die Unterkante der
   SVG ist genau die Schriftlinie des Wortes (der Fuß ragt nur nach oben),
   deshalb reicht align-items: baseline – ohne Korrekturwerte, die bei
   anderer Schriftgröße wieder verrutschen würden. */
.brand-block { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.brand { display: block; line-height: 0; text-decoration: none; color: inherit; }
.brand-logo { height: 26px; width: auto; display: block; }
.brand-sub {
  color: rgba(255, 255, 255, .7);
  font-size: .72rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
}
@media (max-width: 380px) { .brand-sub { display: none; } }

.lang-switch select {
  appearance: none;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 999px;
  color: #fff;
  padding: 7px 12px;
  font-size: .9rem;
  min-height: 38px;
}
/* Das aufgeklappte Menü zeichnet das Betriebssystem – dort gilt wieder
   die normale Schriftfarbe, sonst steht Weiß auf Weiß. */
.lang-switch select option { color: var(--text); background: var(--surface); }

/* ---------- Hero ---------- */
.hero { padding: 28px 0 20px; }
.lead { font-size: 1.05rem; color: var(--muted); margin-bottom: 6px; }

/* ---------- Karten ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin: 0 0 20px;
}

section > h2 { margin-bottom: 10px; }
#channels { margin-bottom: 24px; }

/* Damit der klebende Kopfbereich beim Springen nichts verdeckt */
section { scroll-margin-top: 72px; }

/* ---------- Formularfelder ---------- */
.field { margin: 0 0 14px; }
.field:last-child { margin-bottom: 0; }
.field label { display: block; font-size: .875rem; font-weight: 600; margin-bottom: 6px; }

.field-row { display: grid; grid-template-columns: 1fr; gap: 0; }
@media (min-width: 560px) {
  .field-row { grid-template-columns: 1fr 1fr; gap: 0 14px; }
}

input[type=text], input[type=email], select, textarea {
  width: 100%;
  font: inherit;
  color: inherit;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  min-height: 46px;          /* großzügige Touch-Ziele */
}
textarea { min-height: 120px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible, .channel:focus-visible {
  outline: 2px solid var(--brand-line);
  outline-offset: 2px;
}
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] {
  border-color: #dc2626;
}

.field--check { display: flex; align-items: flex-start; gap: 10px; }
.field--check input { width: 20px; height: 20px; min-height: 0; margin-top: 3px; flex: none; }
.field--check label { font-weight: 400; font-size: .875rem; margin: 0; }

/* Honeypot – für Nutzer unsichtbar, aber nicht display:none (Bots erkennen das) */
.hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-weight: 600;
  border-radius: 10px; border: 1px solid transparent;
  padding: 12px 18px; min-height: 48px; cursor: pointer;
  text-decoration: none;
}
.btn--primary { background: var(--brand); color: #fff; width: 100%; }
.btn--primary:hover { background: var(--brand-dark); }
.btn--primary[disabled] { opacity: .6; cursor: progress; }

.btn--ifu {
  background: var(--brand); color: #fff; width: 100%; margin-top: 4px;
}
.btn--ifu:hover { background: var(--brand-dark); }
.btn--ghost {
  background: transparent; color: inherit; border-color: var(--line);
  width: 100%; margin-top: 8px; font-weight: 500;
}

/* ---------- Kanalauswahl ---------- */
.grid { display: grid; gap: 12px; }

.channel {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  color: inherit;
  text-decoration: none;
  font: inherit;
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease;
}
.channel:hover { transform: translateY(-1px); border-color: var(--brand-line); }
.channel-icon { display: flex; align-items: center; justify-content: center; }
.channel--wa     .channel-icon { color: var(--wa); }
.channel--amazon .channel-icon { color: var(--amazon); }
.channel--form .channel-icon,
.channel--mail .channel-icon { color: var(--brand-line); }
.channel-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.channel-body strong { font-size: 1rem; }
.channel-cta {
  font-size: .85rem; font-weight: 600; color: var(--link);
  white-space: nowrap;
}
@media (max-width: 420px) {
  .channel { grid-template-columns: 40px 1fr; }
  .channel-cta { grid-column: 2; }
}

/* Hinweis unter dem Anliegen-Feld im Formular */
.topic-hint {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: .85rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ---------- Produktauswahl mit Bildern ----------
   Die Namen liegen dicht beieinander (Zehenspreizer, Aktiv-Zehenspreizer,
   Hallux-valgus-Zehenspreizer). Am Bild der Verpackung erkennt der Kunde
   sein Produkt sofort, am Text kaum. */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 14px;
}
@media (min-width: 560px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  /* Zugeklappt sind es drei Produkte plus "Weitere Produkte" – vier Spalten
     halten die Auswahl dann in einer einzigen Zeile. Aufgeklappt bleibt es
     bei drei, damit die Namen nicht dreizeilig umbrechen. */
  .product-grid.is-compact { grid-template-columns: repeat(4, 1fr); }
}

.product-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 8px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: center;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.product-tile:hover { border-color: var(--brand-line); }
.product-tile.is-selected {
  border-color: var(--brand-line);
  box-shadow: 0 0 0 2px var(--brand-line) inset;
}
.product-tile-name { font-size: .82rem; line-height: 1.3; font-weight: 600; }

/* Bildflaeche - immer quadratisch, damit das Raster ruhig bleibt,
   auch wenn die Aufnahmen unterschiedliche Formate haben. */
.product-img {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
}
.product-img img { width: 100%; height: 100%; object-fit: contain; }
.product-img--small { width: 64px; flex: none; }

/* Tritt an die Stelle des Bildes, solange keines hinterlegt ist */
.product-img-fallback {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .06em;
  color: #64748b;
  background: repeating-linear-gradient(45deg, #f1f5f9 0 8px, #e2e8f0 8px 16px);
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
}

/* Kachel "Weitere Produkte" - klappt den Rest des Sortiments auf.
   Bewusst ohne Foto und in gedeckten Toenen, damit sie neben den
   Verpackungen als Schalter und nicht als Produkt gelesen wird. */
.product-tile--more .product-img {
  background: var(--bg);
  border: 1px dashed var(--line);
}
.product-more-mark {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--link);
  letter-spacing: -.02em;
}

/* Gewaehltes Produkt, wenn der Kunde per QR-Code kam */
.product-chosen {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 10px;
  border: 1px solid var(--brand-line);
  border-radius: 12px;
  background: var(--bg);
}
.product-chosen-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.product-change { margin: 8px 0 0; }

.linklike {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: .85rem;
  color: var(--link);
  text-decoration: underline;
  cursor: pointer;
}
@media (prefers-color-scheme: dark) {
  .product-img-fallback {
    color: #94a3b8;
    background: repeating-linear-gradient(45deg, #1e293b 0 8px, #273449 8px 16px);
  }
}

/* ---------- Aufklappbare Kachel (Kontaktformular) ----------
   Kachel und Formular sind EIN Block: Die Umrandung sitzt auf der Gruppe,
   die Kachel darin verliert ihre eigene. Dadurch wächst beim Öffnen die
   bestehende Karte nach unten, statt dass eine zweite darunter erscheint. */
.channel-group {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: border-color .12s ease;
}
.channel-group:hover { border-color: var(--brand-line); }

.channel-group .channel {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
/* Das Anheben beim Überfahren würde den Block auseinanderreißen */
.channel-group .channel:hover { transform: none; }

.channel-panel {
  padding: 4px 16px 18px;
  border-top: 1px solid var(--line);
  margin-top: 2px;
}
.channel-panel > form { padding-top: 14px; }

/* ---------- IFU-Box ---------- */
.ifu-box {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: var(--bg);
}
.ifu-title { font-weight: 700; margin: 0 0 2px; }
.ifu-meta { font-size: .82rem; color: var(--muted); margin: 0 0 12px; }
.ifu-missing { color: #b45309; font-size: .9rem; margin: 0; }
@media (prefers-color-scheme: dark) { .ifu-missing { color: #fbbf24; } }

.ifu-langs {
  margin: 10px 0 0;
  font-size: .8rem;
  color: var(--muted);
  letter-spacing: .02em;
}

.ifu-alt { margin-top: 12px; }
.ifu-alt summary { cursor: pointer; font-size: .85rem; color: var(--muted); }
.ifu-alt ul { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.ifu-alt a {
  display: inline-block; font-size: .85rem; text-decoration: none;
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px;
  background: var(--surface);
}

/* ---------- Statusmeldungen ---------- */
.form-status { margin: 12px 0 0; font-size: .9rem; min-height: 1.4em; }
.form-status.is-ok    { color: var(--link); font-weight: 600; }
.form-status.is-error { color: #dc2626; font-weight: 600; }

/* ---------- Vigilanz-Hinweis ---------- */
.notice {
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand-line);
  border-radius: 10px;
  background: var(--surface);
  padding: 14px 16px;
  margin: 8px 0 28px;
}
.notice h2 { font-size: .95rem; }
.notice p { font-size: .875rem; color: var(--muted); margin: 0; }

/* ---------- Rechtstexte (Impressum, Datenschutz) ---------- */
.legal { padding: 24px 16px 8px; max-width: 760px; }
.legal h1 { font-size: 1.6rem; margin-bottom: 4px; }
.legal h2 {
  font-size: 1.02rem;
  margin: 28px 0 8px;
  padding-top: 4px;
}
.legal p, .legal li { line-height: 1.65; }
.legal ul { padding-left: 20px; margin: 0 0 12px; }
.legal li { margin-bottom: 4px; }
.legal code {
  font-size: .9em;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
}
.legal .back { margin-bottom: 20px; font-size: .9rem; }
.legal .legal-nav {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: .9rem;
}

/* Offene Stellen im Rechtstext – sollen beim Korrekturlesen ins Auge
   springen. Vor dem Livegang müssen alle ersetzt sein; tools/check.mjs
   meldet sie. */
.todo {
  background: #fde68a;
  color: #78350f;
  border-radius: 4px;
  padding: 1px 6px;
  font-weight: 600;
}
@media (prefers-color-scheme: dark) {
  .todo { background: #78350f; color: #fde68a; }
}

/* ---------- Fußbereich ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 20px 0 34px; }
.site-footer p { margin: 0 0 6px; }
.site-footer a { margin: 0 4px; }
.site-footer a:first-child { margin-left: 0; }

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