/* =========================================================================
   WILLNER Fahrradzentrum - Flohmarkt
   Redesign-Vorschau / Prototyp - modernes Corporate/SaaS Design
   Kein Framework, reines modernes CSS (Custom Properties, Grid, Flexbox)
   ========================================================================= */

:root {
  /* Marke */
  --color-brand: #1a2b68;
  --color-brand-dark: #111b41;
  --color-brand-light: #eef2f9;
  --color-accent: #ff5a36;
  --color-accent-dark: #e6431f;

  /* Neutrale Farben */
  --color-bg: #f7f8fb;
  --color-surface: #ffffff;
  --color-border: #e4e7ee;
  --color-text: #101828;
  --color-text-muted: #5b6272;

  /* Layout */
  --max-width: 1200px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
  --shadow-md: 0 8px 24px rgba(11, 47, 102, 0.10);
  --shadow-lg: 0 20px 50px rgba(11, 47, 102, 0.16);

  /* Typografie */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* =========================== Header =========================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo img {
  height: 50px;
  width: auto;
}

.header-nav {
  display: flex;
  gap: 1.75rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text-muted);
}

.header-nav a:hover {
  color: var(--color-brand);
}

.btn-header {
  background: var(--color-brand);
  color: #fff !important;
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
}

.btn-header:hover {
  background: var(--color-brand-dark);
  transform: translateY(-1px);
}

/* =========================== Hero =========================== */

.hero {
  padding: 5.5rem 0 4rem;
  background:
    radial-gradient(circle at 15% 20%, rgba(11, 47, 102, 0.08), transparent 45%),
    radial-gradient(circle at 85% 0%, rgba(255, 90, 54, 0.10), transparent 40%);
}

.hero-inner {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent-dark);
  background: rgba(255, 90, 54, 0.1);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  margin-bottom: 1.25rem;
}

.hero h1 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  color: var(--color-brand);
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--color-text-muted);
  margin: 0 auto;
  max-width: 560px;
}

/* =========================== Ablauf / Steps =========================== */

.steps {
  padding: 0.5rem 0 3rem;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.1rem;
}

.step-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.4rem 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: var(--color-brand);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
}

.step-title {
  font-weight: 700;
  color: var(--color-brand);
  font-size: 0.98rem;
}

.step-desc {
  font-size: 0.87rem;
  color: var(--color-text-muted);
}

@media (max-width: 900px) {
  .steps-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .steps-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================== Action Cards =========================== */

.actions {
  padding: 1rem 0 5rem;
}

.actions-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

/* Kachel-Breite nur bei der 4-spaltigen Desktop-Ansicht begrenzen (siehe
   Berechnung: 1152px Container-Innenbreite, 3 Luecken a 20px -> 273px pro
   Kachel). Bei 2- oder 1-spaltiger Ansicht (siehe Media Queries unten) soll
   die Kachel die volle Spaltenbreite nutzen, damit sie genauso breit ist wie
   Anleitungsbox/Fliesstext. */
@media (min-width: 901px) {
  .action-card {
    max-width: 273px;
  }
}

.action-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
  text-decoration: none;
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  justify-content: flex-start;
  /* Kein aspect-ratio mehr: erzwang pro Kachel eine eigene quadratische Hoehe,
     wodurch Kacheln mit laengerem Text (z.B. "Konto anlegen") ueber die
     anderen hinausgewachsen sind. Stattdessen gleicht das Grid (align-items:
     stretch, Standardwert) alle 4 Kacheln automatisch auf die hoechste an. */
  height: 100%;
}

.action-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.action-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-md);
  background: var(--color-brand-light);
  color: var(--color-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.action-icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

/* Wrapper um Titel/Text/Pfeil, damit diese als EIN Block neben dem Icon
   behandelt werden (wichtig für die mobile Reihen-Anordnung unten). */
.action-text {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  gap: 0.4rem;
}

.action-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--color-brand);
}

.action-desc {
  font-size: 0.92rem;
  color: var(--color-text-muted);
}

.action-arrow {
  margin-top: auto;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-accent-dark);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

@media (max-width: 900px) {
  .actions-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .action-card {
    aspect-ratio: auto;
  }
}

