/* ════════════════════════════════════════════════════════════════════
   ARTiQ LeadGen — Terminbuchung (Frontend)
   2-Schritt-Wizard nach ARTiQ-Mockup: Tabs (Datum → Uhrzeit),
   Slot-Grid in die Breite, kompakte Höhe, Footer mit Dauer + Zeitzone.
   Scope: .af2_terminbuchungs_wrapper.artiq-booking
   ════════════════════════════════════════════════════════════════════ */

.af2_terminbuchungs_wrapper.artiq-booking {
    --bk-fg: #0f172a;
    --bk-muted: #94a3b8;
    --bk-muted-2: #64748b;
    --bk-border: #e6e9ef;
    --bk-border-soft: #eef1f5;
    --bk-hover: #f1f5f9;
    --bk-surface: #ffffff;

    display: block !important;
    background: var(--bk-surface);
    border: 1px solid var(--bk-border);
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .05);
    padding: 28px 28px 0;
    max-width: 860px;
    margin: 0 auto;
    font-variant-numeric: tabular-nums;
}

/* ── Schritt-Tabs ── */
.artiq-booking .artiq-bk-steps {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
}

.artiq-booking .artiq-bk-step {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--bk-border-soft);
    color: var(--bk-muted);
    font-size: 15px;
    font-weight: 500;
    cursor: default;
    transition: color .15s ease, border-color .15s ease;
    line-height: 1.25;
}

.artiq-booking .artiq-bk-step.artiq-active {
    color: var(--bk-fg);
    border-bottom-color: var(--bk-fg);
    font-weight: 600;
}

.artiq-booking .artiq-bk-step.artiq-clickable {
    cursor: pointer;
}

.artiq-booking .artiq-bk-step-num {
    font-weight: 600;
}

.artiq-booking .artiq-bk-step-arrow {
    color: var(--bk-muted);
    flex: 0 0 auto;
    padding-bottom: 10px;
    font-size: 13px;
}

/* ── Wizard-Panels ── */
.artiq-booking .af2_datewrapper.af2_terminbuchungs_wrap,
.artiq-booking > .af2_terminbuchungs_wrap {
    width: 100% !important;
    max-width: none !important;
    float: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.artiq-booking.artiq-step-time .af2_datewrapper.af2_terminbuchungs_wrap {
    display: none !important;
}

.artiq-booking:not(.artiq-step-time) > .af2_terminbuchungs_wrap:not(.af2_datewrapper) {
    display: none !important;
}

/* ── Kalender (jQuery UI Reskin) ── */
.artiq-booking .af2_terminbuchung_datewrapper {
    background: var(--bk-surface);
    border: 1px solid var(--bk-border);
    border-radius: 14px;
    padding: 18px 20px;
    max-width: 560px;
    margin: 0 auto 28px;
    box-shadow: none;
}

.artiq-booking .ui-datepicker,
.artiq-booking .ui-datepicker.ui-widget {
    width: 100% !important;
    background: transparent;
    border: 0;
    padding: 0;
    font-family: inherit;
}

.artiq-booking .ui-datepicker .ui-datepicker-header {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 0 0 14px !important;
    position: relative;
}

.artiq-booking .ui-datepicker .ui-datepicker-title {
    color: var(--bk-fg) !important;
    font-size: 19px;
    font-weight: 700;
    line-height: 38px;
    text-align: center;
}

.artiq-booking .ui-datepicker .ui-datepicker-prev,
.artiq-booking .ui-datepicker .ui-datepicker-next {
    top: 0;
    width: 38px;
    height: 38px;
    background: var(--bk-surface) !important;
    border: 1px solid var(--bk-border) !important;
    border-radius: 10px !important;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease;
}

.artiq-booking .ui-datepicker .ui-datepicker-prev { left: 0; }
.artiq-booking .ui-datepicker .ui-datepicker-next { right: 0; }

.artiq-booking .ui-datepicker .ui-datepicker-prev:hover,
.artiq-booking .ui-datepicker .ui-datepicker-next:hover {
    background: var(--bk-hover);
}

.artiq-booking .ui-datepicker .ui-datepicker-prev span,
.artiq-booking .ui-datepicker .ui-datepicker-next span {
    background: none;
    text-indent: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    top: 0;
    left: 0;
    position: absolute;
    overflow: hidden;
    color: transparent;
}

.artiq-booking .ui-datepicker .ui-datepicker-prev::before,
.artiq-booking .ui-datepicker .ui-datepicker-next::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 9px;
    height: 9px;
    border-right: 2px solid var(--bk-fg);
    border-top: 2px solid var(--bk-fg);
    transform: translate(-30%, -50%) rotate(-135deg);
}

