/*
 * Rückruf-Knopf mit Kurzformular (assets/js/rueckruf.js, inc/rueckruf.php) – auf allen Seiten.
 * Breite Fenster (≥ 1360 px): Andock-Karte mittig am rechten Rand mit „Rückruf anfordern“ und „Kurs buchen“.
 * Schmaler: runder Knopf unten rechts; auf Kursseiten über der Buchungsleiste. Übernommen vom Akademie-Entwurf.
 */
/* ---------- Andock-Karte ---------- */
.rr {
  --rr-blau: var(--b, #1d3a8f);
  position: fixed;
  top: 50%;
  right: 0;
  z-index: 1000;
  display: grid;
  width: 92px;
  border-radius: 18px 0 0 18px;
  background: #fff;
  box-shadow: 0 12px 32px rgb(20 30 60 / 25%);
  font-family: var(--lauf);
  transform: translateY(-50%);
  animation: rr-andocken 0.45s ease-out;
}

.rr__knopf {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 14px 8px 12px;
  border: 0;
  border-radius: 18px 0 0;
  background: var(--rr-blau);
  color: #fff;
  font: inherit;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
}

.rr__knopf:hover {
  background: #1a2f75;
}

/* Foto Victoria Kawaletz: runder Ausschnitt, enger aufs Gesicht (Original zeigt bis zur Schulter) */
.rr__foto {
  display: block;
  flex: none;
  overflow: hidden;
  border-radius: 50%;
  background: #f1f3f5;
}

.rr__foto img {
  display: block;
  width: 100%;
  height: 100%;
  transform: scale(1.45);
  transform-origin: 50% 32%;
}

.rr__knopf .rr__foto {
  width: 56px;
  height: 56px;
  box-shadow: 0 0 0 3px #fff;
}

.rr__knopf > span:last-child {
  font-size: 14px;
}

.rr__knopf strong {
  display: block;
  font-size: 17px;
}

.rr__buchen {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 12px 6px 14px;
  border-radius: 0 0 0 18px;
  color: var(--rr-blau);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.rr__buchen:hover {
  background: #eef1f9;
}

.rr__buchen svg {
  width: 26px;
  height: 26px;
}

@keyframes rr-andocken {
  from {
    transform: translate(100%, -50%);
  }
}

/* Schmalere Fenster und Handy: runder Knopf unten rechts */
@media (max-width: 1359px) {
  .rr {
    top: auto;
    right: 16px;
    bottom: 16px;
    width: auto;
    border-radius: 999px;
    background: none;
    box-shadow: none;
    transform: none;
    animation-name: rr-auftauchen;
  }

  .rr__knopf {
    grid-auto-flow: column;
    align-items: center;
    gap: 10px;
    padding: 6px 20px 6px 6px;
    border-radius: 999px;
    box-shadow: 0 10px 28px rgb(20 30 60 / 30%);
  }

  .rr__knopf .rr__foto {
    width: 48px;
    height: 48px;
  }

  .rr__knopf > span:last-child {
    font-size: 16px;
    font-weight: 700;
  }

  .rr__knopf strong {
    display: inline;
    font-size: inherit;
  }

  .rr__buchen {
    display: none;
  }
}


@keyframes rr-auftauchen {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}

/* ---------- Dialog (Seitenleiste von rechts, Handy: ganze Fläche) ---------- */
.rr__dialog {
  --rr-blau: var(--b, #1d3a8f);
  --rr-rahmen: #6c757d;
  --rr-fehler: #b00020;
  width: min(480px, 100vw);
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 0 0 auto;
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 0;
  border-radius: 20px 0 0 20px;
  background: #fff;
  color: #1b2340;
  font: 16px/1.5 var(--lauf);
}

.rr__dialog[open] {
  animation: rr-rein 0.3s ease-out;
}

.rr__dialog::backdrop {
  background: rgb(15 23 42 / 55%);
}

html:has(.rr__dialog[open]) {
  overflow: hidden;
}

@keyframes rr-rein {
  from {
    transform: translateX(40px);
    opacity: 0;
  }
}

.rr__innen {
  display: grid;
  align-content: start;
  gap: 18px;
  min-height: 100%;
  padding: 20px 24px 28px;
}

.rr__dialog :is(button, a, input, select, textarea):focus-visible,
.rr__dialog :is(h3, .rr__fehler):focus-visible {
  outline: 3px solid var(--rr-blau);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px #fff;
}

.rr__kopf {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 44px;
  gap: 14px;
  align-items: center;
}

.rr__kopf .rr__foto {
  width: 64px;
  height: 64px;
  box-shadow: 0 0 0 3px #eef1f9;
}

.rr__kopf h2 {
  margin: 0;
  color: #1b2340;
  font-size: 22px;
  line-height: 1.2;
}

.rr__kopf p {
  margin: 2px 0 0;
  color: #495057;
  font-size: 14.5px;
}

.rr__zeiten {
  white-space: nowrap;
}

.rr__zu {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  align-self: start;
  border: 2px solid #ced4da;
  border-radius: 50%;
  background: #fff;
  color: #1b2340;
  cursor: pointer;
}

.rr__zu svg {
  width: 20px;
  height: 20px;
}

/* ---------- Formular ---------- */
.rr__form {
  display: grid;
  gap: 16px;
}

.rr__form fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.rr__form legend {
  margin-bottom: 8px;
  padding: 0;
  font-size: 15px;
  font-weight: 700;
}

.rr__anliegen,
.rr__zeit {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.rr__anliegen legend,
.rr__zeit legend {
  grid-column: 1 / -1;
}

.rr__kachel {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 6px;
  min-height: 84px;
  padding: 12px 6px;
  border: 2px solid var(--rr-rahmen);
  border-radius: 14px;
  background: #fff;
  color: #1b2340;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
}

.rr__zeit .rr__kachel {
  min-height: 60px;
  font-size: 14.5px;
}

.rr__kachel span {
  display: grid;
  gap: 2px;
}

.rr__kachel small {
  color: #495057;
  font-size: 13px;
  font-weight: 400;
}

.rr__kachel svg {
  width: 26px;
  height: 26px;
}

.rr__kachel input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.rr__kachel:hover {
  border-color: var(--rr-blau);
}

.rr__kachel:has(input:focus-visible) {
  outline: 3px solid var(--rr-blau);
  outline-offset: 3px;
}

/* Ausgewählt: Rahmen + Fläche + Haken (nicht nur Farbe, WCAG 1.4.1) */
.rr__kachel:has(input:checked) {
  border-color: var(--rr-blau);
  background: #eef1f9;
  box-shadow: inset 0 0 0 1px var(--rr-blau);
  color: var(--rr-blau);
}

.rr__kachel:has(input:checked)::after {
  position: absolute;
  top: -9px;
  right: -9px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--rr-blau) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 14px no-repeat;
  box-shadow: 0 0 0 2px #fff;
  content: "";
}

@media (forced-colors: active) {
  .rr__kachel:has(input:checked) {
    outline: 3px solid Highlight;
  }
}

.rr__pflicht,
.rr__hinweis {
  margin: 0;
  color: #495057;
  font-size: 14px;
}

.rr__hinweis {
  margin-top: 4px;
}

.rr__datenschutz {
  margin: 0 0 0 34px;
}

.rr__reihe {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.rr__reihe--plz {
  grid-template-columns: 120px minmax(0, 1fr);
}

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

.rr__feld > label {
  font-size: 15px;
  font-weight: 700;
}

.rr__stern {
  font-weight: 400;
}

.rr__feld :is(input, select, textarea) {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 2px solid var(--rr-rahmen);
  border-radius: 10px;
  background: #fff;
  color: #1b2340;
  font: inherit;
  font-size: 16px;
}

.rr__feld textarea {
  resize: vertical;
}

.rr__feld [aria-invalid="true"] {
  border-color: var(--rr-fehler);
  background: #fff5f5;
}

.rr__meldung {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  margin: 0;
  color: var(--rr-fehler);
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.35;
}

.rr__meldung::before {
  display: grid;
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  place-items: center;
  border-radius: 50%;
  background: var(--rr-fehler);
  color: #fff;
  font-size: 12px;
  content: "!";
}

.rr__haken {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  font-size: 15px;
  cursor: pointer;
}

.rr__haken input {
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  accent-color: var(--rr-blau);
}

.rr__post {
  display: grid;
  gap: 12px;
}

.rr__adresse {
  display: grid;
  gap: 12px;
}

[data-feld="einwilligung"] .rr__haken {
  color: #343a40;
  font-size: 14px;
  line-height: 1.45;
}

.rr__dialog a {
  color: var(--rr-blau);
  font-weight: 700;
}

.rr__senden {
  min-height: 52px;
  padding: 12px 24px;
  border: 0;
  border-radius: 999px;
  background: var(--rr-blau);
  color: #fff;
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
}

.rr__senden:hover {
  background: #1a2f75;
}

/* Fehlerliste oben (bekommt den Fokus nach dem Absenden) */
.rr__fehler {
  padding: 14px 16px;
  border: 2px solid var(--rr-fehler);
  border-left-width: 6px;
  border-radius: 12px;
  background: #fff5f5;
}

.rr__fehler h3 {
  margin: 0 0 6px;
  color: var(--rr-fehler);
  font-size: 16px;
}

.rr__fehler ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
}

.rr__fehler a {
  color: var(--rr-fehler);
}

/* ---------- Danke ---------- */
.rr__danke {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 24px 8px;
  text-align: center;
}

.rr__danke-symbol {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border-radius: 50%;
  background: #2b8a3e;
  color: #fff;
}

.rr__danke-symbol svg {
  width: 34px;
  height: 34px;
  stroke-width: 3;
}

.rr__danke h3 {
  margin: 4px 0 0;
  font-size: 24px;
}

.rr__danke p {
  max-width: 36ch;
  margin: 0;
}

.rr__vorschau {
  padding: 6px 12px;
  border-radius: 8px;
  background: #f1f3f5;
  color: #495057;
  font-size: 14px;
}

/* ---------- Direkter Kontakt (vorher in der Sprechblase) ---------- */
.rr__direkt {
  display: grid;
  gap: 6px;
  padding-top: 16px;
  border-top: 1px solid #dee2e6;
  font-size: 15px;
}

.rr__direkt a {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  min-height: 32px;
  text-decoration: none;
}

.rr__direkt a:hover {
  text-decoration: underline;
}

.rr__direkt svg {
  width: 20px;
  height: 20px;
}

@media (max-width: 575px) {
  .rr__dialog {
    border-radius: 0;
  }

  .rr__innen {
    padding: 16px 16px 24px;
  }

  .rr__kachel {
    font-size: 14px;
  }
}

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

@media (prefers-reduced-motion: reduce) {
  .rr,
  .rr__dialog[open] {
    animation: none;
  }
}

/* Meister Fernschule: Überschriften in Mulish, „Nach oben“ über dem Knopf */
.rr__knopf strong,.rr__dialog h2,.rr__dialog h3{font-family:var(--titel)}
@media (max-width:1359px){.nach-oben{bottom:88px}}
/* Kursseiten am Handy (sobald die Buchungsleiste eingeblendet ist): rundes Foto darüber, „Nach oben“ darüber */
@media (max-width:767px){
  body.hat-buchungsleiste .rr{bottom:86px}
  body.hat-buchungsleiste .rr__knopf{padding:4px}
  body.hat-buchungsleiste .rr__knopf>span:last-child{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
  body.hat-buchungsleiste .rr__knopf .rr__foto{width:56px;height:56px}
  body.hat-buchungsleiste .nach-oben{bottom:158px}
}
/* Solange ein Dialog offen ist, keinen zweiten Knopf zeigen */
body.hat-dialog .rr{visibility:hidden}
/* Spamfalle: für Menschen unsichtbar, für Screenreader ausgeblendet */
.rr__hp{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}
.rr__senden[aria-busy="true"]{opacity:.7;cursor:progress}
