/* ─── RSVP-Unterseite (/rsvp) ─────────────────────── */
/* Schwarzer Grund, weiße Schrift, alles zentriert. Gilt nur mit body.rsvp-standalone. */

/* Farb-Tokens tauschen: alle bestehenden Regeln mit var(--black)/var(--white) werden invertiert */
body.rsvp-standalone {
  --black: #ffffff;
  --white: #000000;
  --grey:  #5a5a58;
  color-scheme: dark;
  background: #000000;
  color: #ffffff;
  text-align: center;
}

.rsvp-standalone :focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

/* ─── Zurück-Button oben links ───────────────────── */
.rsvp-back {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  left: max(14px, env(safe-area-inset-left));
  z-index: 100;
  padding: .35em .9em;
  border: .5px solid currentColor;
  background: #000000;
  font-size: .85rem;
  font-style: italic;
  white-space: nowrap;
}

.rsvp-back:hover {
  text-decoration: none;
  background: #1a1a1a;
}

/* ─── Kopf: Logo, Eröffnung ──────────────────────── */
.rsvp-main {
  max-width: 40rem;
  margin: 0 auto;
  padding: calc(max(14px, env(safe-area-inset-top)) + 4.5rem) clamp(18px, 5vw, 32px) 3rem;
}

.rsvp-logo {
  display: block;
  height: clamp(5.5rem, 12vw, 8.5rem);
  width: auto;
  margin: 0 auto 1.8rem;
  filter: invert(1);
}

.rsvp-opening {
  font-size: clamp(1.5rem, 3.6vw, 2.4rem);
  line-height: 1.3;
}

.rsvp-address {
  display: block;
  margin-top: 1.2em;
  font-size: .55em;
  font-weight: 400;
}

/* ─── Formular ───────────────────────────────────── */
.rsvp-section {
  margin-top: clamp(2.5rem, 7vh, 4.5rem);
}

.rsvp-heading {
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  font-style: italic;
}

.rsvp-standalone .rsvp-form {
  max-width: 30rem;
  margin: 1.2em auto 0;
  gap: 1.4em;
  font-size: clamp(1.15rem, 1.6vw, 1.35rem);
}

/* style.css setzt display: grid, ohne diese Regel bliebe das Formular nach dem Absenden sichtbar */
.rsvp-standalone .rsvp-form[hidden] {
  display: none;
}

.rsvp-standalone .rsvp-field {
  align-items: center;
}

.rsvp-standalone .rsvp-field > label {
  font-size: .8em;
}

.rsvp-standalone .rsvp-input {
  text-align: center;
  /* mind. 16px, sonst zoomt iOS beim Antippen */
  font-size: max(16px, 1em);
}

/* Fehlerhafte Felder: nur roter Strich, kein sichtbarer Text.
   Die Meldung bleibt für Screenreader erhalten (über aria-describedby). */
.rsvp-standalone .rsvp-input[aria-invalid="true"] {
  border-bottom: 2px solid #ff4d4d;
}

