/* ClinicBook Pro — Public Booking Form */
.cb-booking-wrapper { max-width: 740px; margin: 0 auto; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }

/* Step indicator */
.cb-steps { display: flex; align-items: center; margin-bottom: 32px; }
.cb-step { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: #9ca3af; white-space: nowrap; }
.cb-step span { width: 28px; height: 28px; border-radius: 50%; background: #e5e7eb; color: #9ca3af; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.cb-step.active, .cb-step.done { color: #0e7490; }
.cb-step.active span { background: #0e7490; color: #fff; }
.cb-step.done span { background: #16a34a; color: #fff; }
.cb-step-divider { flex: 1; height: 2px; background: #e5e7eb; margin: 0 8px; min-width: 16px; }

/* Step */
.cb-step-title { font-size: 20px; font-weight: 700; color: #111827; margin: 0 0 6px; }
.cb-step-sub { color: #6b7280; font-size: 14px; margin: 0 0 24px; }

/* Branch cards */
.cb-branch-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 24px; }
.cb-branch-card { display: flex; align-items: flex-start; gap: 12px; border: 2px solid #e5e7eb; border-radius: 10px; padding: 16px; cursor: pointer; transition: all .2s; position: relative; }
.cb-branch-card input[type=radio] { position: absolute; opacity: 0; }
.cb-branch-card:hover { border-color: #0e7490; background: #f0fdff; }
.cb-branch-card:has(input:checked) { border-color: #0e7490; background: #e0f7fa; }
.cb-branch-info { flex: 1; }
.cb-branch-info strong { display: block; font-size: 15px; color: #111827; margin-bottom: 4px; }
.cb-branch-info span { display: block; font-size: 12px; color: #6b7280; margin-top: 2px; }
.cb-branch-info .cb-hours { color: #0e7490; font-weight: 600; }
.cb-branch-check { width: 22px; height: 22px; border-radius: 50%; background: #e5e7eb; color: transparent; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.cb-branch-card:has(input:checked) .cb-branch-check { background: #0e7490; color: #fff; }

/* Fields */
.cb-fields-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.cb-field { display: flex; flex-direction: column; gap: 6px; }
.cb-field-full { grid-column: 1 / -1; }
.cb-field label { font-size: 13px; font-weight: 600; color: #374151; }
.cb-field input, .cb-field select, .cb-field textarea { padding: 10px 12px; border: 1.5px solid #d1d5db; border-radius: 8px; font-size: 14px; color: #111827; transition: border-color .15s; background: #fff; width: 100%; box-sizing: border-box; }
.cb-field input:focus, .cb-field select:focus, .cb-field textarea:focus { outline: none; border-color: #0e7490; box-shadow: 0 0 0 3px rgba(14,116,144,.1); }
.cb-field small { font-size: 11px; color: #9ca3af; }
.cb-required { color: #dc2626; }
.cb-field input.cb-invalid, .cb-field select.cb-invalid { border-color: #dc2626; }

/* Slots */
.cb-date-time-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.cb-slots-hint { color: #9ca3af; font-size: 13px; padding: 12px 0; }
.cb-slots-loading { color: #0e7490; font-size: 13px; padding: 12px 0; }
.cb-slots-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cb-slot-btn { padding: 10px 6px; border: 1.5px solid #d1d5db; border-radius: 8px; background: #fff; font-size: 13px; cursor: pointer; text-align: center; transition: all .15s; color: #111827; }
.cb-slot-btn:hover { border-color: #0e7490; background: #f0fdff; color: #0e7490; }
.cb-slot-btn.selected { background: #0e7490; border-color: #0e7490; color: #fff; font-weight: 600; }
.cb-no-slots { color: #dc2626; font-size: 13px; padding: 12px 0; }

/* Summary */
.cb-summary { background: #f0fdff; border: 1.5px solid #a5f3fc; border-radius: 10px; padding: 20px; margin-bottom: 20px; font-size: 14px; }
.cb-summary-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid #cffafe; }
.cb-summary-row:last-child { border-bottom: none; }
.cb-summary-row strong { color: #0e7490; }

/* Consent */
.cb-consent { margin-bottom: 20px; font-size: 13px; color: #6b7280; }
.cb-consent label { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }

/* Navigation */
.cb-step-nav { display: flex; gap: 12px; justify-content: flex-end; margin-top: 8px; }
.cb-btn-next, .cb-btn-submit { background: #0e7490; color: #fff; border: none; padding: 12px 28px; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; transition: background .15s; }
.cb-btn-next:hover, .cb-btn-submit:hover { background: #0a5c73; }
.cb-btn-back { background: #fff; color: #374151; border: 1.5px solid #d1d5db; padding: 12px 20px; border-radius: 8px; font-size: 14px; cursor: pointer; }
.cb-btn-back:hover { background: #f9fafb; }

/* Error */
.cb-error-msg { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; padding: 12px 16px; border-radius: 8px; margin-top: 12px; font-size: 14px; }

/* Success */
.cb-success { text-align: center; padding: 40px 20px; }
.cb-success-icon { width: 64px; height: 64px; background: #16a34a; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 28px; color: #fff; margin: 0 auto 20px; }
.cb-success h2 { font-size: 24px; color: #111827; margin-bottom: 12px; }
.cb-success p { color: #6b7280; font-size: 15px; margin-bottom: 8px; }
.cb-success-ref { font-size: 16px; }
.cb-success-ref strong { color: #0e7490; font-family: monospace; font-size: 18px; }
.cb-success-email { font-size: 13px; color: #9ca3af; }
.cb-btn-new { background: #0e7490; color: #fff; border: none; padding: 12px 24px; border-radius: 8px; font-size: 14px; cursor: pointer; margin-top: 16px; }

@media (max-width: 600px) {
    .cb-fields-grid { grid-template-columns: 1fr; }
    .cb-date-time-grid { grid-template-columns: 1fr; }
    .cb-branch-grid { grid-template-columns: 1fr; }
    .cb-steps { font-size: 11px; }
    .cb-step span { width: 22px; height: 22px; font-size: 10px; }
    .cb-slots-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Inline Calendar ── */
.cb-inline-cal { user-select: none; }

.cb-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.cb-cal-header span {
    font-weight: 700;
    font-size: 15px;
    color: #111827;
}
.cb-cal-nav {
    background: none;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    width: 30px; height: 30px;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
    display: flex; align-items: center; justify-content: center;
    transition: background .12s;
}
.cb-cal-nav:hover { background: #f3f4f6; }

.cb-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}
.cb-cal-dow {
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: #9ca3af;
    padding: 4px 0;
    text-transform: uppercase;
}
.cb-cal-day {
    text-align: center;
    padding: 7px 4px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background .12s, color .12s;
    color: #111827;
    border: 1.5px solid transparent;
}
.cb-cal-day:hover:not(.cb-cal-disabled):not(.cb-cal-empty) {
    background: #e0f7fa;
    border-color: #0e7490;
}
.cb-cal-day.cb-cal-today {
    background: #f0fdfa;
    border-color: #99f6e4;
    color: #0e7490;
    font-weight: 700;
}
.cb-cal-day.cb-cal-selected {
    background: #0e7490;
    color: #fff;
    border-color: #0e7490;
    font-weight: 700;
}
.cb-cal-day.cb-cal-disabled {
    color: #d1d5db;
    cursor: not-allowed;
}
.cb-cal-day.cb-cal-empty { cursor: default; }

.cb-cal-selected-display {
    margin-top: 10px;
    font-size: 13px;
    color: #0e7490;
    font-weight: 600;
    min-height: 20px;
}

@media (max-width: 600px) {
    .cb-cal-day { padding: 8px 2px; font-size: 14px; }
}

/* ── Inline Calendar ── */
.cb-cal-slots-wrap {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
}
.cb-inline-cal {
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 14px;
    padding: 16px;
    min-width: 280px;
    flex-shrink: 0;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.cb-cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.cb-cal-nav button {
    background: #f3f4f6;
    border: none;
    border-radius: 8px;
    width: 32px; height: 32px;
    cursor: pointer;
    font-size: 16px;
    color: #374151;
    transition: background .15s;
}
.cb-cal-nav button:hover { background: #0e7490; color: #fff; }
.cb-cal-nav button:disabled { opacity: .3; cursor: default; }
#cb-cal-title {
    font-weight: 700;
    font-size: 15px;
    color: #111;
}
.cb-cal-dow {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    margin-bottom: 6px;
}
.cb-cal-dow span {
    font-size: 11px;
    font-weight: 700;
    color: #9ca3af;
    padding: 4px 0;
}
.cb-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}
.cb-cal-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    background: none;
    color: #374151;
    transition: background .1s, color .1s;
    font-family: inherit;
}
.cb-cal-day:hover:not(:disabled)  { background: #e0f2fe; color: #0e7490; }
.cb-cal-day.today  { border: 2px solid #0e7490; color: #0e7490; font-weight: 700; }
.cb-cal-day.selected { background: #0e7490; color: #fff; font-weight: 700; }
.cb-cal-day:disabled { color: #d1d5db; cursor: default; }
.cb-cal-day.other-month { color: #d1d5db; }

/* Slots panel */
.cb-slots-panel { flex: 1; min-width: 220px; }
.cb-slots-label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

@media (max-width: 600px) {
    .cb-cal-slots-wrap { flex-direction: column; }
    .cb-inline-cal { min-width: unset; width: 100%; }
    .cb-slots-panel { width: 100%; }
}
