/**
 * Standalone /appointment page styles (embed + full page).
 * Scoped under .appointment-embed-page — does not affect microsite Index.
 */

/* ── Page shell ───────────────────────────────────────────── */
body.appointment-embed {
    background: #fff;
}

/* Prevent layout global rules from stretching doctor photos on embed page */
body.appointment-embed .appointment-embed-page img.appointment-doctor-photo {
    width: var(--ap-doctor-photo-size) !important;
    height: var(--ap-doctor-photo-size) !important;
}

body.appointment-embed .main-content {
    padding: 0;
    min-height: 100vh;
}

.appointment-embed-page {
    min-height: 100vh;
    --ap-doctor-photo-size: 56px;
    --ap-section-pad-y: 2rem;
    --ap-card-radius: 12px;
}

.appointment-embed-page--minimal {
    --ap-section-pad-y: 1rem;
}

.appointment-embed-page--minimal .ms-section {
    padding-top: var(--ap-section-pad-y);
    padding-bottom: var(--ap-section-pad-y);
}

/* ── Hero + booking ───────────────────────────────────────── */
.appointment-embed-page .ms-hero {
    position: relative;
    min-height: auto;
    display: flex;
    align-items: stretch;
    color: #fff;
    background-size: cover;
    background-position: center;
}

.appointment-embed-page .ms-hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
}

.appointment-embed-page .ms-hero-booking-title {
    font-size: clamp(1.5rem, 3.5vw, 2.25rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 0.75rem;
}

.appointment-embed-page .ms-hero-booking-lead {
    font-size: 1rem;
    opacity: 0.92;
    max-width: 36rem;
    margin: 0 0 1rem;
}

.appointment-embed-page .ms-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.appointment-embed-page .ms-hero-doctor-line {
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.95rem;
}

.appointment-embed-page .ms-hero-booking-panel {
    background: #fff;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    padding: 1.25rem;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.1);
    color: #0f172a;
}

.appointment-embed-page .ms-hero-booking-panel select#heroBookingDoctorSelect {
    border-radius: 8px;
    font-size: 0.875rem;
}

.appointment-embed-page .ms-hero-booking-panel .form-label {
    color: #374151;
}

.appointment-embed-page .ms-hero-booking-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.appointment-embed-page .ms-hero-booking-stat {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.5rem 0.35rem;
    text-align: center;
    font-size: 0.7rem;
    color: #64748b;
    line-height: 1.2;
}

.appointment-embed-page .ms-hero-booking-stat strong {
    display: block;
    color: #0f172a;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.appointment-embed-page .ms-hero-booking-avatar {
    width: var(--ap-doctor-photo-size);
    height: var(--ap-doctor-photo-size);
    min-width: var(--ap-doctor-photo-size);
    min-height: var(--ap-doctor-photo-size);
    border-radius: 14px;
    background: linear-gradient(135deg, var(--ms-primary), var(--ms-primary-dark));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
}

.appointment-embed-page .ms-hero-booking-avatar img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    display: block;
}

.appointment-embed-page .ms-hero-slot {
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 0.45rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 600;
    background: #f1f5f9;
    color: #0f172a;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.appointment-embed-page .ms-hero-slot:hover {
    background: #e2e8f0;
    border-color: var(--ms-primary);
}

/* ── Doctors section ──────────────────────────────────────── */
.appointment-embed-page .ms-section {
    padding: var(--ap-section-pad-y) 0;
}

.appointment-embed-page .ms-section-intro {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 1.5rem;
}