@media (max-width: 560px) {
  .actions-grid {
    grid-template-columns: 1fr;
  }
  .action-card {
    flex-direction: row;
    align-items: flex-start;
    aspect-ratio: auto;
    height: auto;
  }
  .action-card .action-title,
  .action-card .action-desc {
    display: block;
  }
  .action-card .action-arrow {
    margin-top: 0.6rem;
  }
}

/* =========================== Generic Section / Card =========================== */

.page-header {
  padding: 3.5rem 0 1.5rem;
  text-align: center;
}

.page-header h1 {
  color: var(--color-brand);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}

.page-header p {
  color: var(--color-text-muted);
  max-width: 560px;
  margin: 0 auto;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 2rem;
}

/* =========================== Formular =========================== */

.form-wrap {
  max-width: 720px;
  margin: 0 auto 5rem;
  padding: 0 1.5rem;
}

.intro-box {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: var(--color-brand-light);
  border: 1px solid rgba(11, 47, 102, 0.12);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.4rem;
  margin-bottom: 2rem;
}

/* Banner "So funktioniert's" auf der Startseite - muss exakt so breit sein
   wie die darunterliegende 4er-Kachelreihe (.actions-grid), da beide direkte
   Kinder von .container sind. Eigene Klasse statt Inline-Style, damit keine
   andere Regel die Breite ueberschreiben kann. */
.home-guide-banner {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  width: 100%;
  box-sizing: border-box;
  background: var(--color-brand-light);
  border: 1px solid rgba(11, 47, 102, 0.12);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.4rem;
  text-decoration: none;
}

.intro-box .intro-icon {
  flex: 0 0 auto;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--color-brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.intro-box .intro-icon svg {
  width: 1.15rem;
  height: 1.15rem;
}

.intro-box .lead {
  font-weight: 700;
  color: var(--color-brand);
  margin: 0 0 0.35rem;
}

.intro-box p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

form .card + .card {
  margin-top: 1.5rem;
}

.card h2 {
  font-size: 1.15rem;
  color: var(--color-brand);
  margin: 0 0 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.card h2 .step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--color-brand);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem 1.25rem;
}

.field-grid .field.full {
  grid-column: 1 / -1;
}

@media (max-width: 640px) {
  .field-grid {
    grid-template-columns: 1fr;
  }
}

.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.4rem;
}

.field .hint {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 0.3rem;
}

input[type="text"],
input[type="email"],
input[type="tel"] {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--color-text);
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  min-height: 2.9rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus {
  outline: none;
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px rgba(11, 47, 102, 0.15);
}

input.short {
  max-width: 10rem;
}

@media (max-width: 640px) {
  input.short {
    max-width: none;
  }
}

textarea {
  font: inherit;
}

/* Radio-Gruppen (Fahrradart, Typ, Schaltung etc. - siehe rad-erfassen.php) */
.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.radio-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.radio-chip:has(input:checked) {
  border-color: var(--color-brand);
  background: var(--color-brand-light);
  color: var(--color-brand);
}

.radio-chip input {
  accent-color: var(--color-brand);
  margin: 0;
}

/* Datenschutz als aufklappbarer Bereich statt kleiner Scrollbox */
details.privacy {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #fbfbfd;
}

details.privacy summary {
  cursor: pointer;
  list-style: none;
  padding: 0.9rem 1.1rem;
  font-weight: 600;
  color: var(--color-brand);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

details.privacy summary::-webkit-details-marker {
  display: none;
}

details.privacy summary::after {
  content: "+";
  font-size: 1.2rem;
  color: var(--color-text-muted);
  transition: transform 0.2s ease;
}

details.privacy[open] summary::after {
  transform: rotate(45deg);
}

.privacy-body {
  padding: 0 1.1rem 1.1rem;
  max-height: 260px;
  overflow-y: auto;
  font-size: 0.88rem;
  color: var(--color-text-muted);
}

.privacy-body h3 {
  color: var(--color-text);
  font-size: 0.95rem;
  margin: 1.1rem 0 0.3rem;
}

.privacy-body h3:first-child {
  margin-top: 0;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-top: 1.4rem;
  padding: 1rem 1.1rem;
  background: var(--color-brand-light);
  border-radius: var(--radius-sm);
}

.checkbox-row input {
  margin-top: 0.2rem;
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--color-brand);
  flex: 0 0 auto;
}

