/* ============================================================
   Multitermin — Termin Wizard (multi-tenant)
   Design System: Token-based, Mobile First

   Tenant-overridable tokens (set via inline <style> from index.php):
     --bg, --bg-elev, --surface, --surface-warm
     --ink, --ink-muted, --ink-subtle
     --accent, --accent-pressed, --accent-soft, --accent-ink
     --font-heading, --font-body
     --radius-sm, --radius, --radius-lg
   The default values below are the FusionTherapie cream/yellow look.
   A tenant config.json can override any subset of these.
   ============================================================ */

:root{
  /* Surfaces */
  --bg:           #fbf8ef;            /* Cream */
  --bg-elev:      #ffffff;            /* Karten / Inputs */
  --surface:      #f3eee0;            /* Sekundärfläche */
  --surface-warm: #ede5d0;            /* Hover auf Surface */

  /* Ink */
  --ink:          #1f1d1a;            /* Primärtext */
  --ink-muted:    #6b675f;            /* Sekundärtext */
  --ink-subtle:   #9a958c;            /* Helper / Placeholder */

  /* Lines */
  --line:         rgba(31,29,26,0.10);
  --line-strong:  rgba(31,29,26,0.18);

  /* Brand accent */
  --accent:        #ffcc00;
  --accent-pressed:#e6b800;
  --accent-soft:   #fff5cc;
  --accent-ink:    #1f1d1a;           /* Text auf Gelb */

  /* Semantic */
  --success: #2f7a5a;
  --danger:  #b13636;
  --info:    #4a6b85;

  /* Pastell-Tints für Choice-Kacheln (rotiert per :nth-child) */
  --tint-mint:     #e6f1ea;
  --tint-peach:    #f7e4d4;
  --tint-sky:      #e3edf3;
  --tint-sand:     #f1e7d0;
  --tint-lavender: #ece5f0;
  --tint-mint-ink:     #2f7a5a;
  --tint-peach-ink:    #b8581f;
  --tint-sky-ink:      #3d6885;
  --tint-sand-ink:     #8a6b1c;
  --tint-lavender-ink: #6e4f8a;

  /* Radii */
  --radius-sm: 10px;
  --radius:    14px;
  --radius-lg: 20px;

  /* Shadows — warm, „papieren" mit leicht braunem Tint */
  --shadow-sm: 0 1px 0 rgba(255,255,255,.6) inset, 0 1px 2px rgba(140,110,40,.06);
  --shadow-md: 0 1px 0 rgba(255,255,255,.6) inset, 0 6px 18px rgba(140,110,40,.08);
  --shadow-lg: 0 1px 0 rgba(255,255,255,.5) inset, 0 16px 36px rgba(140,110,40,.12);

  /* Focus — leitet sich vom --accent ab, damit Tenant-Override automatisch greift */
  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent);
  --accent-glow: color-mix(in srgb, var(--accent) 25%, transparent);

  /* Layout */
  --maxw: 880px;

  /* Typography */
  --font-heading: 'Figtree', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body:    'Inter',   system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Legacy aliases (für bestehende Selektoren beibehalten) */
  --text:  var(--ink);
  --muted: var(--ink-muted);
}

/* ============================================================ */
/* Reset & Base                                                 */
/* ============================================================ */

*{ box-sizing: border-box; }

html, body{
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100dvh;
}

/* Dekorative weiche Hintergrund-Form */
body::before{
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(60% 40% at 85% 0%,   var(--tint-peach) 0%, transparent 60%),
    radial-gradient(50% 35% at 0% 30%,   var(--tint-mint)  0%, transparent 65%),
    radial-gradient(45% 30% at 100% 80%, var(--tint-sky)   0%, transparent 60%);
  opacity: .55;
}
@media (max-width: 640px){
  body::before{ opacity: .4; }
}

@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* ============================================================ */
/* Layout                                                       */
/* ============================================================ */

.wrap{
  max-width: var(--maxw);
  margin: 16px auto;
  padding: 0 16px env(safe-area-inset-bottom, 16px);
}
@media (min-width: 640px){
  .wrap{ margin: 24px auto; padding: 0 20px; }
}

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

