/* Termin buchen */
.termin {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 20px 50px;
    color: #0b3440;
}

.termin h1 {
    margin: 0 0 8px;
    color: #388a9c;
    text-align: center;
    text-transform: uppercase;
}

.termin_intro {
    margin: 0 auto 24px;
    max-width: 640px;
    text-align: center;
}

.termin_hinweise {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: 14px;
    margin: 0 0 28px;
    padding: 0;
    list-style: none;
}

.termin_hinweise li {
    padding: 14px 16px;
    border-left: 4px solid #388a9c;
    border-radius: 12px;
    background: #388a9c14;
    line-height: 1.45;
}

.termin_hinweise strong {
    display: block;
    margin-bottom: 4px;
    color: #286c7c;
}

.termin_hinweise a {
    color: #286c7c;
    font-weight: bold;
}

.termin .termin_form {
    max-width: none;
    padding: 24px;
    border: 1px solid #388a9c40;
    border-radius: 24px;
    background: white;
    box-shadow: 0 14px 34px #082f4914;
}

.termin_auswahl {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.termin_auswahl [hidden] {
    display: none;
}

.termin.anfrage {
    max-width: 900px;
    padding-top: 0;
}

.termin_bereich {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    animation: termin-bereich-ein .3s ease;
}

.termin_legende {
    margin-bottom: 14px;
    padding: 0;
    color: #0b3440;
    font-size: 1.2rem;
    font-weight: bold;
}

.termin_form > .termin_bereich + .termin_daten {
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid #388a9c26;
}

.termin_hinweise.kompakt {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
    gap: 10px;
    margin-bottom: 20px;
    font-size: .9rem;
}

.termin_hinweise.kompakt li {
    padding: 10px 12px;
}

/* Checkbox "Ich möchte einen Termin vereinbaren" als Schalter */
.termin_schalter {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 6px 0 22px;
    padding: 16px 18px;
    border: 1px solid #388a9c55;
    border-radius: 16px;
    background: #388a9c0d;
    cursor: pointer;
    transition: background-color .2s ease, border-color .2s ease;
}

.termin_schalter:hover {
    background: #388a9c1a;
}

.termin_schalter input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    padding: 0;
    opacity: 0;
}

.schalter_regler {
    position: relative;
    flex: 0 0 auto;
    width: 48px;
    height: 28px;
    border-radius: 999px;
    background: #b9c6cb;
    transition: background-color .2s ease;
}

.schalter_regler::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 2px 5px #082f4933;
    transition: transform .2s ease;
}

.termin_schalter input:checked + .schalter_regler {
    background: #388a9c;
}

.termin_schalter input:checked + .schalter_regler::after {
    transform: translateX(20px);
}

.termin_schalter input:focus-visible + .schalter_regler {
    outline: 3px solid #4fc3ff;
    outline-offset: 2px;
}

.termin_schalter:has(input:checked) {
    border-color: #388a9c;
    background: #388a9c1a;
}

.schalter_text {
    display: grid;
    gap: 2px;
    color: #0b3440;
}

.schalter_text small {
    color: #5b7480;
    font-size: .85rem;
}

/* Ein-/Ausblenden je nach Schalter (funktioniert auch ohne JavaScript) */
.termin_form:has(.termin_schalter input:not(:checked)) .termin_bereich,
.termin_form:has(.termin_schalter input:not(:checked)) .senden_termin,
.termin_form:has(.termin_schalter input:checked) .termin_feld_betreff,
.termin_form:has(.termin_schalter input:checked) .senden_nachricht {
    display: none;
}

.termin_form .termin_bereich + .termin_datenschutz,
.termin_form .termin_bereich + .cf-turnstile,
.termin_form .termin_bereich + p {
    margin-top: 24px;
}

@keyframes termin-bereich-ein {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
}

