/* ============================================
   Phillip Kirillov — Booking Page (iClosed-style)
   ============================================ */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #f2f2f7;
    --card: #ffffff;
    --text: #1a1a2e;
    --text-secondary: #8e8e93;
    --text-tertiary: #aeaeb2;
    --border: rgba(0, 0, 0, 0.08);
    --accent: #1a1a2e;
    --accent-light: #f2f2f7;
    --success: #34c759;
    --available: #e8f5e9;
    --available-dot: #4caf50;
    --error: #ff3b30;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius: 16px;
    --radius-sm: 10px;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

html {
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* --- Layout --- */
.booking-page {
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 20px 48px;
}

/* --- Progress Bar --- */
.progress-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 32px;
    padding: 16px 24px;
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border);
    transition: all 0.3s var(--ease);
}

.progress-step.active .progress-dot {
    background: var(--accent);
    box-shadow: 0 0 0 3px rgba(26, 26, 46, 0.15);
}

.progress-step.done .progress-dot {
    background: var(--success);
}

.progress-step span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-tertiary);
    transition: color 0.3s;
}

.progress-step.active span {
    color: var(--text);
}

.progress-step.done span {
    color: var(--success);
}

.progress-line {
    width: 40px;
    height: 1px;
    background: var(--border);
}

/* --- Booking Card --- */
.booking-card {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
}

.card-split {
    display: grid;
    grid-template-columns: 380px 1fr;
}

/* --- Left Panel --- */
.card-left {
    padding: 32px;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.card-left .back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 20px;
    transition: color 0.2s;
}

.card-left .back-link:hover {
    color: var(--text);
}

.card-info-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 16px;
    background: #ddd;
}

.card-info-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.card-left h1 {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.card-event-name {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.card-info-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.detail-item svg {
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.card-info-desc {
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.lead-summary {
    margin-top: 16px;
    padding: 14px;
    background: var(--accent-light);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.lead-summary strong {
    color: var(--text);
    font-weight: 500;
}

/* --- Form --- */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-group {
    margin-bottom: 16px;
}

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    font-family: var(--font);
    background: var(--accent-light);
    border: 1.5px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text);
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-tertiary);
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent);
    background: var(--card);
}

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

/* Phone input */
.phone-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--accent-light);
    border-radius: var(--radius-sm);
    border: 1.5px solid transparent;
    transition: border-color 0.2s, background 0.2s;
    overflow: hidden;
}

.phone-input-wrapper:focus-within {
    border-color: var(--accent);
    background: var(--card);
}

.phone-prefix {
    padding: 12px 0 12px 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    user-select: none;
}

.phone-input-wrapper input {
    border: none !important;
    background: transparent !important;
    padding-left: 8px;
    border-radius: 0;
}

.phone-input-wrapper input:focus {
    border: none !important;
}

.form-consent {
    font-size: 12px;
    color: var(--text-tertiary);
    line-height: 1.6;
    margin-bottom: 20px;
}

.btn-continue {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font);
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-continue:hover {
    opacity: 0.85;
}

.btn-continue:active {
    transform: scale(0.98);
}

/* --- Right Panel (Calendar) --- */
.card-right {
    position: relative;
    min-height: 500px;
}

/* Blur overlay */
.calendar-blur-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s var(--ease);
}

.calendar-blur-overlay.removed {
    opacity: 0;
    pointer-events: none;
}

.blur-message {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    z-index: 2;
}

.blur-message svg {
    color: var(--text-tertiary);
    flex-shrink: 0;
}

/* Blur the calendar itself when locked */
.card-right.locked .card-calendar {
    filter: blur(5px);
    pointer-events: none;
    user-select: none;
}

.card-right.unlocked .calendar-blur-overlay {
    opacity: 0;
    pointer-events: none;
}

.card-right.unlocked .card-calendar {
    filter: none;
    pointer-events: auto;
    user-select: auto;
}

.card-calendar {
    padding: 28px;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    transition: filter 0.4s var(--ease);
}

