/* ── Public booking page (Calendly-style) ──────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Beide Theme-Achsen. Gesetzt werden sie von book.js (applyBrandColors) aus
   settings.themecolor und settings.secondary_color - auf dieser oeffentlichen
   Seite gibt es keine layout_header.php, die das sonst uebernimmt. Bis
   2026-09-19 setzte sie hier NIEMAND: die Fallbacks unten griffen immer, und
   jeder Kunde jedes Mandanten sah das Nexoro-Tuerkis. */
:root {
    --book-primary: var(--theme-color, #3aaac1);
    --book-primary-dark: var(--theme-dark, #2d8b9e);
    --book-primary-soft: var(--theme-soft, rgba(58,170,193,.1));
    --book-gradient: var(--theme-gradient, linear-gradient(135deg,#3aaac1,#2d8b9e));
    --book-secondary: var(--secondary-color, #CC9900);
}

html { height: 100%; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8fafc;
    color: #1e293b;
    font-size: 14px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Wrap & loading ──────────────────────────────────────────────────────────── */

.bk-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 32px 16px; }

.bk-loading {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--book-primary);
}

.bk-error {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 12px;
    padding: 40px;
}
.bk-error-icon { font-size: 48px; color: #cbd5e1; }
.bk-error-title { font-size: 20px; font-weight: 600; color: #334155; }
.bk-error-sub { color: #64748b; max-width: 300px; line-height: 1.6; }

/* ── Container: sidebar + main ───────────────────────────────────────────────── */

.bk-container {
    display: flex;
    width: 100%;
    max-width: 860px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 40px rgba(0,0,0,.08);
    overflow: hidden;
    min-height: 560px;
    align-items: stretch;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────────── */

.bk-sidebar {
    width: 260px;
    flex-shrink: 0;
    border-right: 1px solid #f1f5f9;
    padding: 32px 24px;
    background: #fafcff;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.bk-company-logo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-bottom: 8px;
    /* Sekundaerfarbe: traegt hier die Zugehoerigkeit (das ist die Marke X),
       waehrend die Primaerfarbe die Handlung traegt (Termin waehlen, buchen).
       Dieselbe Aufteilung wie im Kalender, siehe calendar.css. */
    border-bottom: 2px solid var(--book-secondary);
}
.bk-company-logo img {
    max-height: 48px;
    max-width: 160px;
    width: auto;
    object-fit: contain;
}

.bk-profile { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }

.bk-profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--book-primary-soft);
    color: var(--book-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    overflow: hidden;
    border: 3px solid var(--book-primary);
}
.bk-profile-avatar img { width: 100%; height: 100%; object-fit: cover; }

.bk-profile-name {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
}

.bk-profile-intro {
    font-size: 13px;
    color: #64748b;
    line-height: 1.6;
}

/* ── Selection summary ───────────────────────────────────────────────────────── */

.bk-selection-summary {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 8px;
    border-top: 1px solid #e2e8f0;
}

.bk-sel-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: #475569;
    line-height: 1.4;
}
.bk-sel-item i {
    color: var(--book-primary);
    font-size: 12px;
    margin-top: 2px;
    flex-shrink: 0;
    width: 14px;
    text-align: center;
}

/* ── Main area ───────────────────────────────────────────────────────────────── */

.bk-main {
    flex: 1;
    padding: 32px 28px;
    overflow-y: auto;
}

.bk-step { display: flex; flex-direction: column; gap: 20px; }

.bk-step-title {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
}

.bk-back-step {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--book-primary);
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    transition: opacity .15s;
    align-self: flex-start;
}
.bk-back-step:hover { opacity: .75; }

/* ── Type cards ──────────────────────────────────────────────────────────────── */

.bk-types-grid { display: flex; flex-direction: column; gap: 12px; }
.bk-no-types { color: #94a3b8; font-size: 14px; text-align: center; padding: 40px 0; }

.bk-type-card {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    text-align: left;
    transition: border-color .15s, box-shadow .15s, transform .1s;
    overflow: hidden;
    width: 100%;
}
.bk-type-card:hover {
    border-color: var(--book-primary);
    box-shadow: 0 2px 12px var(--book-primary-soft);
    transform: translateY(-1px);
}

.bk-type-card-bar { width: 5px; align-self: stretch; flex-shrink: 0; }

.bk-type-card-body { flex: 1; padding: 16px 14px; min-width: 0; }
.bk-type-card-name { font-size: 15px; font-weight: 600; color: #0f172a; }
.bk-type-card-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 5px;
    font-size: 12px;
    color: #64748b;
}
.bk-type-card-meta span { display: flex; align-items: center; gap: 4px; }
.bk-type-card-desc { font-size: 12px; color: #94a3b8; margin-top: 6px; line-height: 1.5; }

.bk-type-card-arrow { padding: 16px 14px; color: #94a3b8; font-size: 13px; flex-shrink: 0; }

/* ── Date picker calendar ─────────────────────────────────────────────────────── */

.bk-cal-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}
.bk-cal-month-label { font-size: 15px; font-weight: 600; color: #1e293b; flex: 1; text-align: center; }
.bk-cal-nav-btn {
    width: 32px; height: 32px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: border-color .15s, color .15s;
}
.bk-cal-nav-btn:hover:not(:disabled) { border-color: var(--book-primary); color: var(--book-primary); }
.bk-cal-nav-btn:disabled { opacity: .35; cursor: default; }

.bk-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.bk-cal-dow {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    padding: 4px 0 8px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.bk-cal-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 500;
    transition: background .12s, color .12s;
}
.bk-cal-cell-disabled { color: #cbd5e1; cursor: default; }
.bk-cal-cell-avail {
    color: #1e293b;
    cursor: pointer;
    background: var(--book-primary-soft);
    font-weight: 600;
}
.bk-cal-cell-avail:hover { background: var(--book-primary); color: #fff; }
.bk-cal-cell-selected { background: var(--book-primary) !important; color: #fff !important; }
.bk-cal-empty { /* spacer */ }

/* ── Time slots ──────────────────────────────────────────────────────────────── */

.bk-slots-loading {
    display: flex;
    justify-content: center;
    padding: 32px;
    color: var(--book-primary);
    font-size: 20px;
}
.bk-slots-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 40px 0;
    color: #94a3b8;
    font-size: 14px;
}

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

.bk-slot-btn {
    padding: 11px 8px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    transition: border-color .12s, background .12s, color .12s, transform .1s;
    text-align: center;
}
.bk-slot-btn:hover {
    border-color: var(--book-primary);
    color: var(--book-primary);
    transform: translateY(-1px);
}
.bk-slot-btn-selected {
    background: var(--book-primary) !important;
    border-color: var(--book-primary) !important;
    color: #fff !important;
}

/* ── Guest form ──────────────────────────────────────────────────────────────── */

.bk-form-grid { display: flex; flex-direction: column; gap: 14px; }
.bk-form-field { display: flex; flex-direction: column; gap: 5px; }
.bk-form-full { /* full width, already default */ }

.bk-form-label { font-size: 12px; font-weight: 500; color: #475569; }
.bk-form-opt { color: #94a3b8; font-weight: 400; }

.bk-form-input {
    padding: 10px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    color: #1e293b;
    background: #fff;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    width: 100%;
}
.bk-form-input:focus {
    border-color: var(--book-primary);
    box-shadow: 0 0 0 3px var(--book-primary-soft);
}
.bk-form-textarea { resize: vertical; min-height: 80px; }

.bk-form-error {
    padding: 10px 14px;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    color: #dc2626;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bk-submit-btn {
    padding: 13px 24px;
    background: var(--book-gradient);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity .15s, transform .1s;
    align-self: flex-start;
}
.bk-submit-btn:hover:not(:disabled) { opacity: .88; }
.bk-submit-btn:active:not(:disabled) { transform: scale(.98); }
.bk-submit-btn:disabled { opacity: .6; cursor: default; }

/* ── Confirmation ────────────────────────────────────────────────────────────── */

.bk-step-confirm {
    align-items: center;
    text-align: center;
    padding: 20px 0;
}

.bk-confirm-icon {
    font-size: 56px;
    color: #22c55e;
    animation: bk-pop .4s cubic-bezier(.34,1.56,.64,1);
}

@keyframes bk-pop {
    from { transform: scale(0.5); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

.bk-confirm-title { font-size: 22px; font-weight: 700; color: #0f172a; }
.bk-confirm-sub { color: #64748b; line-height: 1.6; max-width: 320px; }

.bk-confirm-details {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px 24px;
    text-align: left;
    width: 100%;
    max-width: 340px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}
.bk-confirm-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #334155;
}
.bk-confirm-row i { color: var(--book-primary); width: 14px; text-align: center; flex-shrink: 0; }
/* Die Zeile mit der Zeit des Gastgebers (2026-09-21). Leiser als die anderen:
   massgeblich ist fuer den Gast seine eigene Uhr, die daruebersteht. */
.bk-confirm-row.bk-confirm-tz { color: #94a3b8; font-size: 0.82rem; }
.bk-confirm-row.bk-confirm-tz i { color: #94a3b8; }

.bk-confirm-new {
    padding: 10px 20px;
    border: 1.5px solid var(--book-primary);
    border-radius: 10px;
    background: transparent;
    color: var(--book-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: background .15s, color .15s;
}
.bk-confirm-new:hover { background: var(--book-primary); color: #fff; }

/* ── Footer: Powered by Nexoro ──────────────────────────────────────────────── */

.bk-footer {
    text-align: center;
    padding: 20px;
    font-size: 12px;
    color: #94a3b8;
}
.bk-footer a {
    color: var(--book-primary);
    text-decoration: none;
    font-weight: 500;
}
.bk-footer a:hover { text-decoration: underline; }

/* ── Slots wrap ─────────────────────────────────────────────────────────────── */
.bk-slots-wrap { min-height: 120px; }

/* ── Mobile ───────────────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
    .bk-wrap { padding: 0; align-items: stretch; }

    .bk-container {
        flex-direction: column;
        border-radius: 0;
        box-shadow: none;
        min-height: auto;
        border: none;
    }

    .bk-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #f1f5f9;
        padding: 24px 20px;
    }

    .bk-profile { flex-direction: row; align-items: center; }
    .bk-profile-avatar { width: 52px; height: 52px; font-size: 20px; flex-shrink: 0; }
    .bk-profile-name { font-size: 16px; }
    .bk-profile-intro { display: none; }

    .bk-selection-summary { padding-top: 8px; }

    .bk-main { padding: 20px 16px 32px; }

    .bk-step-title { font-size: 16px; }

    .bk-slots-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .bk-slot-btn { padding: 10px 4px; font-size: 13px; }

    .bk-submit-btn { width: 100%; }

    .bk-cal-cell { font-size: 12px; }

    .bk-footer { padding: 16px; }
}

/* Zeitzonen-Hinweis unter den Zeiten (2026-09-18). Erscheint nur, wenn der Gast
   in einer anderen Zeitzone sitzt als der Gastgeber - sonst waere er Rauschen. */
.bk-slots-tz {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: #94a3b8;
}
.bk-slots-tz i { font-size: 11px; }
