/* ================================================================
   BOOKING APPOINTMENT PLUGIN — PUBLIC CSS  v2.0
   Self-contained, theme-agnostic front-end with inline calendar
   ================================================================ */

:root {
    --bap-primary: #0073aa;
}

.bap-pub {
    max-width: 580px;
    margin: 32px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1e1e1e;
}
.bap-pub * { box-sizing: border-box; }

/* ─── step pills ─────────────────────────────────────────────────── */
.bap-pub-steps {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}
.bap-pub-step {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: #e8e8e8;
    color: #666;
    white-space: nowrap;
    transition: background .2s, color .2s;
}
.bap-pub-step--active  { background: var(--bap-primary); color: #fff; }
.bap-pub-step--done    { background: #008a00; color: #fff; }

/* ─── panel ──────────────────────────────────────────────────────── */
.bap-pub-panel {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 28px 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.bap-pub-panel-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e1e1e;
    margin-bottom: 18px;
}

/* ─── INLINE CALENDAR ────────────────────────────────────────────── */
.bap-calendar {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    user-select: none;
}
.bap-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}
.bap-cal-header button {
    background: var(--bap-primary);
    color: #fff;
    border: 1px solid var(--bap-primary);
    border-radius: 6px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 16px;
    transition: all .15s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.bap-cal-header button:hover { background: var(--bap-primary); opacity: .85; border-color: var(--bap-primary); }
.bap-cal-header button:disabled { opacity: .4; cursor: not-allowed; }
.bap-cal-month {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}
.bap-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}
.bap-cal-weekday {
    padding: 10px 4px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #6b7280;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}
.bap-cal-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    position: relative;
    transition: all .15s;
    border: 1px solid transparent;
    margin: 2px;
    border-radius: 8px;
}
.bap-cal-day:hover { background: #f3f4f6; }
.bap-cal-day.other-month { color: #d1d5db; cursor: default; }
.bap-cal-day.other-month:hover { background: transparent; }
.bap-cal-day.disabled { color: #d1d5db; cursor: not-allowed; text-decoration: line-through; }
.bap-cal-day.disabled:hover { background: transparent; }
.bap-cal-day.today {
    font-weight: 700;
    color: var(--bap-primary);
}
.bap-cal-day.selected {
    background: var(--bap-primary);
    color: #fff;
    font-weight: 600;
}
.bap-cal-day.selected:hover {
    background: var(--bap-primary);
    opacity: .9;
}

/* ─── date label ─────────────────────────────────────────────────── */
.bap-pub-date-label { font-size: 13px; color: #888; margin-bottom: 14px; }

/* ─── loading ────────────────────────────────────────────────────── */
.bap-pub-loading { font-size: 14px; color: #888; padding: 16px 0; }

/* ─── slots grid ─────────────────────────────────────────────────── */
.bap-pub-slots {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 40px;
}
.bap-pub-slot {
    padding: 10px 15px;
    background: #f4f6f7;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    font-family: inherit;
    transition: all .15s;
}
.bap-pub-slot:hover    { border-color: var(--bap-primary); color: var(--bap-primary); background: rgba(0, 115, 170, .08); }
.bap-pub-slot--active  { background: var(--bap-primary); border-color: var(--bap-primary); color: #fff; }

.bap-pub-slots-empty { color: #c0392b; font-size: 14px; margin-top: 6px; }

/* ─── form fields ────────────────────────────────────────────────── */
.bap-pub-field { margin-bottom: 16px; }
.bap-pub-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 5px;
}
.bap-pub-req { color: #c0392b; margin-left: 2px; }
.bap-pub-field input,
.bap-pub-field select,
.bap-pub-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: #333;
    background: #fff;
    outline: none;
    transition: border-color .15s;
}
.bap-pub-field input:focus,
.bap-pub-field select:focus,
.bap-pub-field textarea:focus { border-color: var(--bap-primary); }
.bap-pub-field textarea { resize: vertical; }

/* ─── summary table ──────────────────────────────────────────────── */
.bap-pub-summary {
    background: #f9fbfc;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 18px 20px;
    margin-bottom: 20px;
}
.bap-pub-summary table { width: 100%; border-collapse: collapse; font-size: 14px; }
.bap-pub-summary td { padding: 6px 0; }
.bap-pub-summary-lbl { font-weight: 600; color: #555; width: 80px; }

/* ─── nav buttons ────────────────────────────────────────────────── */
.bap-pub-nav {
    display: flex;
    gap: 10px;
    margin-top: 22px;
}
.bap-pub-btn {
    padding: 10px 22px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s, box-shadow .15s;
    white-space: nowrap;
}
.bap-pub-btn--back   { background: #e8e8e8; color: #333; }
.bap-pub-btn--back:hover { background: #d4d4d4; }
.bap-pub-btn--next   { background: var(--bap-primary); color: #fff; }
.bap-pub-btn--next:hover { background: var(--bap-primary); opacity: .9; box-shadow: 0 2px 5px rgba(0,0,0,.15); }
.bap-pub-btn--submit { background: #008a00; color: #fff; flex: 1; }
.bap-pub-btn--submit:hover { background: #006e00; box-shadow: 0 2px 5px rgba(0,0,0,.15); }
.bap-pub-btn--submit:disabled { background: #aaa; cursor: not-allowed; box-shadow: none; }

/* ─── error message ──────────────────────────────────────────────── */
.bap-pub-msg { font-size: 14px; color: #c0392b; margin-bottom: 12px; }

/* ─── success screen ─────────────────────────────────────────────── */
.bap-pub-success {
    text-align: center;
    padding: 44px 24px;
    background: #eafaf1;
    border: 1px solid #c3e6cb;
    border-radius: 10px;
}
.bap-pub-success-ico { font-size: 52px; margin-bottom: 12px; }
.bap-pub-success h2  { color: #155724; font-size: 22px; margin-bottom: 8px; }
.bap-pub-success > p { color: #155724; font-size: 15px; margin-bottom: 16px; }
.bap-pub-success-detail { color: #555; font-size: 13px; margin-bottom: 20px !important; }

/* ─── warning (no services) ──────────────────────────────────────── */
.bap-pub-warn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    max-width: 560px;
    margin: 24px auto;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.bap-pub-warn-ico { font-size: 20px; flex-shrink: 0; }