.artiq-booking .ui-datepicker .ui-datepicker-next::before {
    transform: translate(-70%, -50%) rotate(45deg);
}

.artiq-booking .ui-datepicker table {
    margin: 0;
    border-collapse: separate;
    border-spacing: 2px;
}

.artiq-booking .ui-datepicker th {
    color: var(--bk-muted);
    font-size: 14px;
    font-weight: 500;
    padding: 6px 0;
}

.artiq-booking .ui-datepicker td {
    padding: 0;
}

.artiq-booking .ui-datepicker td a,
.artiq-booking .ui-datepicker td span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 42px;
    background: transparent !important;
    border: 0 !important;
    border-radius: 10px !important;
    font-size: 15px;
    text-align: center;
    transition: background-color .12s ease;
}

.artiq-booking .ui-datepicker td a {
    color: var(--bk-fg) !important;
    font-weight: 600;
}

.artiq-booking .ui-datepicker td a:hover {
    background: var(--bk-hover) !important;
}

.artiq-booking .ui-datepicker td.ui-datepicker-unselectable span,
.artiq-booking .ui-datepicker td.ui-state-disabled span {
    color: #c3cad4 !important;
    font-weight: 400;
}

.artiq-booking .ui-datepicker td.ui-datepicker-today a {
    background: var(--bk-hover) !important;
}

.artiq-booking .ui-datepicker td.ui-datepicker-current-day a,
.artiq-booking .ui-datepicker td a.ui-state-active {
    background: var(--bk-fg) !important;
    color: #ffffff !important;
}

/* ── Schritt 2: Datum-Überschrift ── */
.artiq-booking .artiq-bk-date-heading {
    text-align: center;
    color: var(--bk-fg);
    font-size: 19px;
    font-weight: 700;
    margin: 2px 0 18px;
}

/* ── Dauer ── */
.artiq-booking .af2_terminbuchung_dur_wrap {
    margin: 0 0 20px !important;
    text-align: center;
}

.artiq-booking .af2_terminbuchung_dur_wrap .af2_terminbuchung_heading {
    color: var(--bk-fg);
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 12px !important;
    text-align: center;
}

.artiq-booking .af2_terminbuchung_durations {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.artiq-booking .af2_terminbuchung_duration {
    background: var(--bk-surface) !important;
    border: 1px solid var(--bk-border) !important;
    border-radius: 10px !important;
    color: var(--bk-fg) !important;
    font-size: 15px;
    font-weight: 600;
    padding: 12px 26px;
    cursor: pointer;
    transition: all .15s ease;
    margin: 0 !important;
    width: auto !important;
}

.artiq-booking .af2_terminbuchung_duration.af2_duration_selected {
    background: var(--bk-fg) !important;
    border-color: var(--bk-fg) !important;
    color: #ffffff !important;
}

/* ── Zeit-Slots: Grid in die Breite ── */
.artiq-booking .af2_terminbuchungs_ti_wrap > .af2_terminbuchung_heading {
    display: none !important; /* Tabs sagen es bereits */
}

.artiq-booking .af2_terminbuchung_times {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    max-width: 660px;
    margin: 0 auto;
    /* Hoehen-Klammer des Original-JS aufheben (Inline-Styles) */
    max-height: none !important;
    min-height: 0 !important;
    height: auto !important;
    overflow: visible !important;
    padding: 2px;
}

.artiq-booking .af2_terminbuchung_time {
    background: var(--bk-surface) !important;
    border: 1px solid var(--bk-border) !important;
    border-radius: 12px !important;
    color: var(--bk-fg) !important;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    padding: 15px 8px;
    cursor: pointer;
    transition: border-color .12s ease, box-shadow .12s ease, background-color .12s ease;
    margin: 0 !important;
    width: auto !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.artiq-booking .af2_terminbuchung_time:hover {
    border-color: var(--bk-muted-2) !important;
    background: var(--bk-surface) !important;
}

.artiq-booking .af2_terminbuchung_time.af2_time_selected {
    border: 1.5px solid var(--bk-fg) !important;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, .35);
    background: var(--bk-surface) !important;
    color: var(--bk-fg) !important;
}

/* ── Zurück-Button ── */
.artiq-booking .artiq-bk-back {
    display: block;
    margin: 26px auto 0;
    background: var(--bk-surface);
    border: 1px solid var(--bk-border);
    border-radius: 12px;
    color: var(--bk-fg);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    padding: 13px 30px;
    cursor: pointer;
    transition: background-color .15s ease;
}

.artiq-booking .artiq-bk-back:hover {
    background: var(--bk-hover);
}

/* ── Footer-Leiste ── */
.artiq-booking .artiq-bk-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-top: 1px solid var(--bk-border-soft);
    background: #fafbfc;
    color: var(--bk-muted-2);
    font-size: 14px;
    padding: 14px 4px;
    margin: 28px -28px 0;
    padding-left: 28px;
    padding-right: 28px;
    border-radius: 0 0 16px 16px;
}