.site-header{
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 20px;
  position: sticky;
  top: env(safe-area-inset-top, 0);
  z-index: 50;
}
@media (min-width: 640px){
  .site-header{ padding: 14px 20px; margin-bottom: 24px; }
}

.backlink, .header-next{
  font-family: var(--font-heading);
  color: var(--ink);
  background: transparent;
  border: none;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  padding: 10px 14px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  visibility: hidden;
  flex: 0 0 auto;
  transition: background-color .2s ease, color .2s ease;
}
.backlink.enabled, .header-next.enabled{ visibility: visible; }
.backlink:hover, .header-next:hover{ background: var(--surface); }
.backlink:focus-visible, .header-next:focus-visible{ outline: none; box-shadow: var(--focus-ring); }
.header-next:disabled{ opacity: .45; cursor: not-allowed; }

.brand{
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
}
.brand-logo{
  height: 32px;
  width: auto;
  object-fit: contain;
}
@media (min-width: 640px){
  .brand-logo{ height: 38px; }
}

/* ============================================================ */
/* Step-Indicator (Progress + Counter)                          */
/* ============================================================ */

.step-progress{
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 2px 12px 2px;
}
.step-progress__track{
  flex: 1;
  height: 6px;
  background: var(--surface);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(31,29,26,.06);
}
.step-progress__fill{
  width: var(--progress, 12%);
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-pressed) 100%);
  border-radius: inherit;
  transition: width .35s cubic-bezier(.22,.61,.36,1);
}
.step-progress__label{
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  white-space: nowrap;
}
.step-progress[hidden]{ display: none; }

/* ============================================================ */
/* Typography                                                   */
/* ============================================================ */

.page-title{
  font-family: var(--font-heading);
  margin: 12px 0 20px 0;
  text-align: center;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.15;
  font-size: clamp(1.75rem, 6vw, 2.5rem);
  color: var(--ink);
}

h2.step-title{
  font-family: var(--font-heading);
  margin: 0 0 14px 0;
  text-align: center;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.2;
  font-size: clamp(1.375rem, 4.5vw, 1.75rem);
  color: var(--ink);
  position: relative;
  padding-top: 18px;
}
h2.step-title:focus{ outline: none; }
h2.step-title:focus-visible{ outline: 2px dashed var(--accent); outline-offset: 6px; border-radius: 4px; }
h2.step-title::before{
  content: "";
  display: block;
  width: 36px;
  height: 3px;
  border-radius: 999px;
  background: var(--accent);
  margin: 0 auto 12px auto;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
}

p.sub{
  margin: 0 auto 24px auto;
  text-align: center;
  color: var(--ink-muted);
  max-width: 56ch;
  font-size: 1rem;
  line-height: 1.55;
}

/* ============================================================ */
/* Choice-Kacheln                                               */
/* ============================================================ */

.choices{
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 12px;
}
@media (min-width: 640px){
  .choices{ grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
}

.choice{
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  user-select: none;
  position: relative;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
/* Akzent-Streifen oben, sichtbar bei Hover/Focus */
.choice::before{
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--tint-ink, var(--accent));
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .25s ease;
  z-index: 2;
}
.choice:hover{
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
}
.choice:hover::before,
.choice:focus-visible::before{ transform: scaleX(1); }
.choice:active{ transform: translateY(-1px); }
.choice:focus-visible{
  outline: none;
  box-shadow: var(--shadow-md), var(--focus-ring);
  border-color: var(--accent);
}

.choice-top{
  background: var(--tint, var(--surface));
  height: clamp(130px, 24vw, 170px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tint-ink, var(--ink));
  font-size: 44px;
  position: relative;
}
.choice-top.absagen-icon,
.choice-top.icon-x{ font-size: 56px; font-weight: 300; }

/* Pastell-Rotation per Position im Grid */
.choices > .choice-wrap:nth-child(5n+1) .choice{ --tint: var(--tint-mint);     --tint-ink: var(--tint-mint-ink); }
.choices > .choice-wrap:nth-child(5n+2) .choice{ --tint: var(--tint-peach);    --tint-ink: var(--tint-peach-ink); }
.choices > .choice-wrap:nth-child(5n+3) .choice{ --tint: var(--tint-sky);      --tint-ink: var(--tint-sky-ink); }
.choices > .choice-wrap:nth-child(5n+4) .choice{ --tint: var(--tint-sand);     --tint-ink: var(--tint-sand-ink); }
.choices > .choice-wrap:nth-child(5n+5) .choice{ --tint: var(--tint-lavender); --tint-ink: var(--tint-lavender-ink); }

.choice-band{
  background: var(--bg-elev);
  color: var(--ink);
  padding: 16px 18px;
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: .02em;
  text-align: center;
  font-size: 15px;
  border-top: 1px solid var(--line);
}

/* Icon circle inside choice top */
.icon-circle{
  width: clamp(60px, 12vw, 84px);
  height: clamp(60px, 12vw, 84px);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elev);
  color: var(--tint-ink, var(--ink));
  font-size: clamp(28px, 5vw, 40px);
  line-height: 1;
  box-shadow: 0 4px 14px rgba(31,29,26,.10);
  border: 1px solid rgba(255,255,255,.7);
  transition: transform .25s ease;
}
.choice:hover .icon-circle{ transform: scale(1.04); }
.choice:active .icon-circle{ transform: scale(.98); }

