/* ================================================
   Holispace Booking — Style formularza rezerwacji
   ================================================ */

/* Zmienne kolorów */
:root {
    --hb-primary:       #2563eb;
    --hb-primary-hover: #1d4ed8;
    --hb-success:       #16a34a;
    --hb-error:         #dc2626;
    --hb-warning:       #d97706;
    --hb-bg:            #ffffff;
    --hb-bg-alt:        #f8fafc;
    --hb-border:        #e2e8f0;
    --hb-text:          #1e293b;
    --hb-text-muted:    #64748b;
    --hb-radius:        10px;
    --hb-shadow:        0 1px 3px rgba(0,0,0,.08);
}

/* Kontener główny */
.hb-booking {
    max-width: 800px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--hb-text);
    line-height: 1.6;
}

/* Sekcje */
.hb-section {
    background: var(--hb-bg);
    border: 1px solid var(--hb-border);
    border-radius: var(--hb-radius);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--hb-shadow);
    transition: opacity .25s ease;
}

.hb-section--hidden {
    display: none;
}

.hb-section--disabled {
    opacity: .45;
    pointer-events: none;
}

/* Tytuł sekcji */
.hb-section__title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 20px;
    font-size: 18px;
    font-weight: 600;
    color: var(--hb-text);
}

.hb-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--hb-primary);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

/* ------------------------------------------------
   Lista specjalistów
   ------------------------------------------------ */
.hb-specialists {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.hb-specialist-card {
    border: 2px solid var(--hb-border);
    border-radius: var(--hb-radius);
    padding: 16px;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s, transform .1s;
    text-align: center;
    background: var(--hb-bg);
}

.hb-specialist-card:hover {
    border-color: var(--hb-primary);
    box-shadow: 0 4px 12px rgba(37,99,235,.15);
    transform: translateY(-2px);
}

.hb-specialist-card.hb-selected {
    border-color: var(--hb-primary);
    background: #eff6ff;
    box-shadow: 0 4px 12px rgba(37,99,235,.2);
}

.hb-specialist-card__avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
}

.hb-specialist-card__name {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
}

.hb-specialist-card__specialty {
    font-size: 13px;
    color: var(--hb-text-muted);
}

/* ------------------------------------------------
   Kalendarz
   ------------------------------------------------ */
.hb-calendar {
    user-select: none;
    max-width: 320px;
}

.hb-calendar__nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.hb-calendar__nav button {
    background: none;
    border: 1px solid var(--hb-border);
    border-radius: 6px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
    color: var(--hb-text);
    line-height: 1;
    padding: 0;
    font-weight: 700;
}

.hb-calendar__nav button:hover {
    background: var(--hb-bg-alt);
}

.hb-calendar__nav button:disabled {
    opacity: .35;
    cursor: not-allowed;
}

.hb-calendar__month {
    font-weight: 600;
    font-size: 14px;
    text-transform: capitalize;
}

.hb-calendar__grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.hb-calendar__day-name {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--hb-text-muted);
    padding: 4px 0;
    text-transform: uppercase;
}

.hb-calendar__day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: background .15s, border-color .15s, color .15s;
}

.hb-calendar__day:hover:not(.hb-calendar__day--disabled):not(.hb-calendar__day--empty) {
    background: #eff6ff;
    border-color: var(--hb-primary);
    color: var(--hb-primary);
}

.hb-calendar__day--selected {
    background: var(--hb-primary) !important;
    color: #fff !important;
    border-color: var(--hb-primary) !important;
    font-weight: 700;
}

.hb-calendar__day--today {
    font-weight: 700;
    color: var(--hb-primary);
}

.hb-calendar__day--disabled {
    color: #cbd5e1;
    cursor: not-allowed;
    background: none;
}

.hb-calendar__day--no-schedule {
    color: #cbd5e1;
    cursor: not-allowed;
    background: #fafafa;
    text-decoration: line-through;
}

