/* Online-Terminbuchung – Kalender-UI (lokal, keine externen Fonts/Skripte) */

/* Modals: ein Scroll-Container (Shell), Panel ohne eigenes overflow – iOS-Clipping vermeiden */
.site-overlay {
    z-index: 100;
    overscroll-behavior: none;
    /* kein w-screen/100vw — verursacht auf iOS horizontalen Overflow */
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
}

/* Sicherstellen, dass das Overlay wirklich weg ist (sonst kein Scroll / kein Dark-Toggle) */
.site-overlay.hidden {
    display: none !important;
    pointer-events: none !important;
}

.site-modal-shell {
    position: fixed;
    z-index: 110;
    inset: 0;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: scroll;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: max(0.75rem, env(safe-area-inset-top, 0px))
        max(0.75rem, env(safe-area-inset-right, 0px))
        max(0.75rem, env(safe-area-inset-bottom, 0px))
        max(0.75rem, env(safe-area-inset-left, 0px));
    display: flex;
    flex-direction: column;
    align-items: center;
}

.site-modal-shell.hidden {
    display: none !important;
}

.site-modal__panel {
    width: min(95vw, 36rem);
    margin-block: auto;
    flex-shrink: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-sizing: border-box;
}

.site-modal__panel--narrow {
    width: min(95vw, 32rem);
}

.site-modal__panel--wide {
    width: min(95vw, 48rem);
}

html.modal-open,
body.modal-open {
    overflow: hidden;
    overscroll-behavior: none;
}

body.modal-open .site-dark-toggle {
    visibility: hidden;
    pointer-events: none;
    opacity: 0;
}

#booking-modal input,
#booking-modal textarea {
    font-size: 16px;
}

#booking-form {
    padding-bottom: 0.25rem;
}

.booking-calendar-wrap {
    border: 1px solid rgb(212 212 216);
    border-radius: 0.75rem;
    padding: 0.75rem;
    background: rgb(250 250 250);
}

.dark .booking-calendar-wrap {
    border-color: rgb(63 63 70);
    background: rgb(24 24 27);
}

.booking-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.booking-cal-header button {
    padding: 0.25rem 0.6rem;
    border-radius: 0.5rem;
    background: rgb(228 228 231);
    color: rgb(24 24 27);
    border: none;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
}

.dark .booking-cal-header button {
    background: rgb(63 63 70);
    color: rgb(244 244 245);
}

.booking-cal-header button:hover {
    opacity: 0.85;
}

.booking-cal-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: rgb(24 24 27);
}

.dark .booking-cal-title {
    color: rgb(244 244 245);
}

.booking-cal-weekdays,
.booking-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.25rem;
}

.booking-cal-weekdays .booking-cal-wd {
    text-align: center;
    font-size: 0.65rem;
    text-transform: lowercase;
    color: rgb(113 113 122);
    padding-bottom: 0.25rem;
}

.booking-cal-weekdays .booking-cal-wd.is-weekend {
    color: rgb(161 161 170);
    font-weight: 600;
}

.dark .booking-cal-weekdays .booking-cal-wd.is-weekend {
    color: rgb(113 113 122);
}

.booking-cal-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    margin-top: 0.65rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgb(228 228 231);
    font-size: 0.65rem;
    text-transform: lowercase;
    color: rgb(113 113 122);
}

.dark .booking-cal-legend {
    border-top-color: rgb(63 63 70);
    color: rgb(161 161 170);
}

.booking-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.booking-legend-swatch {
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 0.15rem;
    flex-shrink: 0;
}

.booking-legend-swatch.is-weekend {
    background: repeating-linear-gradient(
        -45deg,
        rgb(228 228 231),
        rgb(228 228 231) 2px,
        rgb(244 244 245) 2px,
        rgb(244 244 245) 4px
    );
    border: 1px solid rgb(212 212 216);
}

.dark .booking-legend-swatch.is-weekend {
    background: repeating-linear-gradient(
        -45deg,
        rgb(63 63 70),
        rgb(63 63 70) 2px,
        rgb(39 39 42) 2px,
        rgb(39 39 42) 4px
    );
    border-color: rgb(82 82 91);
}

.booking-legend-swatch.is-holiday {
    background: rgb(254 226 226);
    border: 1px solid rgb(252 165 165);
}

.dark .booking-legend-swatch.is-holiday {
    background: rgb(127 29 29 / 0.45);
    border-color: rgb(185 28 28 / 0.5);
}

.booking-cal-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    border-radius: 0.5rem;
    border: none;
    background: transparent;
    color: rgb(161 161 170);
    cursor: default;
}

.booking-cal-day.is-empty {
    visibility: hidden;
}

