/* =============================================
   Miel — Booking Wizard
   Modern, spacious, mobile-first
   ============================================= */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(13,148,136,.3); }
    50% { box-shadow: 0 0 0 8px rgba(13,148,136,0); }
}

/* =============================================
   Body
   ============================================= */
.wizard-body {
    background: var(--gray-50);
    min-height: 100vh;
    font-family: 'Plus Jakarta Sans', var(--font-sans);
}
.wizard-body h2,
.wizard-body .wizard-nav__logo {
    font-family: var(--font-serif);
}

/* =============================================
   Navbar
   ============================================= */
.wizard-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 32px;
    background: var(--gray-900);
    min-height: 60px;
}
.wizard-nav__logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}
.wizard-nav__logo-img {
    height: 44px;
    width: auto;
    display: block;
    object-fit: contain;
}
.wizard-nav__right {
    display: flex;
    align-items: center;
    gap: 20px;
}
.wizard-nav__step-label {
    font-size: .78rem;
    font-weight: 600;
    color: var(--teal-300);
    letter-spacing: .3px;
}
.wizard-nav__back {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: .82rem;
    font-weight: 500;
    color: var(--gray-400);
    text-decoration: none;
    transition: color var(--transition);
}
.wizard-nav__back:hover { color: var(--white); }

/* =============================================
   Progress Bar — Slim horizontal
   ============================================= */
.wizard-progress {
    position: sticky;
    top: 48px;
    z-index: 90;
    background: var(--white);
    padding: 0 24px;
    border-bottom: 1px solid var(--gray-100);
    box-shadow: 0 1px 4px rgba(0,0,0,.03);
}
.wizard-progress__bar {
    height: 3px;
    background: var(--gray-200);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}
.wizard-progress__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--teal-600), var(--teal-400));
    transition: width .4s cubic-bezier(.4,0,.2,1);
}
.wizard-progress__steps {
    display: flex;
    align-items: stretch;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0;
}
.wizard-progress__steps::-webkit-scrollbar { display: none; }
.wizard-progress__step {
    flex: 0 0 auto;
    padding: 14px 16px;
    font-size: .78rem;
    font-weight: 600;
    color: var(--gray-400);
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: all .2s ease;
    white-space: nowrap;
    position: relative;
    font-family: 'Plus Jakarta Sans', var(--font-sans);
}
.wizard-progress__step:hover {
    color: var(--gray-600);
    background: var(--gray-50);
}
.wizard-progress__step--active {
    color: var(--teal-700);
    border-bottom-color: var(--teal-600);
}
.wizard-progress__step--completed {
    color: var(--teal-600);
    cursor: pointer;
}
.wizard-progress__step--completed::after {
    content: '✓';
    margin-left: 4px;
    font-size: .65rem;
}
.wizard-progress__step--future {
    cursor: default;
    opacity: .5;
}
.wizard-progress__step--future:hover {
    color: var(--gray-400);
    background: transparent;
}

/* =============================================
   Wizard Container
   ============================================= */
.wizard {
    max-width: 880px;
    margin: 0 auto;
    padding: 40px 32px 100px;
    min-height: calc(100vh - 110px);
    font-family: var(--font-sans);
    color: var(--color-text);
}

/* =============================================
   Steps
   ============================================= */
.wizard__step { display: none; }
.wizard__step--active {
    display: block;
    animation: fadeIn .35s ease-out;
}
.wizard__step--shake { animation: shake .4s ease; }

.wizard__step-header {
    text-align: center;
    margin-bottom: 36px;
}
.wizard__step-header h2 {
    font-family: 'Plus Jakarta Sans', var(--font-sans);
    font-size: clamp(1.3rem, 3vw, 1.6rem);
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 8px;
}
.wizard__step-desc {
    font-size: .92rem;
    color: var(--gray-500);
    max-width: 480px;
    margin: 0 auto;
    line-height: 1.5;
}

/* =============================================
   Option Cards
   ============================================= */
.wizard__cards {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, 1fr);
    max-width: 600px;
    margin: 0 auto;
}
.wizard__cards--cols-3 {
    grid-template-columns: repeat(3, 1fr);
}
.wizard__card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 32px 20px 28px;
    border: 2px solid var(--gray-200);
    border-radius: 16px;
    background: var(--white);
    cursor: pointer;
    transition: all .25s cubic-bezier(.4,0,.2,1);
    user-select: none;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.wizard__card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: transparent;
    transition: background var(--transition);
}
.wizard__card:hover {
    border-color: var(--teal-400);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(15,118,110,.1);
}
.wizard__card--selected {
    border-color: var(--teal-500);
    background: linear-gradient(180deg, rgba(240,253,250,1) 0%, var(--white) 100%);
    box-shadow: 0 8px 24px rgba(15,118,110,.12);
    transform: translateY(-2px);
}
.wizard__card--selected::after {
    background: var(--teal-500);
}
.wizard__card--selected:hover { transform: translateY(-2px); }