.choice-wrap{ position: relative; }

/* ============================================================ */
/* Forms                                                        */
/* ============================================================ */

.form{
  display: grid;
  gap: 14px;
  max-width: 620px;
  margin: 0 auto 6px auto;
}

.field{ display: grid; gap: 6px; }

label{
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="number"],
select,
textarea{
  width: 100%;
  padding: 12px 14px;
  min-height: 48px;
  font-family: var(--font-body);
  font-size: 16px;          /* verhindert iOS-Zoom */
  line-height: 1.4;
  color: var(--ink);
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input::placeholder, textarea::placeholder{ color: var(--ink-subtle); }

input:hover, select:hover, textarea:hover{ border-color: var(--ink-subtle); }

input:focus, select:focus, textarea:focus{
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}

textarea{ min-height: 112px; resize: vertical; }

/* Datei-Upload */
.dropzone{
  border: 2px dashed var(--line-strong);
  padding: 18px;
  border-radius: var(--radius);
  background: var(--bg-elev);
  color: var(--ink-muted);
  cursor: pointer;
  text-align: center;
  transition: background-color .15s ease, border-color .15s ease;
}
.dropzone:hover{ background: var(--surface); }
.dropzone:focus-visible{ outline: none; box-shadow: var(--focus-ring); }
.dropzone.dragover{ border-color: var(--accent); background: var(--accent-soft); }

.btn-row{ display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 6px; }

/* Segmented Controls (Ja/Nein) */
.segment{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  max-width: 620px;
  margin: 0 auto 24px auto;
}
.segment .seg{
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 14px 20px;
  min-height: 48px;
  text-align: center;
  cursor: pointer;
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--ink);
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}
.segment .seg:hover{
  background: var(--surface);
  border-color: var(--ink-subtle);
}
.segment .seg:focus-visible{ outline: none; box-shadow: var(--focus-ring); }
.segment .seg.active{
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 4px 14px var(--accent-glow);
  position: relative;
}
.segment .seg.active::before{
  content: "";
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-right: 8px;
  vertical-align: -3px;
  background-color: var(--accent-ink);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") center / contain no-repeat;
}

/* ============================================================ */
/* Buttons                                                      */
/* ============================================================ */

.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 22px;
  min-height: 48px;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .01em;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: var(--bg-elev);
  color: var(--ink);
  cursor: pointer;
  user-select: none;
  text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease, transform .1s ease, box-shadow .15s ease;
}
.btn:hover{ background: var(--surface); }
.btn:active{ transform: translateY(1px); }
.btn:focus-visible{ outline: none; box-shadow: var(--focus-ring); }

.btn-primary{
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
  position: relative;
}
.btn-primary:hover{
  background: var(--accent-pressed);
  border-color: var(--accent-pressed);
  outline: 2px solid var(--accent-soft);
  outline-offset: 3px;
}
.btn-primary:disabled{ opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; outline: none; }

