/* ========== CSS Variables ========== */
:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #eef2ff;
    --success: #10b981;
    --success-light: #ecfdf5;
    --error: #ef4444;
    --error-light: #fef2f2;
    --warning: #f59e0b;
    --warning-light: #fffbeb;
    --info: #3b82f6;
    --info-light: #eff6ff;
    --text: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --bg: #f8fafc;
    --white: #ffffff;
    --card-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --card-shadow-lg: 0 4px 24px rgba(0,0,0,.08);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(.4,0,.2,1);
    --font: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ========== Reset & Base ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* ========== Booking Container ========== */
.booking-container {
    width: 100%;
    max-width: 800px;
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--card-shadow-lg);
    padding: 40px;
    position: relative;
    overflow: hidden;
}

/* ========== Progress Bar ========== */
.progress-bar {
    margin-bottom: 40px;
}

.progress-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    border: 2px solid var(--border);
    background: var(--white);
    color: var(--text-muted);
    transition: var(--transition);
}

.progress-step.active .step-circle {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--white);
}

.progress-step.completed .step-circle {
    border-color: var(--success);
    background: var(--success);
    color: var(--white);
}

.progress-step.completed .step-circle::after {
    content: '✓';
    font-size: 16px;
}

.step-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.progress-step.active .step-label,
.progress-step.completed .step-label {
    color: var(--text);
}

.progress-line {
    width: 80px;
    height: 3px;
    background: var(--border);
    border-radius: 2px;
    margin: 0 4px;
    margin-bottom: 24px;
    overflow: hidden;
}

.progress-line-fill {
    width: 0;
    height: 100%;
    background: var(--success);
    border-radius: 2px;
    transition: width 0.5s ease;
}

/* ========== Form Steps ========== */
.form-step {
    display: none;
    animation: fadeInUp 0.4s ease;
}

.form-step.active {
    display: block;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.step-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.step-subtitle {
    color: var(--text-secondary);
    margin-bottom: 28px;
    font-size: 15px;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 0;
    margin-bottom: 16px;
    transition: color 0.2s;
}

.back-btn:hover {
    color: var(--primary);
}

/* ========== Option Cards (Services & Staff) ========== */
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.staff-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.option-card {
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.option-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.12);
    transform: translateY(-2px);
}

.option-card.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.option-card.selected::after {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
}

.option-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    object-fit: contain;
}

.option-icon-placeholder {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.option-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.option-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ========== Staff Cards ========== */
.staff-photo-wrapper {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 12px;
    border: 3px solid var(--border);
    transition: border-color 0.3s;
}

.staff-card.selected .staff-photo-wrapper {
    border-color: var(--primary);
}

.staff-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.staff-designation {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ========== Date & Time ========== */
.datetime-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.calendar-wrapper {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 16px;
}

.time-wrapper {
    padding: 0;
}

.time-heading {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.time-date-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.time-slots {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 4px;
}

.time-slots::-webkit-scrollbar {
    width: 4px;
}

.time-slots::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.time-slot {
    padding: 10px 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--white);
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.time-slot:hover:not(.disabled):not(.selected) {
    border-color: var(--primary);
    color: var(--primary);
}

.time-slot.selected {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--white);
}

.time-slot.disabled {
    background: var(--bg);
    color: var(--text-muted);
    cursor: not-allowed;
    border-color: transparent;
    text-decoration: line-through;
    opacity: 0.5;
}

.time-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-muted);
    padding: 40px 0;
    font-size: 14px;
}

/* ========== Flatpickr Override ========== */
.flatpickr-calendar {
    box-shadow: none !important;
    border: none !important;
    width: 100% !important;
    font-family: var(--font) !important;
}

.flatpickr-calendar.inline {
    max-width: 100%;
}

.flatpickr-day.selected, .flatpickr-day.selected:hover {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
}

.flatpickr-day.today {
    border-color: var(--primary) !important;
}

.flatpickr-day:hover {
    background: var(--primary-light) !important;
}