.wizard__card-icon {
    width: 52px;
    height: 52px;
    color: var(--teal-500);
    margin-bottom: 14px;
    transition: all var(--transition);
}
.wizard__card--selected .wizard__card-icon { color: var(--teal-600); }
.wizard__card-icon svg { width: 100%; height: 100%; }
.wizard__card-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--gray-800);
    margin-bottom: 4px;
}
.wizard__card-desc {
    font-size: .8rem;
    color: var(--gray-400);
    line-height: 1.4;
}

/* =============================================
   Fonasa Alert
   ============================================= */
.fonasa-alert {
    display: flex;
    gap: 14px;
    margin-top: 20px;
    padding: 20px;
    background: #FEF3C7;
    border: 1px solid #FDE68A;
    border-radius: 12px;
    animation: fadeIn .3s ease-out;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}
.fonasa-alert__icon {
    flex-shrink: 0;
    color: #D97706;
    margin-top: 2px;
}
.fonasa-alert__content { flex: 1; }
.fonasa-alert__title {
    font-weight: 700;
    font-size: .92rem;
    color: #92400E;
    margin-bottom: 4px;
}
.fonasa-alert__text {
    font-size: .85rem;
    color: #A16207;
    line-height: 1.5;
    margin-bottom: 14px;
}
.fonasa-alert__actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

/* =============================================
   Calendar
   ============================================= */
.wcal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0 20px;
}
.wcal__title {
    font-family: 'Plus Jakarta Sans', var(--font-sans);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gray-800);
}
.wcal__nav {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gray-200);
    background: var(--white);
    color: var(--gray-600);
    cursor: pointer;
    font-size: 1.2rem;
    transition: all var(--transition);
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.wcal__nav:hover {
    background: var(--teal-50);
    border-color: var(--teal-500);
    color: var(--teal-600);
}
.wcal__grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}
.wcal__dayname {
    text-align: center;
    font-size: .72rem;
    font-weight: 700;
    color: var(--gray-400);
    text-transform: uppercase;
    padding: 0 0 10px;
    letter-spacing: .05em;
}
.wcal__cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 4px 8px;
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition);
    font-size: .9rem;
    font-weight: 500;
    color: var(--gray-700);
    border: 1.5px solid transparent;
    min-height: 52px;
    gap: 3px;
    background: var(--white);
}
.wcal__cell--available {
    border-color: var(--gray-200);
    box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
.wcal__cell--available:hover {
    border-color: var(--teal-500);
    background: var(--teal-50);
    box-shadow: 0 3px 10px rgba(15,118,110,.1);
    transform: translateY(-1px);
}
.wcal__cell--selected {
    background: var(--teal-600) !important;
    color: var(--white) !important;
    border-color: var(--teal-600) !important;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(15,118,110,.25);
}
.wcal__cell--selected .wcal__dot { background: var(--white); }
.wcal__cell--past, .wcal__cell--unavailable {
    color: var(--gray-300);
    cursor: default;
    background: transparent;
}
.wcal__cell--empty { visibility: hidden; min-height: 0; padding: 0; }
.wcal__dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--teal-500);
}