/* Pfeil-Mikrointeraktion auf Primary-CTAs (außer FAB / Telefon-Buttons) */
.btn-primary:not(.help-fab):not([href^="tel:"])::after{
  content: "";
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-left: 4px;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><line x1='5' y1='12' x2='19' y2='12'/><polyline points='12 5 19 12 12 19'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><line x1='5' y1='12' x2='19' y2='12'/><polyline points='12 5 19 12 12 19'/></svg>") center / contain no-repeat;
  transform: translateX(0);
  transition: transform .2s cubic-bezier(.22,.61,.36,1);
}
.btn-primary:not(:disabled):hover::after{ transform: translateX(4px); }

.btn-ghost{
  background: transparent;
  border-color: var(--line);
  color: var(--ink-muted);
}
.btn-ghost:hover{ background: var(--surface); color: var(--ink); }

.btn-danger{
  background: var(--bg-elev);
  border-color: rgba(177,54,54,.25);
  color: var(--danger);
}
.btn-danger:hover{ background: #fff0f0; border-color: rgba(177,54,54,.4); }

.btn-dark{
  background: var(--ink);
  color: var(--bg-elev);
  border-color: var(--ink);
}
.btn-dark:hover{ background: #000; }

.btn-small{ padding: 10px 14px; min-height: 40px; font-size: 14px; }

/* ============================================================ */
/* CTA-Zeile (sticky bottom auf Mobile)                          */
/* ============================================================ */

.cta-row{
  display: flex;
  justify-content: center;
  margin: 20px 0 8px 0;
  position: sticky;
  bottom: env(safe-area-inset-bottom, 12px);
  z-index: 40;
}
.cta-row .btn-primary{ min-width: min(320px, 100%); }
@media (min-width: 640px){
  .cta-row{ position: static; }
}

/* ============================================================ */
/* Extras (Hinweise + Öffnungszeiten)                           */
/* ============================================================ */

.extra-below{ max-width: 720px; margin: 18px auto 0 auto; }
.notice{
  display: flex; align-items: flex-start; gap: 8px;
  color: var(--danger); font-weight: 600; margin-bottom: 10px;
  background: #fdf3f3;
  border: 1px solid rgba(177,54,54,.18);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
}
.opening-grid{
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 720px){
  .opening-grid{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.card{
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.card .title{ font-family: var(--font-heading); font-weight: 700; margin-bottom: 8px; color: var(--ink); }
.card dl{ margin: 0; }
.card dt{ font-weight: 600; color: var(--ink); }
.card dd{ margin: 0 0 6px 0; color: var(--ink-muted); }

/* ============================================================ */
/* Title / Topbar / Crumbs (legacy fallback)                    */
/* ============================================================ */

.title{
  font-family: var(--font-heading);
  font-size: clamp(1.375rem, 4vw, 1.75rem);
  font-weight: 700;
  text-align: center;
  margin: 0 0 20px 0;
  color: var(--ink);
}
.topbar{ margin-bottom: 12px; }
.crumbs{ font-size: 12px; color: var(--ink-muted); gap: 8px; display: flex; align-items: center; flex-wrap: wrap; }
.crumbs .active{ color: var(--ink); font-weight: 600; }
.crumbs .dot{ width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }

.footer{ margin-top: 14px; display: flex; gap: 10px; justify-content: space-between; align-items: center; }
.footer .note{ font-size: 12px; color: var(--ink-muted); }
.footer .right{ display: flex; gap: 10px; }

/* ============================================================ */
/* Layout helpers                                               */
/* ============================================================ */

.row{ display: flex; flex-wrap: wrap; gap: 12px; }
.grid{ display: grid; gap: 12px; }
.grid-2{ grid-template-columns: 1fr; }
@media (min-width: 640px){ .grid-2{ grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.row .btn[data-choice], .grid .btn[data-choice]{
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  min-width: 100%;
  font-size: 16px;
  box-shadow: var(--shadow-sm);
}
@media (min-width: 640px){
  .row .btn[data-choice], .grid .btn[data-choice]{ min-width: 260px; }
}
.row .btn[data-choice]:hover, .grid .btn[data-choice]:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.muted{ color: var(--ink-muted); }
.pill{
  background: var(--bg-elev);
  color: var(--ink-muted);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--line);
}
.switch-row{ display: flex; align-items: center; gap: 12px; }
.switch-row input{ transform: scale(1.1); }

/* ============================================================ */
/* Fußzeile                                                     */
/* ============================================================ */

.legal{
  display: flex; gap: 8px; justify-content: center; align-items: center;
  margin: 24px 0; color: var(--ink-muted); font-size: 14px;
}
.legal a{ color: var(--ink-muted); text-decoration: none; }
.legal a:hover{ color: var(--ink); text-decoration: underline; }
.legal .dot{ opacity: .6; }

/* ============================================================ */
/* Utilities                                                    */
/* ============================================================ */

.hidden{ display: none !important; }
.visually-hidden{
  position: absolute !important;
  height: 1px; width: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; margin: -1px; padding: 0; border: 0;
}
.spacer{ height: 20px; }
.subtle{ color: var(--ink-muted); font-size: 13px; text-align: center; line-height: 1.4; }

.refshot{ max-width: 100%; margin: 16px auto; text-align: center; order: 10; }
.refshot img{
  max-width: 60%; height: auto;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
}
.refshot .subtle{ margin-top: 8px; font-size: 12px; }

/* ============================================================ */
/* Floating Help-Button (FAB)                                   */
/* ============================================================ */

.help-fab{
  position: fixed;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
  z-index: 900;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  min-height: 48px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 15px;
  color: var(--accent-ink);
  background: var(--accent);
  border: 1px solid var(--accent-pressed);
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(31,29,26,.18);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background-color .15s ease;
}
.help-fab:hover{
  background: var(--accent-pressed);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(31,29,26,.22);
}
.help-fab:focus-visible{ outline: none; box-shadow: 0 6px 20px rgba(31,29,26,.18), var(--focus-ring); }
.help-fab svg{ flex: 0 0 auto; }
@media (max-width: 480px){
  .help-fab{ padding: 12px 14px; }
  .help-fab__text{
    position: absolute !important;
    width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%);
    white-space: nowrap; margin: -1px; padding: 0; border: 0;
  }
}

/* Required-Markierung für Labels */
label .req,
label[data-required="true"]::after{
  color: var(--danger);
  margin-left: 2px;
  font-weight: 700;
}
label[data-required="true"]::after{ content: " *"; }

/* ============================================================ */
/* Modal / Bottom-Sheet                                         */
/* ============================================================ */

.overlay{
  position: fixed;
  inset: 0;
  background: rgba(31,29,26,.5);
  display: none;
  align-items: flex-end;        /* Mobile: bottom-sheet */
  justify-content: center;
  padding: 0;
  z-index: 1000;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.overlay.show{ display: flex; }

.modal{
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
@media (min-width: 640px){
  .overlay{ align-items: center; padding: 24px; }
  .modal{
    width: min(640px, 100%);
    border-radius: var(--radius-lg);
  }
}

.modal-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.modal-title{ font-family: var(--font-heading); font-weight: 700; font-size: 18px; color: var(--ink); }
.modal-close{
  background: transparent; border: none; font-size: 26px; line-height: 1;
  cursor: pointer; color: var(--ink-muted); padding: 4px 8px; border-radius: 8px;
}
.modal-close:hover{ color: var(--ink); background: var(--surface); }
.modal-content{ padding: 18px; }
.modal-actions{
  padding: 14px 18px calc(18px + env(safe-area-inset-bottom, 0));
  display: flex; gap: 10px; justify-content: flex-end;
  border-top: 1px solid var(--line);
}
.phone{ text-align: center; font-size: 28px; font-weight: 700; margin: 6px 0 14px 0; color: var(--ink); }

/* ============================================================ */
/* Custom Selects                                               */
/* ============================================================ */

select{
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-color: var(--bg-elev);
  background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 10l5 5 5-5' stroke='%236b675f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px 18px;
  padding-right: 44px;
  cursor: pointer;
  background-clip: padding-box;
}
select:disabled{ background-color: var(--surface); color: var(--ink-subtle); cursor: not-allowed; }
select[multiple]{ background-image: none; padding: 12px; }
select::-ms-expand{ display: none; }
select:-moz-focusring{ color: transparent; text-shadow: 0 0 0 var(--ink); }

.select-wrap{ position: relative; }
.select-wrap::after{
  content: "";
  position: absolute;
  top: 50%; right: 14px;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 10l5 5 5-5' stroke='%236b675f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center; background-size: 18px 18px;
}
.select-wrap select{ background-image: none !important; padding-right: 44px; }

/* ============================================================ */
/* Icons in Eingabefeldern                                      */
/* ============================================================ */

.input-icon{ position: relative; display: flex; align-items: center; }
.input-icon .icon{
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--ink-muted); font-size: 16px;
  transition: color .15s ease;
}
.input-icon input, .input-icon select, .input-icon textarea{ padding-left: 42px; }
.input-icon:focus-within .icon{ color: var(--accent-pressed); }

/* Floating Labels */
.field.floating{ position: relative; }
.field.floating > label{
  position: absolute; left: 42px; right: 14px; top: 14px;
  background: var(--bg-elev); padding: 0 6px; border-radius: 4px;
  color: var(--ink-muted); font-weight: 600; font-size: 14px;
  transform-origin: left top;
  transition: transform .15s ease, color .15s ease, top .15s ease;
  z-index: 1;
  pointer-events: none;
}
.field.floating:focus-within > label,
.field.floating.filled > label{
  top: -8px;
  transform: scale(.88);
  color: var(--accent-pressed);
}

/* iOS/WebKit Date-Inputs angleichen */
input[type="date"]{ -webkit-appearance: none; appearance: none; }
input[type="date"]::-webkit-inner-spin-button,
input[type="date"]::-webkit-clear-button{ display: none; }
input[type="date"]::-webkit-calendar-picker-indicator{ opacity: 0; }

/* ============================================================ */
/* Flatpickr Theme (Cream)                                      */
/* ============================================================ */

.flatpickr-calendar{
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
  background: var(--bg-elev);
}
.flatpickr-months .flatpickr-month{ color: var(--ink); font-weight: 700; }
.flatpickr-weekday{ color: var(--ink-muted); font-weight: 600; }
.flatpickr-day{ color: var(--ink); border-radius: 8px; }
.flatpickr-day:hover{ background: var(--accent-soft); }
.flatpickr-day.today{
  border-color: transparent;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}
.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange{
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year{ font-weight: 700; color: var(--ink); }

/* Bold placeholder for Geburtsdatum */
#geb::placeholder,
#geb_visible::placeholder{
  font-weight: 600;
  color: var(--ink-muted);
  opacity: 1;
}
#geb::-webkit-input-placeholder,
#geb_visible::-webkit-input-placeholder{
  font-weight: 600;
  color: var(--ink-muted);
  opacity: 1;
}

/* ============================================================ */
/* Fake Select (vanilla)                                        */
/* ============================================================ */

.select-wrap--fake{ position: relative; }
.select-wrap--fake::after{ display: none; }

.fake-select{ position: relative; }
.fake-select .fs-button{
  width: 100%;
  text-align: left;
  padding: 12px 44px 12px 14px;
  min-height: 48px;
  font-family: var(--font-body);
  font-size: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
  color: var(--ink);
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.fake-select .fs-button:focus{
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
  outline: none;
}
.fake-select .fs-button::after{
  content: "";
  position: absolute;
  top: 50%; right: 14px;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 10l5 5 5-5' stroke='%236b675f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center; background-size: 18px 18px;
  transition: transform .15s ease;
}
.fake-select.open .fs-button{ border-color: var(--accent); box-shadow: var(--focus-ring); }
.fake-select.open .fs-button::after{ transform: translateY(-50%) rotate(180deg); }

.fs-menu{
  display: none;
  position: absolute;
  left: 0; right: 0; top: calc(100% + 6px);
  z-index: 2000;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  margin: 0;
  padding: 6px;
  list-style: none;
}
.fake-select.open .fs-menu{ display: block; }

.fs-option{
  display: block;
  padding: 12px 14px;
  cursor: pointer;
  line-height: 1.3;
  color: var(--ink);
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  margin: 2px 0;
  transition: background-color .15s ease, border-color .15s ease;
}
.fs-option:hover, .fs-option.active{
  background: var(--accent-soft);
  border-color: var(--accent);
}
.fs-option.selected{ font-weight: 600; }
.fs-option[aria-disabled="true"]{ color: var(--ink-subtle); cursor: not-allowed; pointer-events: none; }