/* Wochenende – schraffiert, nicht wählbar */
.booking-cal-day.is-weekend {
    background: repeating-linear-gradient(
        -45deg,
        rgb(244 244 245),
        rgb(244 244 245) 3px,
        rgb(250 250 250) 3px,
        rgb(250 250 250) 6px
    );
    color: rgb(161 161 170);
    cursor: not-allowed;
    opacity: 0.85;
}

.dark .booking-cal-day.is-weekend {
    background: repeating-linear-gradient(
        -45deg,
        rgb(39 39 42),
        rgb(39 39 42) 3px,
        rgb(24 24 27) 3px,
        rgb(24 24 27) 6px
    );
    color: rgb(113 113 122);
}

/* Feiertag – dezenter Rotton */
.booking-cal-day.is-holiday {
    background: rgb(254 242 242);
    color: rgb(185 28 28);
    font-weight: 500;
    cursor: not-allowed;
    box-shadow: inset 0 0 0 1px rgb(254 202 202);
}

.dark .booking-cal-day.is-holiday {
    background: rgb(127 29 29 / 0.35);
    color: rgb(252 165 165);
    box-shadow: inset 0 0 0 1px rgb(185 28 28 / 0.4);
}

/* Werktag ohne freie Slots */
.booking-cal-day.is-no-slots {
    color: rgb(212 212 216);
    cursor: not-allowed;
}

.dark .booking-cal-day.is-no-slots {
    color: rgb(82 82 91);
}

.booking-cal-day.has-slots {
    background: rgb(228 228 231);
    color: rgb(24 24 27);
    cursor: pointer;
    font-weight: 600;
}

.dark .booking-cal-day.has-slots {
    background: rgb(63 63 70);
    color: rgb(244 244 245);
}

.booking-cal-day.has-slots:hover {
    background: rgb(212 212 216);
}

.booking-cal-day.is-selected:not(.is-holiday):not(.is-weekend) {
    background: rgb(24 24 27);
    color: rgb(250 250 250);
}

.dark .booking-cal-day.is-selected:not(.is-holiday):not(.is-weekend) {
    background: rgb(244 244 245);
    color: rgb(24 24 27);
}

.booking-times {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    min-height: 2rem;
}

.booking-time-btn {
    padding: 0.4rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid rgb(212 212 216);
    background: white;
    color: rgb(24 24 27);
    font-size: 0.8rem;
    cursor: pointer;
}

.dark .booking-time-btn {
    border-color: rgb(63 63 70);
    background: rgb(39 39 42);
    color: rgb(244 244 245);
}

.booking-time-btn:hover {
    border-color: rgb(24 24 27);
}

.booking-time-btn.is-selected {
    background: rgb(24 24 27);
    color: white;
    border-color: rgb(24 24 27);
}

.dark .booking-time-btn.is-selected {
    background: rgb(244 244 245);
    color: rgb(24 24 27);
}

.booking-cal-loading {
    text-align: center;
    padding: 1.5rem;
    font-size: 0.875rem;
    color: rgb(113 113 122);
}

.booking-selected-label {
    font-size: 0.8rem;
    color: rgb(82 82 91);
    margin-top: 0.5rem;
    min-height: 1.25rem;
}

.dark .booking-selected-label {
    color: rgb(161 161 170);
}

/* Buchungs-Fortschritt & Erfolg */
#booking-form.is-hidden,
#booking-header.is-hidden {
    display: none !important;
}

.booking-process {
    padding: 1.5rem 0.5rem;
    text-align: center;
}

.booking-process-title {
    font-size: 1rem;
    font-weight: 600;
    color: rgb(24 24 27);
    margin-bottom: 1.25rem;
}

.dark .booking-process-title {
    color: rgb(244 244 245);
}

.booking-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    text-align: left;
    max-width: 280px;
    margin-inline: auto;
}

.booking-step {
    position: relative;
    padding: 0.65rem 0 0.65rem 2rem;
    font-size: 0.9rem;
    color: rgb(161 161 170);
    transition: color 0.25s ease;
}

.booking-step::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 50%;
    border: 2px solid rgb(212 212 216);
    background: transparent;
    transition: all 0.25s ease;
}

.booking-step.is-active {
    color: rgb(24 24 27);
    font-weight: 500;
}

.dark .booking-step.is-active {
    color: rgb(244 244 245);
}

.booking-step.is-active::before {
    border-color: rgb(24 24 27);
    background: rgb(24 24 27);
    box-shadow: 0 0 0 3px rgb(228 228 231);
}

.dark .booking-step.is-active::before {
    border-color: rgb(244 244 245);
    background: rgb(244 244 245);
    box-shadow: 0 0 0 3px rgb(63 63 70);
}

.booking-step.is-done {
    color: rgb(82 82 91);
}

.booking-step.is-done::before {
    border-color: rgb(34 197 94);
    background: rgb(34 197 94);
}

