/* =====================================================
   Appointment Booking Wizard – wizard.css  v1.0.0
   Typeform-style step-by-step UI, mobile-first
   ===================================================== */

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

:root {
    --primary:        #1e5ac4;
    --primary-dark:   #1a4fa8;
    --primary-light:  #e8f0fe;
    --text:           #1a1a2e;
    --text-muted:     #6b7280;
    --border:         #e5e7eb;
    --bg:             #f9fafb;
    --white:          #ffffff;
    --success:        #10b981;
    --success-dark:   #059669;
    --danger:         #ef4444;
    --radius:         12px;
    --radius-sm:      8px;
    --shadow:         0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md:      0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

/* ── Wrapper ─────────────────────────────────────── */
.wiz-wrapper {
    max-width: 640px;
    margin: 0 auto;
    padding: 28px 20px 48px;
}

/* ── Progress bar ────────────────────────────────── */
.wiz-progress {
    margin-bottom: 32px;
}

.wiz-progress-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.wiz-progress-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .07em;
}

.wiz-progress-count {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.wiz-track {
    height: 4px;
    background: var(--border);
    border-radius: 99px;
    overflow: hidden;
}

.wiz-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 99px;
    transition: width .4s cubic-bezier(.4,0,.2,1);
}

/* ── Step container ──────────────────────────────── */
.wiz-step {
    display: none;
    animation: wiz-fade-in .25s ease;
}

.wiz-step.active { display: block; }

@keyframes wiz-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.wiz-step-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--text);
}

.wiz-step-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0 0 24px;
}

/* ── Alert ───────────────────────────────────────── */
.wiz-alert {
    padding: 11px 15px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 16px;
    display: none;
}
.wiz-alert.show { display: block; }
.wiz-alert.danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}
.wiz-alert.success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #16a34a;
}

/* ── Loading spinner ─────────────────────────────── */
.wiz-spinner-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 48px 0;
    color: var(--text-muted);
    font-size: 14px;
}

.wiz-spinner {
    width: 22px;
    height: 22px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: wiz-spin .75s linear infinite;
    flex-shrink: 0;
}

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

/* ── Empty state ─────────────────────────────────── */
.wiz-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}
.wiz-empty-icon { font-size: 40px; margin-bottom: 10px; opacity: .5; }
.wiz-empty p    { margin: 0; font-size: 14px; }

/* ── Service cards ───────────────────────────────── */
.wiz-service-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 12px;
}

.wiz-service-card {
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 18px;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s, transform .15s;
    position: relative;
    user-select: none;
}
.wiz-service-card:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.wiz-service-card.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(30,90,196,.15);
}
.wiz-service-card.selected::after {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 12px;
    color: var(--primary);
    font-weight: 700;
    font-size: 15px;
}

.wiz-service-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    line-height: 1.3;
}
.wiz-service-duration {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ── Location cards ──────────────────────────────── */
.wiz-location-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 12px;
}

.wiz-location-card {
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 18px;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s, transform .15s;
    position: relative;
    user-select: none;
}
.wiz-location-card:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.wiz-location-card.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(30,90,196,.15);
}
.wiz-location-card.selected::after {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 12px;
    color: var(--primary);
    font-weight: 700;
    font-size: 15px;
}
.wiz-location-name { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 6px; line-height: 1.3; }
.wiz-location-address { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; line-height: 1.4; }

/* ── Staff cards ─────────────────────────────────── */
.wiz-staff-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.wiz-staff-card {
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 16px;
    cursor: pointer;
    text-align: center;
    transition: all .2s;
    position: relative;
    user-select: none;
}
.wiz-staff-card:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-2px);
}
.wiz-staff-card.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(30,90,196,.15);
}
.wiz-staff-card.selected::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 10px;
    color: var(--primary);
    font-weight: 700;
    font-size: 14px;
}

.wiz-staff-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    margin: 0 auto 10px;
    border: 2px solid var(--border);
    background: var(--bg);
}
.wiz-staff-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

/* ── Calendar ────────────────────────────────────── */
.wiz-calendar {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.cal-month-label {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.cal-nav {
    background: none;
    border: none;
    cursor: pointer;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 20px;
    line-height: 1;
    transition: background .15s, color .15s;
    padding: 0;
}
.cal-nav:hover:not(:disabled) {
    background: var(--primary-light);
    color: var(--primary);
}
.cal-nav:disabled { opacity: .3; cursor: not-allowed; }

.cal-grid { padding: 12px 10px 16px; }

.cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 4px;
}
.cal-weekday {
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    padding: 6px 0;
    text-transform: uppercase;
    letter-spacing: .06em;
}

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

.cal-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s, color .15s;
    min-height: 38px;
    min-width: 38px;
    width: 100%;
    user-select: none;
}
.cal-day:hover:not(.cal-disabled):not(.cal-empty) {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}
.cal-day.cal-selected {
    background: var(--primary);
    color: #fff;
    font-weight: 700;
}
.cal-day.cal-today:not(.cal-selected) {
    border: 2px solid var(--primary);
    color: var(--primary);
    font-weight: 700;
}
.cal-day.cal-disabled {
    color: #d1d5db;
    cursor: not-allowed;
    text-decoration: line-through;
    background: none;
}
.cal-day.cal-empty {
    cursor: default;
    pointer-events: none;
}

/* ── Time slots ──────────────────────────────────── */
.wiz-time-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
    gap: 8px;
}