/* --- Calendar --- */
.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.calendar-month-label {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.2px;
}

.calendar-nav button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    transition: background 0.2s;
}

.calendar-nav button:hover {
    background: var(--accent-light);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    margin-bottom: 4px;
}

.calendar-weekdays span {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    padding: 6px 0;
    text-transform: uppercase;
}

/* Calendar + Time side-by-side */
.calendar-time-wrapper {
    display: flex;
    gap: 0;
}

.calendar-column {
    flex: 1;
    min-width: 0;
}

.time-column {
    width: 180px;
    flex-shrink: 0;
    border-left: 1px solid var(--border);
    padding-left: 20px;
    margin-left: 20px;
    display: flex;
    flex-direction: column;
}

.time-column h4 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text);
    white-space: nowrap;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}

.cal-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 400;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: default;
    color: var(--text-tertiary);
    position: relative;
    transition: all 0.15s var(--ease);
}

.cal-day.empty {
    visibility: hidden;
}

.cal-day.available {
    color: var(--text);
    cursor: pointer;
    font-weight: 500;
    background: var(--available);
}

.cal-day.available::after {
    content: '';
    position: absolute;
    bottom: 3px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--available-dot);
}

.cal-day.available:hover {
    background: #c8e6c9;
}

.cal-day.selected {
    background: var(--accent);
    color: white;
}

.cal-day.selected::after {
    background: white;
    opacity: 0.6;
}

.cal-day.today {
    font-weight: 700;
}

.cal-day.past {
    color: rgba(0, 0, 0, 0.15);
}

/* --- Time Slots --- */
.time-slots {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 4px;
}

.time-slot {
    padding: 10px 8px;
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font);
    background: transparent;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    color: var(--text);
    transition: all 0.15s var(--ease);
}

.time-slot:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}

.time-slot.selected {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.time-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* --- Calendar Actions --- */
.calendar-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.btn-book {
    padding: 14px 28px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font);
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
}

.btn-book:hover:not(:disabled) {
    opacity: 0.85;
}

.btn-book:active:not(:disabled) {
    transform: scale(0.98);
}

.btn-book:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* --- Step Panel (Confirmation) --- */
.step-panel {
    animation: fadeIn 0.4s var(--ease) both;
}

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

/* --- Confirmation --- */
.confirmation {
    text-align: center;
    background: var(--card);
    border-radius: var(--radius);
    padding: 60px 32px;
    border: 1px solid var(--border);
}

.confirm-icon {
    color: var(--success);
    margin-bottom: 20px;
    animation: confirmPop 0.5s var(--ease) both;
}

@keyframes confirmPop {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

.confirmation h2 {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.3px;
    margin-bottom: 10px;
}

.confirm-detail {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.confirm-email {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-bottom: 28px;
}

.btn-done {
    display: inline-block;
    padding: 14px 36px;
    font-size: 14px;
    font-weight: 600;
    background: var(--accent);
    color: white;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: opacity 0.2s;
}

.btn-done:hover {
    opacity: 0.85;
}

/* --- Responsive --- */
@media (max-width: 800px) {
    .booking-page {
        padding: 20px 16px 40px;
    }

    .card-split {
        grid-template-columns: 1fr;
    }

    .card-left {
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 24px;
    }

    .card-right {
        min-height: 400px;
    }

    .card-calendar {
        padding: 24px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .calendar-time-wrapper {
        flex-direction: column;
    }

    .time-column {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--border);
        padding-left: 0;
        margin-left: 0;
        padding-top: 16px;
        margin-top: 16px;
    }

    .time-slots {
        flex-direction: row;
        flex-wrap: wrap;
        max-height: none;
    }

    .time-slot {
        flex: 1 0 calc(33% - 4px);
    }

    .progress-bar {
        padding: 12px 16px;
        gap: 10px;
    }

    .progress-step span {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .time-slot {
        flex: 1 0 calc(50% - 4px);
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