.booking-success {
    text-align: center;
    padding: 1.5rem 0.5rem 0.5rem;
}

.booking-success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: rgb(34 197 94);
    color: white;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
}

.booking-success-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: rgb(24 24 27);
    margin: 0 0 0.5rem;
}

.dark .booking-success-title {
    color: rgb(244 244 245);
}

.booking-success-text {
    font-size: 0.9rem;
    color: rgb(82 82 91);
    line-height: 1.5;
    margin: 0;
}

.dark .booking-success-text {
    color: rgb(161 161 170);
}

.booking-success-text.is-warn {
    color: rgb(180 83 9);
}

.dark .booking-success-text.is-warn {
    color: rgb(250 204 21);
}

.booking-success-teams {
    margin: 0.75rem 0 0;
}

.booking-success-teams.hidden {
    display: none;
}

.booking-teams-btn {
    display: inline-block;
    padding: 0.55rem 1rem;
    border-radius: 0.5rem;
    background: rgb(24 24 27);
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
}

html.dark .booking-teams-btn {
    background: rgb(244 244 245);
    color: rgb(24 24 27);
}

.booking-teams-btn:hover {
    opacity: 0.9;
}

/* Termin absagen – eigenständige Seite (Modal, lokal, kein externes JS) */
.cancel-page-body {
    margin: 0;
    min-height: 100vh;
    font-family: system-ui, -apple-system, sans-serif;
    background: rgb(228 228 231);
    color: rgb(24 24 27);
}

html.dark .cancel-page-body {
    background: rgb(39 39 42);
    color: rgb(244 244 245);
}

.cancel-overlay {
    position: fixed;
    inset: 0;
    background: rgb(0 0 0 / 0.55);
    backdrop-filter: blur(2px);
}

/* Absage-Modal eingebettet in index.php (über #overlay) */
.cancel-layer {
    position: fixed;
    z-index: 120;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    pointer-events: none;
}

.cancel-layer .cancel-modal {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    pointer-events: auto;
}

.cancel-modal {
    position: fixed;
    z-index: 10;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(92vw, 420px);
    padding: 2rem 1.75rem 1.75rem;
    border-radius: 0.75rem;
    background: white;
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.35);
    text-align: center;
}

html.dark .cancel-modal {
    background: rgb(39 39 42);
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.6);
}

.cancel-brand {
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    text-transform: lowercase;
    color: rgb(113 113 122);
    margin: 0 0 1rem;
}

.cancel-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.25rem;
    height: 3.25rem;
    margin: 0 auto 1rem;
    border-radius: 50%;
    font-size: 1.5rem;
    line-height: 1;
}

.cancel-icon.is-success {
    background: rgb(228 228 231);
    color: rgb(82 82 91);
}

html.dark .cancel-icon.is-success {
    background: rgb(63 63 70);
    color: rgb(212 212 216);
}

.cancel-icon.is-already {
    background: rgb(254 243 199);
    color: rgb(161 98 7);
}

.cancel-icon.is-error {
    background: rgb(254 226 226);
    color: rgb(185 28 28);
}

.cancel-icon.is-confirm {
    background: rgb(224 231 255);
    color: rgb(67 56 202);
}

html.dark .cancel-icon.is-confirm {
    background: rgb(49 46 129);
    color: rgb(199 210 254);
}

.cancel-actions {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    align-items: center;
    margin-top: 0.5rem;
}

.cancel-confirm-form {
    margin: 0;
    width: 100%;
}

.cancel-secondary-btn {
    display: inline-block;
    padding: 0.45rem 1rem;
    border-radius: 0.5rem;
    background: transparent;
    color: rgb(113 113 122);
    text-decoration: none;
    font-size: 0.85rem;
    border: none;
    cursor: pointer;
}

.cancel-title {
    font-size: 1.35rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    text-transform: lowercase;
}

.cancel-message {
    font-size: 0.95rem;
    color: rgb(82 82 91);
    line-height: 1.5;
    margin: 0 0 0.75rem;
}

html.dark .cancel-message {
    color: rgb(161 161 170);
}

.cancel-slot {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.25rem;
}

.cancel-topic {
    font-size: 0.85rem;
    color: rgb(113 113 122);
    margin: 0 0 0.75rem;
}

.cancel-hint {
    font-size: 0.8rem;
    color: rgb(161 161 170);
    margin: 0 0 1.25rem;
}

.cancel-home-btn {
    display: inline-block;
    padding: 0.55rem 1.25rem;
    border-radius: 0.5rem;
    background: rgb(24 24 27);
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    text-transform: lowercase;
}

html.dark .cancel-home-btn {
    background: rgb(244 244 245);
    color: rgb(24 24 27);
}

.cancel-home-btn:hover {
    opacity: 0.9;
}