/* Kalender */
.kalender_kopf {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.kalender_monat,
.zeiten_titel {
    margin: 0;
    color: #0b3440;
    font-size: 1.2rem;
}

.termin .kalender_nav {
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid #388a9c55;
    border-radius: 50%;
    background: white;
    color: #286c7c;
    font-size: 1.5rem;
    line-height: 1;
}

.termin .kalender_nav:hover:not(:disabled) {
    background: #388a9c;
    color: white;
}

.termin .kalender_nav:disabled {
    opacity: .35;
    cursor: not-allowed;
}

.kalender_wochentage,
.kalender_tage {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
}

.kalender_wochentage {
    margin-bottom: 6px;
    color: #5b7480;
    font-size: .85rem;
    font-weight: bold;
    text-align: center;
}

.termin .kalender_tag {
    aspect-ratio: 1;
    min-height: 36px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: .95rem;
    transition: transform .2s ease, background-color .2s ease, box-shadow .2s ease;
}

.termin .kalender_tag.frei {
    border-color: #388a9c66;
    background: #388a9c1a;
    color: #0b3440;
    font-weight: bold;
}

.termin .kalender_tag.frei:hover {
    background: #388a9c40;
    transform: translateY(-2px);
}

.termin .kalender_tag.gewaehlt,
.termin .kalender_tag.gewaehlt:hover {
    background: #388a9c;
    color: white;
    box-shadow: 0 6px 14px #388a9c55;
}

.termin .kalender_tag.feiertag {
    background: #c9cfd2;
    color: #6b767b;
    text-decoration: line-through;
}

.termin .kalender_tag.belegt {
    background: #f1f3f4;
    color: #a9b2b6;
}

.termin .kalender_tag:disabled {
    cursor: not-allowed;
}

.kalender_tag.leer {
    visibility: hidden;
}

.kalender_legende {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin: 14px 0 0;
    padding: 0;
    color: #5b7480;
    font-size: .85rem;
    list-style: none;
}

.kalender_legende li {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legende_punkt {
    width: 12px;
    height: 12px;
    border-radius: 4px;
}

.legende_punkt.frei { background: #388a9c40; border: 1px solid #388a9c; }
.legende_punkt.gewaehlt { background: #388a9c; }
.legende_punkt.feiertag { background: #c9cfd2; }
.legende_punkt.belegt { background: #f1f3f4; border: 1px solid #d5dbde; }

/* Uhrzeiten */
.termin_zeiten {
    padding: 18px;
    border-radius: 18px;
    background: #f4f8f9;
}

.zeiten_hinweis {
    margin: 6px 0 14px;
    color: #5b7480;
}

.zeiten_liste {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.termin .zeit_button {
    padding: 10px 8px;
    border: 1px solid #388a9c66;
    background: white;
    color: #286c7c;
    font-weight: bold;
    transition: transform .2s ease, background-color .2s ease;
}

.termin .zeit_button:hover {
    background: #388a9c1a;
    transform: translateY(-2px);
}

.termin .zeit_button[aria-pressed="true"] {
    background: #388a9c;
    color: white;
}

.termin_fallback select {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
}

/* Ausgewählter Termin und Kontaktdaten */
.termin_auswahl_info {
    margin: 20px 0 0;
    padding: 12px 16px;
    border-radius: 12px;
    background: #388a9c14;
}

.termin_daten {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 20px;
    margin-top: 22px;
}

.termin_feld {
    margin: 0;
}

.termin_feld label {
    display: block;
    margin-bottom: 6px;
    color: #286c7c;
    font-weight: bold;
}

.termin_feld_nachricht {
    grid-column: 1 / -1;
}

.termin_feld_attachments {
    grid-column: 1 / -1;
    margin-bottom: 20px;
}

.attachment-help {
    display: block;
    margin-top: 8px;
    line-height: 1.5;
    color: #355663;
}

.termin_fehler,
.termin .errorlist {
    margin: 10px 0;
    padding: 0;
    color: #b42318;
    list-style: none;
}

.termin_datenschutz {
    color: #5b7480;
    font-size: .85rem;
}

.termin_datenschutz a {
    color: #286c7c;
}

.termin .termin_senden {
    width: 100%;
    padding: 14px 24px;
    font-weight: bold;
}

.termin :is(button, a, select, input, textarea):focus-visible {
    outline: 3px solid #4fc3ff;
    outline-offset: 2px;
}

@media (max-width: 768px) {
    .termin_auswahl,
    .termin_daten {
        grid-template-columns: minmax(0, 1fr);
    }

    .termin .termin_form {
        padding: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .termin .kalender_tag,
    .termin .zeit_button,
    .termin_schalter,
    .schalter_regler,
    .schalter_regler::after {
        transition: none;
    }

    .termin_bereich {
        animation: none;
    }

    .termin .kalender_tag.frei:hover,
    .termin .zeit_button:hover {
        transform: none;
    }
}