.hb-calendar__day--no-schedule:hover {
    background: #fafafa;
    color: #cbd5e1;
}
.hb-calendar__day--empty {
    cursor: default;
}
/* Dni bez harmonogramu specjalisty — wyszarzone ale inaczej niż przeszłe */
.hb-calendar__day--no-schedule {
    color: #cbd5e1;
    cursor: not-allowed;
    background: #fafafa;
    text-decoration: line-through;
}

.hb-calendar__day--no-schedule:hover {
    background: #fafafa;
    color: #cbd5e1;
}
/* ------------------------------------------------
   Sloty czasowe
   ------------------------------------------------ */
.hb-selected-date {
    color: var(--hb-text-muted);
    font-size: 14px;
    margin-bottom: 16px;
}

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

.hb-slot {
    border: 2px solid var(--hb-border);
    border-radius: 8px;
    padding: 10px 6px;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    background: var(--hb-bg);
}

.hb-slot:hover {
    border-color: var(--hb-primary);
    background: #eff6ff;
    color: var(--hb-primary);
}

.hb-slot.hb-selected {
    background: var(--hb-primary);
    border-color: var(--hb-primary);
    color: #fff;
    font-weight: 700;
}

.hb-slot__time {
    font-size: 16px;
    font-weight: 600;
    display: block;
}

.hb-slot__room {
    font-size: 11px;
    color: inherit;
    opacity: .75;
    display: block;
    margin-top: 2px;
}

.hb-slots--empty {
    color: var(--hb-text-muted);
    font-size: 14px;
    padding: 20px 0;
    grid-column: 1 / -1;
    text-align: center;
}

/* ------------------------------------------------
   Formularz danych pacjenta
   ------------------------------------------------ */
.hb-form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.hb-form__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hb-form__field--full {
    grid-column: 1 / -1;
}

.hb-form__field label {
    font-size: 14px;
    font-weight: 500;
    color: var(--hb-text);
}

.hb-required {
    color: var(--hb-error);
}

.hb-form__field input,
.hb-form__field textarea {
    border: 1px solid var(--hb-border);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 15px;
    font-family: inherit;
    color: var(--hb-text);
    background: var(--hb-bg);
    transition: border-color .2s, box-shadow .2s;
    width: 100%;
    box-sizing: border-box;
}

.hb-form__field input:focus,
.hb-form__field textarea:focus {
    outline: none;
    border-color: var(--hb-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.hb-form__field input.hb-invalid {
    border-color: var(--hb-error);
}

/* ------------------------------------------------
   Podsumowanie
   ------------------------------------------------ */
.hb-summary {
    background: var(--hb-bg-alt);
    border: 1px solid var(--hb-border);
    border-radius: var(--hb-radius);
    padding: 20px;
    margin-bottom: 20px;
}

.hb-summary__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--hb-border);
    font-size: 15px;
}

.hb-summary__row:last-child {
    border-bottom: none;
}

.hb-summary__label {
    color: var(--hb-text-muted);
    font-size: 13px;
}

.hb-summary__value {
    font-weight: 600;
}

/* ------------------------------------------------
   Przyciski
   ------------------------------------------------ */
.hb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background .2s, transform .1s, box-shadow .2s;
    font-family: inherit;
}

.hb-btn--primary {
    background: var(--hb-primary);
    color: #fff;
}

.hb-btn--primary:hover {
    background: var(--hb-primary-hover);
    box-shadow: 0 4px 12px rgba(37,99,235,.3);
}

.hb-btn--primary:active {
    transform: scale(.98);
}

.hb-btn--primary:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none;
}

.hb-btn--secondary {
    background: var(--hb-bg-alt);
    color: var(--hb-text);
    border: 1px solid var(--hb-border);
}

.hb-btn--secondary:hover {
    background: var(--hb-border);
}

.hb-btn--large {
    padding: 14px 32px;
    font-size: 16px;
    width: 100%;
}

/* ------------------------------------------------
   Komunikaty błędów i sukcesu
   ------------------------------------------------ */
.hb-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--hb-error);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    margin-bottom: 16px;
}