.wiz-time-slot {
    padding: 13px 8px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
    background: var(--white);
    user-select: none;
}
.wiz-time-slot:hover:not(.wiz-slot-busy) {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}
.wiz-time-slot.wiz-slot-selected {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
    font-weight: 700;
}
.wiz-time-slot.wiz-slot-busy {
    background: #fef2f2;
    border-color: #fecaca;
    color: #d1d5db;
    cursor: not-allowed;
    text-decoration: line-through;
    font-size: 12px;
}
/* Break / staff time-off blocks */
.wiz-time-slot.wiz-slot-break {
    background: #fffbeb;
    border-color: #fde68a;
    color: #b45309;
    cursor: not-allowed;
    font-size: 12px;
}
.wiz-slot-tag {
    display: block;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-top: 2px;
    opacity: .8;
}

/* ── Details form ────────────────────────────────── */
.wiz-details-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.wiz-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.wiz-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.wiz-field.full { grid-column: 1 / -1; }

.wiz-field label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: .05em;
}
.wiz-field label .req { color: var(--danger); margin-left: 2px; }

.wiz-field input,
.wiz-field textarea {
    padding: 12px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
    color: var(--text);
    background: var(--white);
    transition: border-color .2s, box-shadow .2s;
    outline: none;
    width: 100%;
}
.wiz-field input:focus,
.wiz-field textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30,90,196,.12);
}
.wiz-field input.wiz-err,
.wiz-field textarea.wiz-err { border-color: var(--danger); }

.wiz-field .wiz-err-msg {
    font-size: 11px;
    color: var(--danger);
    font-weight: 500;
    display: none;
}
.wiz-field.has-error .wiz-err-msg  { display: block; }
.wiz-field.has-error input,
.wiz-field.has-error textarea       { border-color: var(--danger); }

.wiz-phone-wrap {
    display: flex;
}
.wiz-phone-prefix {
    padding: 12px 12px;
    background: var(--bg);
    border: 2px solid var(--border);
    border-right: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    font-size: 15px;
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
    user-select: none;
}
.wiz-phone-wrap input {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important;
    flex: 1;
}

/* ── Confirmation summary ────────────────────────── */
.wiz-confirm-summary {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 8px;
    box-shadow: var(--shadow);
}

.wiz-confirm-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 15px 18px;
    border-bottom: 1px solid var(--border);
}
.wiz-confirm-item:last-child { border-bottom: none; }

.wiz-confirm-icon {
    width: 36px;
    height: 36px;
    background: #f3f4f6;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    color: #6b7280;
    flex-shrink: 0;
}
.wiz-confirm-body { flex: 1; min-width: 0; }
.wiz-confirm-lbl {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .07em;
    margin-bottom: 2px;
}
.wiz-confirm-val {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wiz-confirm-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 1px;
}
.wiz-confirm-edit {
    font-size: 12px;
    color: var(--primary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background .15s;
    flex-shrink: 0;
    border: none;
    background: none;
    font-family: inherit;
    font-weight: 500;
}
.wiz-confirm-edit:hover { background: var(--primary-light); }

/* ── Navigation ──────────────────────────────────── */
.wiz-nav {
    margin-top: 28px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.wiz-btn-back {
    padding: 13px 22px;
    background: transparent;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all .2s;
    font-family: inherit;
    white-space: nowrap;
}
.wiz-btn-back:hover {
    border-color: var(--text-muted);
    color: var(--text);
}

.wiz-btn-next {
    padding: 15px 28px;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    transition: background .2s, transform .15s, box-shadow .2s;
    font-family: inherit;
    flex: 1;
    min-height: 58px;
}
.wiz-btn-next:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(30,90,196,.3);
}
.wiz-btn-next:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.wiz-btn-next.submit-mode {
    background: var(--success);
}
.wiz-btn-next.submit-mode:hover:not(:disabled) {
    background: var(--success-dark);
    box-shadow: 0 6px 16px rgba(16,185,129,.3);
}

/* ── Auto-selected staff notice ──────────────────── */
.wiz-auto-notice {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--primary-light);
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    padding: 16px 18px;
}
.wiz-auto-notice-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
    flex-shrink: 0;
    background: var(--bg);
}
.wiz-auto-notice-text strong { display: block; font-size: 14px; color: var(--text); }
.wiz-auto-notice-text span   { font-size: 12px; color: var(--text-muted); }

/* ── Mobile ──────────────────────────────────────── */
@media (max-width: 480px) {
    .wiz-wrapper { padding: 16px 14px 36px; }

    .wiz-step-title { font-size: 18px; }

    .wiz-service-cards,
    .wiz-location-cards {
        grid-template-columns: 1fr;
    }
    .wiz-staff-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    .wiz-form-row {
        grid-template-columns: 1fr;
    }
    .wiz-time-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .wiz-time-slot {
        padding: 11px 4px;
        font-size: 12px;
    }
    .cal-day {
        min-height: 32px;
        min-width: 32px;
        font-size: 12px;
    }
    .wiz-btn-back { padding: 13px 14px; font-size: 13px; }
}

@media (max-width: 640px) {
    .wiz-nav { flex-direction: column; gap: 10px; }
    .wiz-btn-back, .wiz-btn-next { width: 100%; }
}

@media (min-width: 481px) and (max-width: 768px) {
    .wiz-wrapper { max-width: 100%; }
    .wiz-form-row { grid-template-columns: 1fr 1fr; }
}

/* ── Deposit / Stripe step ────────────────────────── */
.wiz-deposit-box {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-top: 12px;
}
.wiz-deposit-amount {
    font-size: 15px;
    color: var(--text);
    margin-bottom: 16px;
}
.wiz-deposit-amount strong {
    color: var(--primary);
}
.wiz-stripe-mount {
    min-height: 120px;
    padding: 8px 0;
}
.wiz-stripe-mount .StripeElement,
.wiz-stripe-mount iframe {
    border-radius: var(--radius-sm);
}
