/* ─── Сброс и базовые стили ────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --pink: #e8a0bf;
    --pink-dark: #d4789e;
    --pink-light: #f5d5e5;
    --pink-pale: #fdf0f5;
    --purple: #b68ed1;
    --purple-dark: #9a6fb8;
    --gold: #d4a855;
    --white: #ffffff;
    --gray-50: #fafafa;
    --gray-100: #f4f4f5;
    --gray-200: #e4e4e7;
    --gray-300: #d4d4d8;
    --gray-500: #71717a;
    --gray-700: #3f3f46;
    --gray-900: #18181b;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.2s ease;
}

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, var(--pink-pale) 0%, #f5f0ff 50%, var(--pink-pale) 100%);
    color: var(--gray-900);
    min-height: 100vh;
    padding: 20px 16px 40px;
}

/* ─── Контейнер ───────────────────────────────────────────────────────── */
.container {
    max-width: 480px;
    margin: 0 auto;
}

/* ─── Шапка ───────────────────────────────────────────────────────────── */
.header {
    text-align: center;
    margin-bottom: 24px;
}

.logo {
    font-size: 48px;
    margin-bottom: 8px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.subtitle {
    color: var(--gray-500);
    font-size: 14px;
    font-weight: 500;
}

/* ─── Прогресс-бар ────────────────────────────────────────────────────── */
.progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 28px;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    background: var(--gray-200);
    color: var(--gray-500);
    transition: all var(--transition);
}

.progress-step.active .step-circle {
    background: linear-gradient(135deg, var(--pink) 0%, var(--purple) 100%);
    color: var(--white);
    box-shadow: 0 3px 12px rgba(232, 160, 191, 0.4);
}

.progress-step.done .step-circle {
    background: var(--pink-dark);
    color: var(--white);
}

.progress-step span {
    font-size: 11px;
    color: var(--gray-500);
    font-weight: 500;
}

.progress-step.active span {
    color: var(--pink-dark);
    font-weight: 600;
}

.progress-line {
    width: 30px;
    height: 2px;
    background: var(--gray-200);
    margin-bottom: 18px;
    border-radius: 1px;
    transition: background var(--transition);
}

.progress-line.filled {
    background: var(--pink);
}

/* ─── Шаги ────────────────────────────────────────────────────────────── */
.step {
    display: none;
    animation: fadeIn 0.3s ease;
}

.step.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.step h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.hint {
    color: var(--gray-500);
    font-size: 13px;
    margin-bottom: 16px;
}

/* ─── Карточки услуг ──────────────────────────────────────────────────── */
.services-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 80px; /* место для summary-bar */
}

.service-card {
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 14px 16px;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 12px;
}

.service-card:hover {
    border-color: var(--pink-light);
    box-shadow: var(--shadow-sm);
}

.service-card.selected {
    border-color: var(--pink);
    background: var(--pink-pale);
    box-shadow: 0 2px 8px rgba(232, 160, 191, 0.2);
}

.service-checkbox {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 2px solid var(--gray-300);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition);
}

.service-card.selected .service-checkbox {
    background: linear-gradient(135deg, var(--pink) 0%, var(--purple) 100%);
    border-color: transparent;
}

.service-checkbox::after {
    content: '';
    display: none;
    width: 6px;
    height: 10px;
    border: solid var(--white);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -2px;
}

.service-card.selected .service-checkbox::after {
    display: block;
}

.service-info {
    flex: 1;
}

.service-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.service-meta {
    font-size: 12px;
    color: var(--gray-500);
}

.service-price {
    font-size: 17px;
    font-weight: 700;
    color: var(--pink-dark);
    white-space: nowrap;
}

/* ─── Итого-бар (нижний) ──────────────────────────────────────────────── */
.summary-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    padding: 14px 20px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    z-index: 100;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.summary-info {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-700);
}

.summary-dot {
    margin: 0 4px;
    color: var(--gray-300);
}

/* ─── Кнопки ──────────────────────────────────────────────────────────── */
.btn {
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    border-radius: var(--radius-sm);
    padding: 12px 24px;
    font-size: 14px;
    transition: all var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--pink) 0%, var(--purple) 100%);
    color: var(--white);
    box-shadow: 0 3px 12px rgba(232, 160, 191, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(232, 160, 191, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

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

.btn-large {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    border-radius: var(--radius);
}

.btn-back {
    background: none;
    color: var(--gray-500);
    padding: 12px 0;
    margin-top: 12px;
}

.btn-back:hover {
    color: var(--pink-dark);
}

/* ─── Сетка дат ───────────────────────────────────────────────────────── */
.dates-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.date-card {
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
}

.date-card:hover {
    border-color: var(--pink-light);
}

.date-card.selected {
    border-color: var(--pink);
    background: var(--pink-pale);
}

.date-label {
    font-size: 14px;
    font-weight: 600;
}

.date-weekday {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 2px;
}

/* ─── Сетка слотов ────────────────────────────────────────────────────── */
.slots-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.slot-btn {
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 12px 8px;
    text-align: center;
    cursor: pointer;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    transition: all var(--transition);
}

.slot-btn:hover {
    border-color: var(--pink);
    background: var(--pink-pale);
}

.slot-btn.selected {
    border-color: var(--pink);
    background: linear-gradient(135deg, var(--pink) 0%, var(--purple) 100%);
    color: var(--white);
}

/* ─── Загрузка и пустые состояния ──────────────────────────────────────── */
.slots-loading, .no-slots {
    text-align: center;
    padding: 32px 16px;
    color: var(--gray-500);
    font-size: 14px;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--pink);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ─── Форма ───────────────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 15px;
    transition: border-color var(--transition);
    outline: none;
}

.form-group input:focus {
    border-color: var(--pink);
}

.form-group input::placeholder {
    color: var(--gray-300);
}

/* ─── Превью записи ───────────────────────────────────────────────────── */
.booking-preview {
    background: var(--white);
    border: 2px solid var(--pink-light);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 20px;
}

.preview-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
}

.preview-label {
    color: var(--gray-500);
}

.preview-value {
    font-weight: 600;
    text-align: right;
}

.preview-total {
    border-top: 2px solid var(--pink-light);
    margin-top: 8px;
    padding-top: 10px;
    font-size: 16px;
}

.preview-total .preview-value {
    color: var(--pink-dark);
    font-size: 18px;
}

/* ─── Экран успеха ────────────────────────────────────────────────────── */
.step-success {
    text-align: center;
}

.success-icon {
    font-size: 64px;
    margin-bottom: 16px;
    animation: bounceIn 0.5s ease;
}

@keyframes bounceIn {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.success-details {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px;
    margin: 16px 0;
    text-align: left;
    box-shadow: var(--shadow-sm);
}

.success-note {
    color: var(--gray-500);
    font-size: 14px;
    margin-bottom: 20px;
}

/* ─── Тост (ошибка) ───────────────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #ef4444;
    color: var(--white);
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    z-index: 200;
    animation: fadeIn 0.3s ease;
    max-width: 90%;
    text-align: center;
}

/* ─── Адаптивность ────────────────────────────────────────────────────── */
@media (min-width: 640px) {
    body {
        padding: 40px 20px;
    }
    .container {
        max-width: 520px;
    }
    .dates-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .slots-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