.hb-loading {
    color: var(--hb-text-muted);
    font-size: 14px;
    padding: 20px 0;
    text-align: center;
}

/* ------------------------------------------------
   Potwierdzenie rezerwacji
   ------------------------------------------------ */
.hb-confirm {
    text-align: center;
    padding: 40px 20px;
}

.hb-confirm__icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--hb-success);
    color: #fff;
    font-size: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.hb-confirm h3 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--hb-success);
}

.hb-confirm p {
    color: var(--hb-text-muted);
    margin-bottom: 24px;
}

/* ------------------------------------------------
   Wybór trybu (mode=both)
   ------------------------------------------------ */
.hb-mode-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.hb-mode-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px 16px;
    border: 2px solid var(--hb-border);
    border-radius: var(--hb-radius);
    background: var(--hb-bg);
    cursor: pointer;
    transition: all .2s;
    text-align: center;
    font-family: inherit;
}

.hb-mode-btn:hover {
    border-color: var(--hb-primary);
    background: #eff6ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37,99,235,.15);
}

.hb-mode-btn__icon {
    font-size: 32px;
}

.hb-mode-btn__label {
    font-size: 16px;
    font-weight: 600;
    color: var(--hb-text);
}

.hb-mode-btn__desc {
    font-size: 13px;
    color: var(--hb-text-muted);
}

/* ------------------------------------------------
   Karty usług
   ------------------------------------------------ */
.hb-services {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.hb-service-card {
    border: 2px solid var(--hb-border);
    border-radius: var(--hb-radius);
    padding: 16px;
    cursor: pointer;
    transition: all .2s;
    background: var(--hb-bg);
    position: relative;
}

.hb-service-card:hover {
    border-color: var(--hb-primary);
    box-shadow: 0 4px 12px rgba(37,99,235,.15);
    transform: translateY(-2px);
}

.hb-service-card.hb-selected {
    border-color: var(--hb-primary);
    background: #eff6ff;
}

.hb-service-card__color {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    margin-bottom: 12px;
}

.hb-service-card__name {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 6px;
    color: var(--hb-text);
}

.hb-service-card__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--hb-text-muted);
}

.hb-service-card__price {
    font-weight: 600;
    color: var(--hb-primary);
}

.hb-service-card__desc {
    font-size: 13px;
    color: var(--hb-text-muted);
    margin-top: 8px;
    line-height: 1.5;
}

/* ------------------------------------------------
   Responsive
   ------------------------------------------------ */
@media (max-width: 600px) {
    .hb-section {
        padding: 16px;
    }

    .hb-form__row {
        grid-template-columns: 1fr;
    }

    .hb-specialists {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .hb-slots {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }

    .hb-mode-buttons {
        grid-template-columns: 1fr;
    }

    .hb-services {
        grid-template-columns: 1fr;
    }

    .hb-calendar {
        max-width: 100%;
    }
}
/* ============================================================
   Kategorie usług
   ============================================================ */

.hb-categories {
    display: grid;
    grid-template-columns: repeat( auto-fill, minmax( 200px, 1fr ) );
    gap: 12px;
    margin-top: 12px;
}

.hb-category-card {
    padding: 20px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: all .15s;
    text-align: center;
}
.hb-category-card:hover {
    border-color: #2563eb;
    background: #eff6ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37,99,235,.1);
}
.hb-category-card.hb-selected {
    border-color: #2563eb;
    background: #2563eb;
    color: #fff;
}
.hb-category-card__name {
    font-weight: 600;
    font-size: 15px;
    color: inherit;
}
.hb-category-card__desc {
    font-size: 12px;
    color: #64748b;
    margin-top: 6px;
    line-height: 1.4;
}
.hb-category-card.hb-selected .hb-category-card__desc {
    color: rgba(255,255,255,.8);
}

/* Grupowanie usług po kategorii */
.hb-services-group {
    margin-bottom: 16px;
}
.hb-services-group__title {
    font-size: 13px;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 6px 0;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 10px;
}
