/* rex-com.de/termin/ – Online-Terminbuchung fürs kostenlose Erstgespräch. Ergänzt style.css (bleibt unverändert). */
.tb {
    --tb-card: #FFFFFF; --tb-edge: #D5DCE6; --tb-pick: #2563EB;
    --tb-ok: #15803D; --tb-ok-bg: #DCFCE7; --tb-err: #B91C1C; --tb-err-bg: #FEF2F2; --tb-err-line: #FECACA; --tb-off: #64748B;
}
@media (prefers-color-scheme: dark) {
    .tb { --ink: #F1F5F9; --tb-card: #0F1829; --tb-edge: #334155; --tb-ok: #4ADE80; --tb-ok-bg: #0F2E1C; --tb-err: #FCA5A5; --tb-err-bg: #3B1111; --tb-err-line: #7F1D1D; --tb-off: #94A3B8; }
}
.tb :focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.tb-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.tb-h1 { font-size: clamp(2rem, 4.4vw, 3rem); margin-bottom: 14px; }
.tb-head { max-width: 760px; margin-bottom: 36px; }
.tb-narrow { max-width: 760px; }
.tb-nowrap { white-space: nowrap; }

/* ---------- Aufbau ---------- */
.tb-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: start; }
.tb-form { display: grid; gap: 30px; min-width: 0; }
.tb-step { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 14px; }
/* float macht die Legende zu einem normalen Rasterelement (sonst gilt der Abstand „gap“ nicht) */
.tb-legend { float: left; display: flex; align-items: center; gap: 10px; padding: 0; font-weight: 800; font-size: 1.12rem; color: var(--ink); }
.tb-num { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--grad); color: #fff; font-size: 0.95rem; flex-shrink: 0; }
.tb-hint { margin: 0; font-size: 0.9rem; }
.tb-field-hint { display: block; margin-top: 6px; font-size: 0.85rem; color: var(--muted); }
.tb-req { color: var(--ink); }
.tb-opt { font-weight: 500; color: var(--muted); font-size: 0.85rem; }
.tb-error { margin: 0; padding: 13px 16px; border-radius: 12px; background: var(--tb-err-bg); border: 1px solid var(--tb-err-line); color: var(--tb-err); font-weight: 700; }
.tb-error a { color: inherit; }
.tb .field input[aria-invalid="true"], .tb .field textarea[aria-invalid="true"] { border-color: var(--tb-err); }

/* Auswahlfelder: Radio-Knopf unsichtbar, die Fläche daneben zeigt den Zustand */
.tb-kind, .tb-day, .tb-slot { position: relative; display: block; margin: 0; cursor: pointer; }
.tb-kind input, .tb-day input, .tb-slot input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.tb-kind input:focus-visible + .tb-kind-box, .tb-day input:focus-visible + .tb-day-box, .tb-slot input:focus-visible + span { outline: 3px solid var(--brand); outline-offset: 2px; }

/* 1 · Gesprächsart */
.tb-kinds { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); gap: 12px; }
.tb-kind-box { display: flex; align-items: center; gap: 14px; min-height: 72px; padding: 12px 16px; border: 1.5px solid var(--tb-edge); border-radius: 14px; background: var(--tb-card); transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s; }
.tb-kind-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--soft); font-size: 1.4rem; flex-shrink: 0; }
.tb-kind strong { display: block; color: var(--ink); font-size: 1.05rem; }
.tb-kind small { display: block; color: var(--muted); font-size: 0.88rem; }
.tb-kind:hover .tb-kind-box { border-color: var(--brand); }
.tb-kind input:checked + .tb-kind-box { border-color: var(--tb-pick); box-shadow: inset 0 0 0 1px var(--tb-pick); background: color-mix(in srgb, var(--tb-pick) 8%, var(--tb-card)); }
.tb-kind input:checked + .tb-kind-box small { color: var(--text); } /* Kontrast auf der getönten Fläche */