.artiq-booking .artiq-bk-footer-duration {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.artiq-booking .artiq-bk-footer-duration svg {
    width: 15px;
    height: 15px;
    stroke: var(--bk-muted-2);
}

/* ── Ladeindikator im Grid zentrieren ── */
.artiq-booking .af2_terminbuchung_times .af2_loader {
    grid-column: 1 / -1;
    justify-self: center;
}

/* ── Mobile ── */
@media only screen and (max-width: 700px) {
    .af2_terminbuchungs_wrapper.artiq-booking {
        padding: 18px 16px 0;
        border-radius: 14px;
    }

    .artiq-booking .artiq-bk-steps {
        gap: 10px;
    }

    .artiq-booking .artiq-bk-step {
        font-size: 14px;
    }

    .artiq-booking .af2_terminbuchung_datewrapper {
        padding: 12px 10px;
        margin-bottom: 18px;
    }

    .artiq-booking .ui-datepicker td a,
    .artiq-booking .ui-datepicker td span {
        height: 40px;
        font-size: 14px;
    }

    .artiq-booking .af2_terminbuchung_times {
        gap: 9px;
    }

    .artiq-booking .af2_terminbuchung_time {
        font-size: 15px;
        padding: 13px 4px;
        border-radius: 10px;
    }

    .artiq-booking .artiq-bk-footer {
        margin: 22px -16px 0;
        padding-left: 16px;
        padding-right: 16px;
        font-size: 13px;
    }
}

/* ── Overrides gegen injizierte Formularfarben + Original-Kreise ── */
.artiq-booking .ui-datepicker-title,
.artiq-booking .af2_terminbuchung_datewrapper .ui-datepicker-title {
    background: transparent !important;
    background-color: transparent !important;
    color: var(--bk-fg) !important;
    font-family: inherit !important;
    font-size: 19px !important;
}

.artiq-booking .af2_terminbuchung_datewrapper td {
    min-width: 0 !important;
    width: auto !important;
    height: auto !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
}

.artiq-booking .af2_terminbuchung_datewrapper td .ui-state-default {
    width: 100% !important;
    height: 42px !important;
    border-radius: 10px !important;
    background: transparent !important;
    background-color: transparent !important;
    padding: 0 !important;
    font-size: 15px;
}

.artiq-booking .af2_terminbuchung_datewrapper td a.ui-state-default:hover {
    background: var(--bk-hover) !important;
    background-color: var(--bk-hover) !important;
}

.artiq-booking .af2_terminbuchung_datewrapper td.ui-datepicker-current-day {
    background: transparent !important;
    background-color: transparent !important;
}

.artiq-booking .af2_terminbuchung_datewrapper td.ui-datepicker-current-day .ui-state-default {
    background: var(--bk-fg) !important;
    background-color: var(--bk-fg) !important;
    color: #ffffff !important;
}

@media only screen and (max-width: 700px) {
    .artiq-booking .af2_terminbuchung_datewrapper td .ui-state-default {
        height: 40px !important;
    }
}

/* ── Kalender-Raster: volle Breite, Chips zentriert ── */
.artiq-booking .ui-datepicker table,
.artiq-booking .af2_terminbuchung_datewrapper table {
    width: 100% !important;
    table-layout: fixed;
}

.artiq-booking .af2_terminbuchung_datewrapper td .ui-state-default {
    width: 42px !important;
    margin: 0 auto !important;
}

@media only screen and (max-width: 700px) {
    .artiq-booking .af2_terminbuchung_datewrapper td .ui-state-default {
        width: 38px !important;
    }
}
