/* ============================================================
   Konsultacje Booking – Frontend Styles
   ============================================================ */

.kb-booking-wrap {
    max-width: 820px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #222;
}

/* ── Progress steps ── */
.kb-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 36px;
    flex-wrap: wrap;
    row-gap: 12px;
}
.kb-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 60px;
}
.kb-step-num {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #888;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background .25s, color .25s;
}
.kb-step.active .kb-step-num,
.kb-step.done .kb-step-num {
    background: #1a73e8;
    color: #fff;
}
.kb-step.done .kb-step-num { background: #2e7d32; }
.kb-step-label {
    font-size: 11px;
    color: #999;
    text-align: center;
    white-space: nowrap;
}
.kb-step.active .kb-step-label { color: #1a73e8; font-weight: 600; }
.kb-step.done .kb-step-label   { color: #2e7d32; }
.kb-step-line {
    flex: 1;
    height: 2px;
    background: #e0e0e0;
    min-width: 20px;
    max-width: 60px;
    margin-bottom: 20px;
}

/* ── Panels ── */
.kb-panel        { display: none; animation: kbFadeIn .25s ease; }
.kb-panel.active { display: block; }
@keyframes kbFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.kb-panel-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 20px;
}

/* ── Back button ── */
.kb-back-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #1a73e8;
    font-size: 14px;
    padding: 0;
    margin-bottom: 18px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.kb-back-btn:hover { text-decoration: underline; }

/* ── Consultant cards ── */
.kb-consultant-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
.kb-consultant-card {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px 16px;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s, transform .15s;
    text-align: center;
}
.kb-consultant-card:hover {
    border-color: #1a73e8;
    box-shadow: 0 4px 16px rgba(26,115,232,.15);
    transform: translateY(-2px);
}
.kb-consultant-card.selected {
    border-color: #1a73e8;
    background: #f0f6ff;
}
.kb-consultant-photo {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 12px;
    display: block;
    background: #e0e0e0;
}
.kb-consultant-photo-placeholder {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #c5cae9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 12px;
    color: #3949ab;
    font-weight: 700;
}
.kb-consultant-name  { font-weight: 700; font-size: 16px; margin-bottom: 4px; }
.kb-consultant-price { color: #1a73e8; font-size: 13px; }
.kb-consultant-bio   { color: #666; font-size: 12px; margin-top: 8px; line-height: 1.4; }

/* ── Consultation list ── */
.kb-consultation-list { display: flex; flex-direction: column; gap: 12px; }
.kb-consultation-item {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 16px 20px;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}
.kb-consultation-item:hover { border-color: #1a73e8; background: #f8fbff; }
.kb-consultation-item.selected { border-color: #1a73e8; background: #f0f6ff; }
.kb-consultation-info { flex: 1; }
.kb-consultation-title { font-weight: 700; font-size: 16px; margin-bottom: 4px; }
.kb-consultation-meta  { color: #666; font-size: 13px; display: flex; gap: 14px; flex-wrap: wrap; }
.kb-consultation-meta span { display: flex; align-items: center; gap: 4px; }
.kb-consultation-price {
    font-size: 20px;
    font-weight: 700;
    color: #1a73e8;
    white-space: nowrap;
}

/* ── Calendar ── */
.kb-datetime-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}
.kb-calendar-wrap {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}
.kb-cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #1a73e8;
    color: #fff;
    padding: 12px 16px;
}
.kb-cal-nav button {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    padding: 0 8px;
    border-radius: 4px;
    transition: background .15s;
}
.kb-cal-nav button:hover { background: rgba(255,255,255,.2); }
.kb-cal-nav span { font-weight: 600; font-size: 15px; }
.kb-cal-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
}
.kb-cal-header div {
    text-align: center;
    padding: 8px 0;
    font-size: 11px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
}
.kb-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
    padding: 8px;
}
.kb-cal-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 13px;
    cursor: default;
    color: #bbb;
    margin: 2px;
    transition: background .15s, color .15s;
}
.kb-cal-day.available {
    color: #222;
    cursor: pointer;
    font-weight: 600;
}
.kb-cal-day.available:hover { background: #e8f0fe; color: #1a73e8; }
.kb-cal-day.selected { background: #1a73e8 !important; color: #fff !important; }
.kb-cal-day.today { border: 2px solid #1a73e8; }

/* ── Time slots ── */
.kb-slots-wrap { }
.kb-slots-wrap h3 { font-size: 16px; font-weight: 700; margin: 0 0 14px; color: #444; }
.kb-slots-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kb-slot-btn {
    padding: 10px 6px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    text-align: center;
    transition: border-color .15s, background .15s, color .15s;
}
.kb-slot-btn:hover { border-color: #1a73e8; color: #1a73e8; background: #f0f6ff; }
.kb-slot-btn.selected { border-color: #1a73e8; background: #1a73e8; color: #fff; }
.kb-no-slots { color: #999; font-size: 14px; padding: 16px 0; }

/* ── Fields ── */
.kb-fields { display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px; }
.kb-field-group { display: flex; flex-direction: column; gap: 6px; }
.kb-field-label { font-weight: 600; font-size: 14px; }
.kb-input {
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color .15s;
    outline: none;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
}
.kb-input:focus { border-color: #1a73e8; }
textarea.kb-input { resize: vertical; min-height: 80px; }

/* ── Summary card ── */
.kb-summary {
    background: #f0f6ff;
    border: 1px solid #c7deff;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 22px;
    font-size: 14px;
    line-height: 1.8;
}
.kb-summary strong { color: #1a73e8; }
.kb-summary-row { display: flex; justify-content: space-between; }
.kb-summary-total { font-size: 18px; font-weight: 700; color: #1a73e8; margin-top: 8px; padding-top: 8px; border-top: 1px solid #c7deff; }

/* ── Submit button ── */
.kb-btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 15px 24px;
    background: #1a73e8;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s, transform .15s;
    box-sizing: border-box;
}
.kb-btn-submit:hover  { background: #1557b0; transform: translateY(-1px); }
.kb-btn-submit:active { transform: translateY(0); }
.kb-btn-submit:disabled { background: #aaa; cursor: not-allowed; transform: none; }

/* ── Payment screen ── */
.kb-payment-info { text-align: center; padding: 48px 20px; }
.kb-payment-info h2 { margin: 20px 0 10px; }
.kb-payment-info p  { color: #666; }

/* ── Alerts ── */
.kb-alert { padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 14px; }
.kb-alert-error { background: #fce4ec; color: #b71c1c; border: 1px solid #f48fb1; }

/* ── Loader ── */
.kb-loading { display: flex; align-items: center; gap: 10px; color: #666; font-size: 14px; padding: 16px 0; }
.kb-spinner {
    width: 22px; height: 22px;
    border: 3px solid #e0e0e0;
    border-top-color: #1a73e8;
    border-radius: 50%;
    animation: kbSpin .7s linear infinite;
    flex-shrink: 0;
}
.kb-spinner-lg { width: 48px; height: 48px; border-width: 5px; margin: 0 auto 20px; display: block; }
@keyframes kbSpin { to { transform: rotate(360deg); } }

/* ── Responsive ── */
@media (max-width: 640px) {
    .kb-datetime-wrap { grid-template-columns: 1fr; }
    .kb-slots-grid    { grid-template-columns: repeat(4, 1fr); }
    .kb-consultant-grid { grid-template-columns: 1fr 1fr; }
    .kb-steps { gap: 0; }
    .kb-step-label { display: none; }
}
@media (max-width: 400px) {
    .kb-consultant-grid { grid-template-columns: 1fr; }
    .kb-slots-grid      { grid-template-columns: repeat(3, 1fr); }
}

/* ── Consultation items (new style) ── */
.kb-consultation-item {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 16px 20px;
    cursor: pointer;
    transition: border-color .2s, background .2s, transform .15s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
    background: #fff;
}
.kb-consultation-item:hover { border-color: #1a73e8; background: #f8fbff; transform: translateX(3px); }
.kb-consultation-item.selected { border-color: #1a73e8; background: #f0f6ff; }
.kb-ci-info { flex: 1; }
.kb-ci-title { font-weight: 700; font-size: 17px; margin-bottom: 5px; }
.kb-ci-meta  { color: #666; font-size: 13px; display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 5px; }
.kb-ci-desc  { color: #888; font-size: 13px; font-style: italic; }
.kb-ci-price { font-size: 22px; font-weight: 700; color: #1a73e8; white-space: nowrap; }

/* ── Step 2 summary bar ── */
.kb-selected-summary {
    background: #f0f6ff;
    border: 1px solid #c7deff;
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #1a73e8;
}

/* ── Summary rows ── */
.kb-sr { display: flex; justify-content: space-between; padding: 5px 0; font-size: 14px; border-bottom: 1px solid #eef3ff; }
.kb-sr:last-child { border-bottom: none; }
.kb-sr-total { font-size: 18px; font-weight: 700; color: #1a73e8; padding-top: 10px; margin-top: 5px; border-top: 2px solid #c7deff !important; border-bottom: none !important; }

/* ── Invoice toggle ── */
.kb-invoice-toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 15px; font-weight: 600; }
.kb-invoice-toggle input { width: 18px; height: 18px; cursor: pointer; accent-color: #1a73e8; }

/* ── Payment methods ── */
.kb-payment-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.kb-payment-method {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 16px 12px;
    cursor: pointer;
    text-align: center;
    transition: border-color .2s, background .2s;
}
.kb-payment-method:hover  { border-color: #1a73e8; background: #f8fbff; }
.kb-payment-method.selected { border-color: #1a73e8; background: #f0f6ff; }
.kb-pm-icon  { font-size: 28px; margin-bottom: 6px; }
.kb-pm-label { font-size: 13px; font-weight: 600; color: #333; }

/* ── Result screens ── */
.kb-result-screen { text-align: center; padding: 48px 20px; }
.kb-result-icon   { font-size: 64px; margin-bottom: 12px; }
.kb-result-screen h2 { font-size: 24px; margin-bottom: 10px; }
.kb-result-screen p  { color: #666; margin-bottom: 8px; }

@media (max-width: 500px) {
    .kb-payment-grid { grid-template-columns: 1fr; }
    .kb-ci-price { font-size: 18px; }
}