/* Time Slots */
.wslots__label {
    font-size: .92rem;
    color: var(--gray-600);
    margin: 24px 0 14px;
}
.wslots__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
    gap: 10px;
}
.wslot {
    padding: 12px 6px;
    text-align: center;
    font-size: .88rem;
    font-weight: 600;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    background: var(--white);
    cursor: pointer;
    transition: all var(--transition);
    color: var(--gray-700);
    box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
.wslot:hover {
    border-color: var(--teal-500);
    color: var(--teal-600);
    background: var(--teal-50);
    transform: translateY(-1px);
}
.wslot--selected {
    border-color: var(--teal-500);
    background: var(--teal-500);
    color: var(--white);
    box-shadow: 0 3px 10px rgba(15,118,110,.2);
}
.wslot--selected:hover {
    background: var(--teal-600);
    border-color: var(--teal-600);
    color: var(--white);
}

/* =============================================
   Specialist Cards
   ============================================= */
.sp-select-card {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 24px;
    border: 2px solid var(--gray-200);
    border-radius: 16px;
    background: var(--white);
    cursor: pointer;
    transition: all var(--transition);
    margin-bottom: 14px;
    position: relative;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.sp-select-card:hover {
    border-color: var(--teal-400);
    box-shadow: 0 6px 20px rgba(15,118,110,.08);
    transform: translateY(-2px);
}
.sp-select-card--selected {
    border-color: var(--teal-500);
    background: linear-gradient(90deg, rgba(240,253,250,1) 0%, var(--white) 40%);
    box-shadow: 0 6px 20px rgba(15,118,110,.12);
    border-left: 4px solid var(--teal-500);
}
.sp-select-card__left { flex-shrink: 0; }
.sp-select-card__photo {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--gray-100);
}
.sp-select-card--selected .sp-select-card__photo { border-color: var(--teal-400); }
.sp-select-card__avatar {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--teal-700), var(--teal-500));
    color: var(--white);
    font-family: var(--font-serif);
    font-size: 1.3rem;
    border: 3px solid var(--gray-100);
}
.sp-select-card--selected .sp-select-card__avatar { border-color: var(--teal-400); }
.sp-select-card__info { flex: 1; min-width: 0; }
.sp-select-card__name {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--gray-900);
    margin-bottom: 2px;
}
.sp-select-card__role {
    font-size: .82rem;
    color: var(--gray-500);
    margin-bottom: 8px;
}
.sp-select-card__bio {
    font-size: .82rem;
    color: var(--gray-500);
    line-height: 1.5;
    margin-top: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.sp-select-card__fonasa-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .72rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: var(--radius-full);
}
.sp-select-card__fonasa-badge--available {
    background: #DCFCE7;
    color: #15803D;
}
.sp-select-card__fonasa-badge--exhausted {
    background: #FEF3C7;
    color: #D97706;
}

/* =============================================
   Pricing Display
   ============================================= */
.pricing-display {
    text-align: center;
    padding: 48px 32px;
    background: linear-gradient(180deg, var(--white) 0%, var(--gray-50) 100%);
    border-radius: 20px;
    border: 1px solid var(--gray-200);
    max-width: 420px;
    margin: 0 auto;
    box-shadow: 0 2px 12px rgba(0,0,0,.04);
}
.pricing-display__label {
    font-size: .88rem;
    color: var(--gray-500);
    font-weight: 500;
    margin-bottom: 8px;
    display: block;
}
.pricing-display__price {
    font-size: 3rem;
    font-weight: 800;
    color: var(--teal-700);
    line-height: 1;
    display: block;
    margin-bottom: 8px;
}
.pricing-display__detail {
    font-size: .82rem;
    color: var(--gray-400);
    display: block;
}
.pricing-display__note {
    display: block;
    margin-top: 20px;
    padding: 12px 18px;
    font-size: .82rem;
    font-weight: 500;
    border-radius: 10px;
    line-height: 1.5;
    text-align: left;
}
.pricing-display__note--ok {
    background: #DCFCE7;
    color: #15803D;
    border: 1px solid #BBF7D0;
}
.pricing-display__note--warn {
    background: #FEF3C7;
    color: #D97706;
    border: 1px solid #FDE68A;
}

/* =============================================
   Patient Form
   ============================================= */
.wizard__form {
    max-width: 560px;
    margin: 0 auto;
}
.wizard__form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
.wizard__form-group label {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}
.wizard__form-group input,
.wizard__form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: 10px;
    font-family: var(--font-sans);
    font-size: .9rem;
    color: var(--gray-800);
    background: var(--white);
    transition: all var(--transition);
    box-sizing: border-box;
}
.wizard__form-group input:focus,
.wizard__form-group textarea:focus {
    outline: none;
    border-color: var(--teal-500);
    box-shadow: 0 0 0 3px rgba(13,148,136,.1);
}
.wizard__form-group textarea { resize: vertical; }
.wizard__form-full { margin-top: 0; }

/* =============================================
   Navigation Buttons
   ============================================= */
.wizard__actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-200);
}
.wizard__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-sans);
    font-size: .92rem;
    font-weight: 600;
    padding: 14px 32px;
    border-radius: var(--radius-full);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
}
.wizard__btn--back {
    background: var(--gray-100);
    color: var(--gray-600);
}
.wizard__btn--back:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}
.wizard__btn--next {
    background: var(--teal-600);
    color: var(--white);
    margin-left: auto;
    box-shadow: 0 2px 8px rgba(15,118,110,.2);
}
.wizard__btn--next:hover {
    background: var(--teal-700);
    box-shadow: 0 4px 14px rgba(15,118,110,.3);
    transform: translateY(-1px);
}
.wizard__btn--next:disabled {
    background: var(--gray-200);
    color: var(--gray-400);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}