/* ========== Form Fields ========== */
.info-form {
    max-width: 500px;
}

.form-row {
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.required {
    color: var(--error);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="url"],
.form-group input[type="password"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: var(--font);
    color: var(--text);
    background: var(--white);
    transition: border-color 0.2s;
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

/* intl-tel-input overrides */
.iti {
    width: 100%;
}

.iti__flag-container {
    z-index: 10;
}

/* ========== Checkboxes ========== */
.checkbox-group {
    margin-bottom: 16px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    margin-top: 2px;
    flex-shrink: 0;
}

/* ========== Buttons ========== */
.step-actions {
    margin-top: 28px;
    display: flex;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    font-family: var(--font);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-submit {
    width: 100%;
    padding: 16px 32px;
    font-size: 16px;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-success:hover {
    background: #059669;
}

/* ========== Loading ========== */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    gap: 12px;
    grid-column: 1 / -1;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-sm {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

.spinner-lg {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.btn-loader {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(2px);
}

.loading-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.loading-content p {
    color: var(--text-secondary);
    font-weight: 500;
}

/* ========== Toast ========== */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,.15);
    transition: transform 0.3s ease;
    max-width: 90vw;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast-error { background: var(--error); color: white; }
.toast-success { background: var(--success); color: white; }
.toast-info { background: var(--info); color: white; }
.toast-warning { background: var(--warning); color: white; }

.toast button {
    background: none;
    border: none;
    color: inherit;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.7;
    padding: 0;
    line-height: 1;
}

.toast button:hover { opacity: 1; }

/* ========== Error / Empty ========== */
.error-msg, .empty-msg {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    grid-column: 1 / -1;
}

.error-msg { color: var(--error); }

/* ========== Thank You Page ========== */
.thankyou-container {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
}

.thankyou-card {
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--card-shadow-lg);
    overflow: hidden;
    text-align: center;
}

.thankyou-header {
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: var(--white);
    padding: 40px 32px;
}

.thankyou-header .check-icon {
    width: 64px;
    height: 64px;
    background: rgba(255,255,255,.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 28px;
}

.thankyou-header h1 {
    font-size: 24px;
    margin-bottom: 4px;
}

.thankyou-header p {
    opacity: 0.9;
    font-size: 15px;
}

.thankyou-body {
    padding: 32px;
}

.booking-id-badge {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    padding: 8px 20px;
    border-radius: 24px;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 2px;
    margin-bottom: 24px;
}

.staff-info {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg);
    border-radius: var(--radius);
    margin-bottom: 24px;
    text-align: left;
}

.staff-info-photo {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-light);
}

.staff-info-text h3 {
    font-size: 16px;
    margin-bottom: 2px;
}

.staff-info-text p {
    font-size: 13px;
    color: var(--text-secondary);
}

.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 28px;
    text-align: left;
}

.detail-item {
    padding: 12px 16px;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.detail-item .detail-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.detail-item .detail-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.calendar-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.calendar-actions .btn {
    font-size: 14px;
    padding: 12px 24px;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    body { padding: 12px; }
    
    .booking-container { padding: 24px 20px; }
    
    .progress-line { width: 40px; }
    .step-label { font-size: 10px; }
    .step-circle { width: 32px; height: 32px; font-size: 12px; }
    
    .step-title { font-size: 20px; }
    
    .options-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .staff-grid { grid-template-columns: 1fr 1fr; }
    
    .datetime-container {
        grid-template-columns: 1fr;
    }
    
    .time-slots { grid-template-columns: repeat(3, 1fr); }
    
    .details-grid { grid-template-columns: 1fr; }
    .calendar-actions { flex-direction: column; }
    .calendar-actions .btn { width: 100%; }
}

@media (max-width: 480px) {
    .options-grid { grid-template-columns: 1fr; }
    .time-slots { grid-template-columns: repeat(2, 1fr); }
    .progress-line { width: 24px; }
}