.rsvp-standalone .rsvp-error {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Runde Checkbox: Kreis und Text sind ein gemeinsames Label, die ganze Zeile ist klickbar.
   Das echte <input> bleibt (unsichtbar) erhalten: Tastatur und Screenreader funktionieren. */
.rsvp-standalone .rsvp-check {
  flex-direction: row;
  justify-content: center;
}

.rsvp-standalone .rsvp-check > .rsvp-check-label {
  position: relative;
  display: inline-flex;
  /* Satz oben, Kreis darunter */
  flex-direction: column-reverse;
  align-items: center;
  gap: .6em;
  max-width: 26em;
  padding: .5em .9em;
  font-size: .85em;
  font-style: normal;
  text-align: center;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.rsvp-standalone .rsvp-check-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.rsvp-check-box {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  /* zweiter weißer Kreis mit schwarzem Abstand */
  box-shadow: 0 0 0 6px #000000, 0 0 0 8px #ffffff;
  margin: 8px;
  transition: background-color .18s ease;
}

.rsvp-check-box svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: #ffffff;
  opacity: 0;
  transition: opacity .15s ease;
}

/* Hover: halbtransparentes Häkchen im leeren Kreis */
@media (hover: hover) {
  .rsvp-check-label:hover .rsvp-check-input:not(:checked) + .rsvp-check-box svg {
    opacity: .45;
  }
}

/* Aktiv: weiß gefüllt, schwarzes Häkchen, kurze Animation */
.rsvp-check-input:checked + .rsvp-check-box {
  background: #ffffff;
  animation: rsvp-check-pop .22s ease-out;
}

.rsvp-check-input:checked + .rsvp-check-box svg {
  color: #000000;
  opacity: 1;
}

/* Fokusring bei Tastaturbedienung */
.rsvp-check-input:focus-visible + .rsvp-check-box {
  outline: 2px dashed #ffffff;
  outline-offset: 13px;
}

@keyframes rsvp-check-pop {
  0%   { transform: scale(.8); }
  60%  { transform: scale(1.12); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .rsvp-check-input:checked + .rsvp-check-box { animation: none; }
}

@media (forced-colors: active) {
  .rsvp-check-box { border-color: CanvasText; }
  .rsvp-check-input:checked + .rsvp-check-box { background: Highlight; }
  .rsvp-check-input:checked + .rsvp-check-box svg { color: HighlightText; }
}

.rsvp-form-error {
  padding: .6em 1em;
  border: .5px solid currentColor;
  font-size: .9em;
  font-style: italic;
}

.rsvp-form-error:empty {
  display: none;
}

.rsvp-standalone .rsvp-submit {
  justify-self: center;
  padding: .5em 1.8em;
  border-width: 1px;
  font-size: clamp(1.3rem, 2.2vw, 1.6rem);
}

.rsvp-standalone .rsvp-submit:hover {
  background: rgba(255,255,255,.12);
}

.rsvp-standalone .rsvp-submit:disabled {
  opacity: .55;
  cursor: progress;
}

/* Register-Button: weiß gefüllt, größer, mit mehr Raum drumherum */
.rsvp-standalone .rsvp-form .rsvp-submit {
  margin: 1.4em 0;
  padding: .65em 2.6em;
  border-color: #ffffff;
  background: #ffffff;
  color: #000000;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
}

.rsvp-standalone .rsvp-form .rsvp-submit:hover {
  background: #d9d9d6;
}

/* Kleingedrucktes mit deutlichem Abstand unter dem Button */
.rsvp-standalone .rsvp-form .rsvp-submit + .rsvp-note {
  margin-top: clamp(4rem, 12vh, 7rem);
}

.rsvp-standalone .rsvp-note {
  max-width: 34em;
  margin: 0 auto;
  font-size: .65em;
  line-height: 1.5;
  opacity: .75;
}

.rsvp-standalone .rsvp-note + .rsvp-note {
  margin-top: -1em;
}

.rsvp-standalone .rsvp-turnstile {
  display: flex;
  justify-content: center;
}

/* ─── Bestätigung (ersetzt das Formular) ─────────── */
.rsvp-confirm {
  max-width: 30rem;
  margin: 1.6em auto 0;
}

.rsvp-confirm:focus {
  outline: none;
}

.rsvp-confirm-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 400;
  font-style: italic;
  line-height: 1.1;
}

/* Timetable auf der Bestätigungsseite: jeder Tag ein eigener Block mit viel Luft */
.rsvp-timetable {
  margin-top: 2.6em;
  font-size: clamp(1.1rem, 1.7vw, 1.3rem);
  line-height: 1.45;
}

/* Kurze Linie zwischen den Tagen und vor dem Ort */
.rsvp-tt-day + .rsvp-tt-day,
.rsvp-tt-place {
  position: relative;
  margin-top: 1.4em;
  padding-top: 1.4em;
}

.rsvp-tt-day + .rsvp-tt-day::before,
.rsvp-tt-place::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 3rem;
  border-top: 1px solid rgba(255,255,255,.4);
  transform: translateX(-50%);
}

.rsvp-tt-date,
.rsvp-timetable strong { font-weight: 700; }

.rsvp-tt-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .8em;
  margin-top: 2.2em;
}

/* Kleine Buttons, gleiche Form wie die übrigen Buttons der Seite */
.rsvp-tt-button {
  display: inline-block;
  padding: .4em 1.4em;
  border: 1px solid #ffffff;
  color: #ffffff;
  font-size: .8em;
  font-style: italic;
  text-decoration: none;
}

.rsvp-tt-button:hover { background: rgba(255,255,255,.12); }

.rsvp-tt-button:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

.rsvp-confirm-text {
  margin-top: .6em;
  font-size: clamp(1.15rem, 1.8vw, 1.4rem);
  line-height: 1.5;
}

.rsvp-confirm-doi {
  margin-top: 1.6em;
  font-size: clamp(1.15rem, 1.8vw, 1.4rem);
  line-height: 1.5;
}

.rsvp-confirm-hint {
  margin-top: .8em;
  font-size: .8rem;
  line-height: 1.5;
  opacity: .75;
}

.rsvp-offer-done:focus {
  outline: none;
}

.rsvp-standalone .rsvp-offer {
  max-width: 30rem;
  margin: 2.6em auto 0;
  padding-top: 2em;
  border-top: .5px solid var(--grey);
  justify-items: center;
}

.rsvp-offer-text {
  font-size: .95em;
}

.rsvp-standalone .rsvp-offer .rsvp-submit {
  font-size: 1.1em;
}

.rsvp-offer-status {
  font-style: italic;
}

.rsvp-offer-status:empty {
  display: none;
}

/* ─── Fußzeile ───────────────────────────────────── */
.rsvp-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .6em 1.6em;
  padding: 2rem clamp(18px, 5vw, 32px) calc(2rem + env(safe-area-inset-bottom));
  font-size: .75rem;
  opacity: .75;
}

.rsvp-footer button {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.rsvp-footer .rsvp-ds-link {
  text-decoration: none;
}

.rsvp-footer a:hover,
.rsvp-footer button:hover {
  text-decoration: underline;
}

/* ─── Datenschutz-Overlay ebenfalls dunkel ───────── */
.rsvp-standalone #ds-overlay {
  background: #000000;
}

.rsvp-standalone .ds-content,
.rsvp-standalone .ds-close {
  color: #ffffff;
}