.appointment-embed-page .ms-section-intro .ms-eyebrow {
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 0.8rem;
    color: var(--ms-accent, #f59e0b);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.appointment-embed-page .ms-section-intro h2 {
    font-size: clamp(1.35rem, 3vw, 1.85rem);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.appointment-embed-page .ms-section-intro p {
    color: #6b7280;
    margin-bottom: 0;
}

.appointment-embed-page .doctor-booking-card {
    border-radius: var(--ap-card-radius);
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.appointment-embed-page .doctor-booking-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.08) !important;
}

/* Doctor photo — fixed size, overrides layout global img rules */
.appointment-embed-page .appointment-doctor-photo-wrap {
    width: var(--ap-doctor-photo-size);
    height: var(--ap-doctor-photo-size);
    min-width: var(--ap-doctor-photo-size);
    min-height: var(--ap-doctor-photo-size);
    flex-shrink: 0;
    padding: 0;
    border: 0;
    background: transparent;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.appointment-embed-page .appointment-doctor-photo-wrap:hover {
    opacity: 0.92;
}

.appointment-embed-page .appointment-doctor-photo-wrap:focus-visible {
    outline: 2px solid var(--ms-primary);
    outline-offset: 2px;
}

.appointment-embed-page .appointment-doctor-photo,
.appointment-embed-page .appointment-doctor-photo-wrap img {
    width: var(--ap-doctor-photo-size) !important;
    height: var(--ap-doctor-photo-size) !important;
    max-width: var(--ap-doctor-photo-size) !important;
    max-height: var(--ap-doctor-photo-size) !important;
    min-width: var(--ap-doctor-photo-size);
    min-height: var(--ap-doctor-photo-size);
    object-fit: cover;
    object-position: center top;
    border-radius: 10px;
    display: block;
}

.appointment-embed-page .appointment-doctor-photo-placeholder {
    width: var(--ap-doctor-photo-size);
    height: var(--ap-doctor-photo-size);
    border-radius: 10px;
    background: linear-gradient(135deg, var(--ms-primary), #10b981);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* Card layout doctor avatar (profile cards layout) */
.appointment-embed-page .ms-doctor-avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ms-primary), #10b981);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 auto;
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.appointment-embed-page .ms-doctor-avatar .appointment-doctor-photo-wrap,
.appointment-embed-page .ms-doctor-avatar .appointment-doctor-photo,
.appointment-embed-page .ms-doctor-avatar .appointment-doctor-photo-placeholder {
    width: 88px !important;
    height: 88px !important;
    max-width: 88px !important;
    max-height: 88px !important;
    min-width: 88px;
    min-height: 88px;
    font-size: 1.75rem;
}

.appointment-embed-page .ms-doctor-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.appointment-embed-page .ms-doctor-card {
    background: #fff;
    border-radius: var(--ap-card-radius);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    height: 100%;
}

/* Portrait profile cards (cards / oncall) */
.appointment-embed-page .ms-doctor-portrait-card {
    position: relative;
    height: 100%;
    padding-bottom: 0.35rem;
    transition: transform 0.2s ease;
}
.appointment-embed-page .ms-doctor-portrait-card:hover {
    transform: translateY(-4px);
}
.appointment-embed-page .ms-doctor-portrait-media {
    position: relative;
    border-radius: 18px 18px 0 0;
    overflow: hidden;
    aspect-ratio: 3 / 4;
    background: linear-gradient(160deg, #dbeafe 0%, #93c5fd 45%, #64748b 100%);
}
.appointment-embed-page .ms-doctor-portrait-photo-btn {
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0;
    width: 100%;
    height: 100%;
    display: block;
    cursor: pointer;
}
.appointment-embed-page .ms-doctor-portrait-img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover;
    object-position: center top;
}
.appointment-embed-page .ms-doctor-portrait-fallback {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: clamp(2rem, 6vw, 2.75rem);
    font-weight: 700;
    letter-spacing: 0.04em;
    background: linear-gradient(135deg, var(--ms-primary), #0ea5e9);
}
.appointment-embed-page .ms-doctor-portrait-body {
    position: relative;
    z-index: 1;
    width: calc(100% - 1.25rem);
    margin: -2.75rem auto 0;
    padding: 1.1rem 0.85rem 1rem;
    text-align: center;
    background: #eef5fb;
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}
.appointment-embed-page .ms-doctor-portrait-name {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.25;
    color: #0f172a;
}
.appointment-embed-page .ms-doctor-portrait-spec {
    margin: 0 0 0.85rem;
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.35;
    color: #64748b;
}
.appointment-embed-page .ms-doctor-portrait-profile-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.4rem 0.9rem;
    border-radius: 8px;
    background: #fff;
    color: #2563eb;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
    transition: transform 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}
.appointment-embed-page .ms-doctor-portrait-profile-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.18);
    color: #1d4ed8;
}

/* Calendar + slots */
.appointment-embed-page .calendar-dates {
    scrollbar-width: thin;
}

.appointment-embed-page .calendar-dates::-webkit-scrollbar {
    height: 4px;
}

.appointment-embed-page .calendar-dates::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.appointment-embed-page .date-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 62px;
    padding: 8px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    color: #374151;
}