.wizard__btn--confirm {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Plus Jakarta Sans', var(--font-sans);
    font-size: .95rem;
    font-weight: 700;
    padding: 16px 36px;
    border-radius: var(--radius-full);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    background: var(--color-accent);
    color: var(--white);
    margin-left: auto;
    box-shadow: 0 2px 12px rgba(212,160,74,.3);
}
.wizard__btn--confirm:hover {
    background: #B8860B;
    box-shadow: 0 4px 16px rgba(212,160,74,.4);
    transform: translateY(-1px);
}

/* =============================================
   Confirm Split Layout (Step 7: Summary + Price)
   ============================================= */
.wizard__confirm-split {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    align-items: start;
}
.wizard__confirm-left { min-width: 0; }
.wizard__confirm-right { position: sticky; top: 140px; }

/* =============================================
   Summary
   ============================================= */
.wizard-summary {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,.04);
    max-width: 560px;
    margin: 0 auto;
}
.wizard-summary__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 16px 24px;
    border-bottom: 1px solid var(--gray-100);
    font-size: .9rem;
}
.wizard-summary__row:last-child { border-bottom: none; }
.wizard-summary__row span:first-child {
    color: var(--gray-500);
    font-weight: 500;
}
.wizard-summary__row strong {
    color: var(--gray-800);
    text-align: right;
}
.wizard-summary__total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 20px 24px;
    background: linear-gradient(90deg, rgba(240,253,250,1) 0%, var(--white) 100%);
    border-top: 2px solid var(--teal-500);
}
.wizard-summary__total span {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gray-800);
}
.wizard-summary__total strong {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--teal-700);
}

/* =============================================
   Success Screen
   ============================================= */
.wizard-success {
    text-align: center;
    padding: 60px 24px;
    max-width: 500px;
    margin: 0 auto;
}
.wizard-success__icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--teal-500), var(--teal-400));
    color: var(--white);
    font-size: 2.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    box-shadow: 0 8px 24px rgba(15,118,110,.2);
}
.wizard-success h2 {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    color: var(--gray-900);
    margin-bottom: 12px;
}
.wizard-success p {
    color: var(--gray-600);
    font-size: .95rem;
    line-height: 1.6;
    margin-bottom: 8px;
}
.wizard-success__amount { font-size: 1.1rem; color: var(--teal-700); font-weight: 600; }
.wizard-success__note { color: var(--gray-400); font-size: .85rem; }
.wizard-success__actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 32px;
}

/* =============================================
   Responsive
   ============================================= */
@media (max-width: 768px) {
    .wizard-nav { padding: 10px 16px; }
    .wizard-nav__step-label { display: none; }
    .wizard-progress { padding: 12px 16px 10px; top: 44px; }
    .wizard-progress__step { width: 24px; height: 24px; font-size: .65rem; }
    .wizard { padding: 28px 16px 80px; }
}

@media (max-width: 560px) {
    .wizard__step-header h2 { font-size: 1.25rem; }
    .wizard__cards { grid-template-columns: repeat(2, 1fr); gap: 12px; max-width: 100%; }
    .wizard__cards--cols-3 { grid-template-columns: repeat(2, 1fr); }
    .wizard__card { padding: 24px 14px 20px; }
    .wizard__card-icon { width: 40px; height: 40px; }
    .wizard__card-desc { display: none; }

    .sp-select-card { flex-direction: column; align-items: center; text-align: center; padding: 20px; }
    .sp-select-card__info { text-align: center; }
    .sp-select-card__photo, .sp-select-card__avatar { width: 64px; height: 64px; font-size: 1.1rem; }
    .sp-select-card--selected { border-left-width: 2px; }

    .wcal__cell { min-height: 42px; font-size: .82rem; padding: 8px 2px 6px; }
    .wslots__grid { grid-template-columns: repeat(3, 1fr); }

    .pricing-display { padding: 32px 20px; }
    .pricing-display__price { font-size: 2.4rem; }

    .wizard__form-grid { grid-template-columns: 1fr; }
    .wizard__btn { padding: 12px 24px; font-size: .85rem; }

    .wizard__confirm-split { grid-template-columns: 1fr; }
    .wizard__confirm-right { position: static; }
    .wizard-summary__row { flex-direction: column; gap: 2px; padding: 12px 18px; }
    .wizard-summary__row strong { text-align: left; }

    .wizard-success__actions { flex-direction: column; }
    .wizard-success h2 { font-size: 1.5rem; }
}