/* 2 · Tag (Wochen als Zeilen, Mo–Fr) */
.tb-cal { display: grid; gap: 8px; }
.tb-cal-head, .tb-cal-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.tb-cal-head span { text-align: center; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.tb-day-box { display: grid; justify-items: center; align-content: center; min-height: 76px; padding: 8px 2px; border: 1.5px solid var(--tb-edge); border-radius: 12px; background: var(--tb-card); text-align: center; line-height: 1.2; transition: border-color 0.15s, background-color 0.15s; }
.tb-day-num { font-size: 1.3rem; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.tb-day-mon { font-size: 0.75rem; font-weight: 600; color: var(--muted); }
.tb-day-free { margin-top: 3px; font-size: 0.72rem; font-weight: 700; color: var(--tb-ok); white-space: nowrap; }
.tb-day:hover .tb-day-box { border-color: var(--brand); }
.tb-day input:checked + .tb-day-box { background: var(--tb-pick); border-color: var(--tb-pick); }
.tb-day input:checked + .tb-day-box > span { color: #fff; }
.tb-day.is-off { cursor: default; }
.tb-day.is-off .tb-day-box { background: transparent; border-style: dashed; }
.tb-day.is-off:hover .tb-day-box { border-color: var(--tb-edge); }
.tb-day.is-off .tb-day-num, .tb-day.is-off .tb-day-free { color: var(--tb-off); font-weight: 600; }
.tb-day.is-empty { visibility: hidden; }
.tb-nojs { margin: 0; }

/* 3 · Uhrzeit */
.tb-dayline { margin: 0; font-weight: 600; color: var(--text); }
.tb-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.tb-slot > span { display: flex; align-items: center; justify-content: center; min-height: 48px; border: 1.5px solid var(--tb-edge); border-radius: 12px; background: var(--tb-card); color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; transition: border-color 0.15s, background-color 0.15s; }
.tb-slot:hover > span { border-color: var(--brand); }
.tb-slot input:checked + span { background: var(--tb-pick); border-color: var(--tb-pick); color: #fff; }

/* 4 · Angaben */
.tb-step .form-grid { gap: 16px; }
.tb-check { display: flex; gap: 12px; align-items: flex-start; font-size: 0.95rem; color: var(--text); cursor: pointer; }
.tb-check input { width: 22px; height: 22px; margin-top: 3px; flex-shrink: 0; accent-color: var(--tb-pick); }
.tb-check a { font-weight: 700; }

/* Zusammenfassung + Absenden */
.tb-recap { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--soft); }
.tb-recap-ico { font-size: 1.5rem; flex-shrink: 0; }
.tb-recap strong { display: block; color: var(--ink); }
.tb-recap div > span { display: block; color: var(--muted); font-size: 0.92rem; }
.tb-submit { width: 100%; min-height: 56px; font-size: 1.1rem; }
.tb-submit:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.tb-form .form-note { margin-top: -18px; }

/* Seitenspalte */
.tb-aside { display: grid; gap: 18px; position: sticky; top: calc(var(--cmd-h) + 20px); }
.tb .card:hover { transform: none; box-shadow: var(--shadow); border-color: var(--line); }
.tb-card h2 { font-size: 1.15rem; margin: 0 0 6px; }
.tb-card p { font-size: 0.95rem; color: var(--text); }
.tb-card a { font-weight: 700; }

/* Seite „Ihr Termin“ */
.tb-state { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 8px; }
.tb-state-ico { flex-shrink: 0; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--tb-ok-bg); color: var(--tb-ok); font-size: 1.7rem; font-weight: 800; }
.tb-state.is-off .tb-state-ico { background: var(--soft); color: var(--muted); }
.tb-state .tb-h1 { margin-bottom: 6px; }
.tb-state p { color: var(--text); }
.tb-dl { display: grid; gap: 12px; margin: 18px 0; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--tb-card); }
.tb-dl div { display: grid; gap: 2px; }
.tb-dl dt { font-size: 0.82rem; font-weight: 700; color: var(--muted); }
.tb-dl dd { color: var(--ink); overflow-wrap: anywhere; }
.tb-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
.tb-actions .btn { min-height: 48px; }
.tb-small { font-size: 0.92rem; }
.tb-cancel .field textarea { min-height: 90px; }
.tb .btn.tb-danger { background: #B91C1C; border-color: #B91C1C; box-shadow: none; }
.tb .btn.tb-danger:hover { background: #991B1B; border-color: #991B1B; }

@media (min-width: 700px) {
    .tb-dl div { grid-template-columns: 120px minmax(0, 1fr); gap: 16px; }
}
@media (max-width: 960px) {
    .tb-layout { grid-template-columns: minmax(0, 1fr); }
    .tb-aside { position: static; }
}
@media (max-width: 480px) {
    .tb-form.form-card { padding: 20px 14px; }
    .tb-cal-head, .tb-cal-grid { gap: 5px; }
    .tb-day-box { min-height: 68px; }
    /* Auf schmalen Bildschirmen statt „3 frei“ nur ein Punkt (der volle Text steht für Screenreader in .tb-sr) */
    .tb-day-free { font-size: 0; margin-top: 5px; }
    .tb-day-free::before { content: ''; display: block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
    .tb-day.is-off .tb-day-free::before { background: transparent; }
    .tb-slots { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }
    .tb-actions .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    .tb *, .tb *::before { transition: none !important; }
}