.checkbox-row label {
  font-size: 0.9rem;
  color: var(--color-text);
  margin: 0;
  font-weight: 400;
}

.btn-primary {
  appearance: none;
  border: none;
  width: 100%;
  background: var(--color-accent);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 1rem;
  border-radius: var(--radius-sm);
  margin-top: 1.5rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background 0.2s ease, transform 0.2s ease;
}

.btn-primary:hover {
  background: var(--color-accent-dark);
  transform: translateY(-1px);
}

.post-note {
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 1.25rem;
}

/* =========================== Footer =========================== */

.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 2.25rem 0;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.88rem;
}

.site-footer nav {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.6rem;
  justify-content: center;
}

.site-footer a {
  text-decoration: none;
  color: var(--color-text-muted);
}

.site-footer a:hover {
  color: var(--color-brand);
  text-decoration: underline;
}

/* =========================== Info-Banner =========================== */

.proto-banner {
  background: var(--color-brand-dark);
  color: #fff;
  text-align: center;
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
}

.proto-banner a {
  color: #ffd7c9;
  text-decoration: underline;
}

/* =========================== Alerts / Formularfehler (PHP-Backend) =========================== */

.alert {
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  font-size: 0.92rem;
}

.alert-success {
  background: #eafaf1;
  border: 1px solid #b6ecd0;
  color: #0f6e42;
}

.alert-error {
  background: #fdecec;
  border: 1px solid #f6c1c1;
  color: #9a2b2b;
}

.alert-error ul {
  margin: 0.4rem 0 0;
  padding-left: 1.2rem;
}

.field.has-error input {
  border-color: #d64545;
  box-shadow: 0 0 0 3px rgba(214, 69, 69, 0.12);
}

.field .field-error {
  font-size: 0.8rem;
  color: #b02a2a;
  margin-top: 0.3rem;
}

/* =========================== QR-Code-Box =========================== */

.qr-box {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  background: var(--color-brand-light);
  border: 1px solid rgba(11, 47, 102, 0.12);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.4rem;
  margin: 1.5rem 0;
}

.qr-box img {
  flex: 0 0 auto;
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 0.5rem;
  border: 1px solid var(--color-border);
}

.qr-box .lead {
  font-weight: 700;
  color: var(--color-brand);
  margin: 0 0 0.35rem;
}

.qr-box p {
  margin: 0 0 0.35rem;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

@media (max-width: 560px) {
  .qr-box {
    flex-direction: column;
    text-align: center;
  }
}

/* =========================== Mitarbeiterbereich =========================== */

.staff-login-wrap {
  max-width: 380px;
  margin: 4rem auto;
  padding: 0 1.5rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

.data-table th {
  width: 40%;
  color: var(--color-text-muted);
  font-weight: 600;
}

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-gemeldet {
  background: #fdf3e0;
  color: #8a5a10;
}

.status-freigegeben {
  background: #eafaf1;
  color: #0f6e42;
}

.status-verkauft {
  background: #eef2f9;
  color: var(--color-brand);
}

.status-abgerechnet {
  background: #e6f4ea;
  color: #1e7a34;
}

.status-zurueckgegeben {
  background: #f1f1f3;
  color: var(--color-text-muted);
}

/* =========================== Katalog (oeffentliche Angebotsuebersicht) =========================== */

.katalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}

.katalog-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.katalog-foto {
  aspect-ratio: 4 / 3;
  background: var(--color-brand-light);
  overflow: hidden;
}

.katalog-foto img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.katalog-foto-platzhalter {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.katalog-info {
  padding: 1rem 1.1rem 1.25rem;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.katalog-info h3 {
  font-size: 1rem;
  margin: 0 0 0.35rem;
  color: var(--color-text);
}

.katalog-info .hint {
  font-size: 0.82rem;
  margin: 0 0 0.6rem;
  flex: 1 1 auto;
}

.katalog-preis {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-brand);
  margin: 0;
}
