/* Begruessungsfenster - EIN Baustein fuer alle 40 statischen Seiten (index.html und
   ausfuehrlich.html in public/website/ plus jede der 19 Sprachkopien). Gehoert zu begruessung.js,
   das das Fenster beim allerersten Besuch aufbaut (Vorname + Sprache).

   Alle Klassen beginnen mit .rb-bg, damit nichts mit dem Seiten-CSS kollidiert. Farben, Rundungen
   und Schriften kommen aus den Variablen der Seite (:root in jeder Seite), mit denselben Werten als
   Rueckfall. Logische Eigenschaften (inline-start/end) tragen RTL (ar/fa) ohne eigene Regeln. */

.rb-bg, .rb-bg * { box-sizing: border-box; }

.rb-bg {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  padding: 12px;
  background: rgba(11, 31, 51, .72);
}
.rb-bg[hidden] { display: none; }

.rb-bg-karte {
  position: relative; width: 100%; max-width: 520px;
  max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px);
  overflow-y: auto; overscroll-behavior: contain;
  padding: 28px 20px 8px;
  border-radius: 24px;
  background: var(--warmweiss, #F7F9F6); color: var(--navy, #0B1F33);
  box-shadow: 0 24px 64px rgba(0, 0, 0, .4);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 16px; line-height: 1.5;
  animation: rb-bg-rein .28s ease-out both;
}
.rb-bg-karte:focus { outline: none; }
@keyframes rb-bg-rein {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .rb-bg-karte { animation: none; }
}