.appointment-embed-page .date-btn:hover {
    border-color: #10b981;
    color: #10b981;
    background: #f0fdf4;
}

.appointment-embed-page .date-btn.active {
    border-color: #10b981;
    background: #10b981;
    color: #fff;
}

.appointment-embed-page .date-btn.active .date-day,
.appointment-embed-page .date-btn.active .date-num,
.appointment-embed-page .date-btn.active .date-month {
    color: #fff;
}

.appointment-embed-page .date-btn .date-day {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.appointment-embed-page .date-btn .date-num {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.2;
}

.appointment-embed-page .date-btn .date-month {
    font-size: 0.65rem;
    opacity: 0.8;
}

.appointment-embed-page .slot-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 20px;
    background: #fff;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    color: #374151;
}

.appointment-embed-page .slot-chip:hover:not(:disabled) {
    border-color: #10b981;
    color: #10b981;
    background: #f0fdf4;
}

.appointment-embed-page .slot-chip.selected {
    border-color: #10b981;
    background: #10b981;
    color: #fff;
}

.appointment-embed-page .slot-chip.booked {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
    text-decoration: line-through;
    border-color: #f3f4f6;
}

.appointment-embed-page .slots-area {
    border-top: 1px solid #f3f4f6;
    padding-top: 1rem;
}

.appointment-embed-page .slots-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* ── Modals (rendered inside appointment page context) ──────── */
.appointment-embed-page ~ .modal .doctor-avatar-sm,
#bookingModal .doctor-avatar-sm {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ms-primary), #10b981);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

#bookingModal .booking-summary {
    border-left: 4px solid var(--ms-primary);
}

/* Lightbox */
.doctor-profile-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1065;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

.doctor-profile-lightbox.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.doctor-profile-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(11, 20, 26, 0.94);
}

.doctor-profile-lightbox__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    font-weight: 700;
    cursor: pointer;
}

.doctor-profile-lightbox__photo {
    max-width: min(304px, 90vw);
    max-height: min(436px, 80vh);
    object-fit: contain;
    border-radius: 12px;
}

/* ── Instant booking modal helpers ────────────────────────── */
.instant-doc-header img,
.instant-doc-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.instant-doc-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--ms-primary), #10b981);
    color: #fff;
    font-weight: 700;
}

.instant-day-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}

.instant-day-tab {
    flex: 1;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.55rem 0.5rem;
    background: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
}

.instant-day-tab.active {
    border-color: var(--ms-primary);
    background: #eff6ff;
    color: var(--ms-primary);
}

.instant-doctor-pick {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 0.45rem;
    cursor: pointer;
    background: #fff;
    width: 100%;
    text-align: left;
}

.instant-doctor-pick:hover {
    border-color: var(--ms-primary);
    background: #f8fafc;
}

.instant-doctor-pick img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

@media (max-width: 767.98px) {
    .appointment-embed-page {
        --ap-doctor-photo-size: 52px;
        --ap-section-pad-y: 0.75rem;
    }

    .appointment-embed-page .ms-hero-booking-panel {
        padding: 1rem;
    }
}