.rb-bg-zu {
  position: absolute; top: 8px; inset-inline-end: 8px;
  display: grid; place-items: center;
  width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 50%;
  background: transparent; color: var(--muted, #4A5A6A);
  font-size: 28px; line-height: 1; cursor: pointer;
}
.rb-bg-zu:hover { background: rgba(11, 31, 51, .08); color: var(--navy, #0B1F33); }
.rb-bg-zu:focus-visible { outline: 3px solid var(--tiefgruen, #105A48); outline-offset: 2px; }

.rb-bg-kopf { display: flex; align-items: center; gap: 14px; padding-inline-end: 40px; }
.rb-bg-reiner {
  flex: none; display: block; width: 64px; height: 64px; border-radius: 50%;
  box-shadow: 0 0 0 2px var(--tiefgruen, #105A48);
}
.rb-bg-titel {
  margin: 0;
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif; font-weight: 800;
  font-size: clamp(22px, 5vw, 27px); line-height: 1.15; letter-spacing: -.02em;
  overflow-wrap: break-word; min-width: 0;
}
.rb-bg-text { margin: 14px 0 0; font-size: 15.5px; line-height: 1.5; color: var(--muted, #4A5A6A); }

.rb-bg-feld { margin-top: 20px; }
.rb-bg-label { display: block; margin: 0 0 8px; font-weight: 700; font-size: 15px; }
.rb-bg-eingabe {
  display: block; width: 100%; min-height: 48px; margin: 0;
  padding: 12px 18px;
  border: 1.5px solid rgba(11, 31, 51, .3); border-radius: 999px;
  background: #fff; color: var(--navy, #0B1F33);
  font: inherit; font-size: 16px;
}
.rb-bg-eingabe::placeholder { color: rgba(74, 90, 106, .8); }
.rb-bg-eingabe:focus { outline: 3px solid var(--tiefgruen, #105A48); outline-offset: 2px; border-color: var(--tiefgruen, #105A48); }
.rb-bg-hinweis {
  margin: 8px 4px 0;
  font-family: var(--mono, ui-monospace, 'SFMono-Regular', 'Cascadia Mono', Consolas, monospace);
  font-size: 12px; color: var(--muted, #4A5A6A);
}

/* Kompakte Aktionen: grosser Hauptknopf, dezenter Aufklapp-Knopf, Liste, Ueberspringen. */
.rb-bg-aktionen {
  display: flex; flex-direction: column; align-items: stretch; gap: 2px;
  margin: 20px 0 0; padding: 0 0 calc(10px + env(safe-area-inset-bottom, 0px));
}
.rb-bg-haken { margin-inline-end: 8px; font-weight: 800; }

.rb-bg-andere { display: flex; flex-direction: column; align-items: stretch; }
.rb-bg-umschalter {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 8px 16px; margin: 4px auto 0;
  border: 0; border-radius: 999px; background: none; color: var(--navy, #0B1F33);
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
}
.rb-bg-umschalter:hover { background: rgba(11, 31, 51, .06); }
.rb-bg-umschalter:focus-visible { outline: 3px solid var(--tiefgruen, #105A48); outline-offset: 2px; }
.rb-bg-pfeil { display: inline-block; font-size: 14px; transition: transform .15s ease; }
.rb-bg-umschalter[aria-expanded=true] .rb-bg-pfeil { transform: rotate(180deg); }

/* Liste der uebrigen Sprachen: eigener Scrollbereich, sprengt das Fenster nicht. */
.rb-bg-liste {
  list-style: none; margin: 6px 0 0; padding: 4px;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px;
  max-height: min(260px, 36vh); max-height: min(260px, 36dvh);
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line, rgba(11, 31, 51, .18)); border-radius: 18px; background: #fff;
}
.rb-bg-liste[hidden] { display: none; }
.rb-bg-liste li { margin: 0; padding: 0; min-width: 0; }
.rb-bg-sprache {
  display: flex; align-items: center; justify-content: center; width: 100%;
  min-height: 44px; padding: 6px 8px;
  border: 1.5px solid rgba(11, 31, 51, .22); border-radius: 999px;
  background: #fff; color: var(--navy, #0B1F33);
  font: inherit; font-size: 14px; font-weight: 600; line-height: 1.2; text-align: center;
  overflow-wrap: anywhere; cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.rb-bg-sprache:hover { border-color: var(--tiefgruen, #105A48); background: rgba(16, 90, 72, .06); }
.rb-bg-sprache:focus-visible { outline: 3px solid var(--tiefgruen, #105A48); outline-offset: 2px; }
@media (min-width: 480px) {
  .rb-bg-liste { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.rb-bg-los {
  min-height: 54px; padding: 12px 24px;
  border: 1.5px solid transparent; border-radius: var(--r-btn, 999px);
  background: var(--orange, #FF7F32); color: var(--navy, #0B1F33);
  font: inherit; font-size: 17px; font-weight: 700; cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}
.rb-bg-los:hover { background: #F0701F; transform: translateY(-1px); }
.rb-bg-los:focus-visible { outline: 3px solid var(--tiefgruen, #105A48); outline-offset: 3px; }
.rb-bg-skip {
  min-height: 44px; padding: 8px 16px;
  border: 0; background: none; color: var(--muted, #4A5A6A);
  font: inherit; font-size: 14px; text-decoration: underline; cursor: pointer;
}
.rb-bg-skip:hover { color: var(--navy, #0B1F33); }
.rb-bg-skip:focus-visible { outline: 3px solid var(--tiefgruen, #105A48); outline-offset: 2px; border-radius: 8px; }

@media (max-height: 520px) {
  .rb-bg-karte { padding-top: 20px; }
  .rb-bg-text { margin-top: 8px; }
  .rb-bg-feld, .rb-bg-aktionen { margin-top: 14px; }
}

.rb-bg[dir=rtl] .rb-bg-hinweis { font-family: inherit; letter-spacing: normal; }
.rb-bg input[type=text] { unicode-bidi: plaintext; }

/* Persoenliche Begruessung im Hero ("Hallo Florian,"), eingesetzt von begruessung.js, wenn ein Name
   gespeichert ist. Gleiche Schrift wie die Ueberschrift, Frischgruen auf dem dunklen Hero. */
.rb-hallo {
  margin: 22px 0 0;
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-weight: 800; line-height: 1.15; letter-spacing: -.01em;
  font-size: clamp(22px, 2vw + 14px, 34px);
  color: var(--frischgruen, #B3FFB5);
  overflow-wrap: anywhere;
}
.rb-hallo + .traum-titel h1.schlag, .rb-hallo + h1.schlag { margin-top: 8px; }
