:root {
    --teal-950: #043a42;
    --teal-900: #085a63;
    --teal-800: #0a6b75;
    --teal-700: #0d7a86;
    --teal-600: #0d9488;
    --teal-500: #14b8a6;
    --teal-100: #ccfbf1;
    --slate-900: #0f172a;
    --slate-700: #334155;
    --slate-500: #64748b;
    --slate-200: #e2e8f0;
    --page-bg: #eef3f6;
    --white: #ffffff;
    --shadow: 0 14px 40px rgba(8, 90, 99, 0.16);
    --shadow-soft: 0 8px 28px rgba(15, 23, 42, 0.07);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.14);
    --radius: 1.25rem;
    --accent: #0d7a86;
    --font: 'Cairo', system-ui, sans-serif;
}

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

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font);
}

body {
    background: var(--page-bg);
    color: var(--slate-900);
    -webkit-font-smoothing: antialiased;
}

input, button, select, textarea {
    font-family: var(--font);
}

.app-shell {
    min-height: 100dvh;
    max-width: 480px;
    margin: 0 auto;
    background: var(--page-bg);
    position: relative;
    overflow-x: hidden;
}

.hidden { display: none !important; }

.toast {
    position: fixed;
    top: 1rem;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    z-index: 300;
    background: var(--slate-900);
    color: #fff;
    padding: .8rem 1.15rem;
    border-radius: 999px;
    font-size: .85rem;
    font-weight: 700;
    box-shadow: var(--shadow-lg);
    max-width: min(22rem, calc(100% - 2rem));
    width: max-content;
    text-align: center;
    pointer-events: none;
}

.loading-screen {
    display: grid;
    place-items: center;
    min-height: 60vh;
    color: var(--slate-500);
    font-weight: 700;
}

/* ═══════════════════════════════════════
   HERO — مطابق للتصميم المرجعي
   ═══════════════════════════════════════ */
.hero {
    position: relative;
    color: #fff;
    padding: 1rem 1rem 0;
    overflow: visible;
    min-height: 21.5rem;
    z-index: 2;
}

.hero-bg-clip {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.hero-bg {
    position: absolute;
    inset: -32px;
    background-size: cover;
    background-position: center;
    filter: blur(0px) saturate(1.1);
    transform: scale(1.1);
}

.hero-bg--fallback {
    inset: 0;
    transform: none;
    filter: none;
    background: linear-gradient(160deg, var(--teal-700) 0%, var(--teal-900) 50%, var(--teal-950) 100%);
}

.hero-content {
    position: relative;
    z-index: 1;
    padding-bottom: 4.5rem;
}

/* شريط علوي: لوجو العيادة يمين + سوشيال يسار (RTL) */
.hero-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .25rem;
}

.clinic-brand-card {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: .85rem;
    padding: .45rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.clinic-brand-card img {
    width: 2.4rem;
    height: 2.4rem;
    object-fit: contain;
}

.clinic-brand-icon {
    width: 2.4rem;
    height: 2.4rem;
    display: grid;
    place-items: center;
    font-size: 1.35rem;
    color: var(--teal-800);
}

.social-row {
    display: flex;
    gap: .45rem;
    flex-wrap: wrap;
    align-items: center;
    padding-top: .15rem;
}

.social-btn {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    font-size: .72rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    transition: transform 0.15s ease;
}

.social-btn:active { transform: scale(0.92); }

/* صورة الدكتور في الوسط */
.hero-profile {
    text-align: center;
    margin-top: .65rem;
}

.avatar-ring {
    width: 6.75rem;
    height: 6.75rem;
    margin: 0 auto;
    border-radius: 999px;
    padding: .22rem;
    background: rgba(255, 255, 255, 0.35);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

.avatar-ring img,
.avatar-ring .avatar-fallback {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    object-fit: cover;
    background: #e2e8f0;
    display: grid;
    place-items: center;
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--teal-800);
    border: 3px solid #fff;
}

.hero-profile h1 {
    margin: .75rem 0 .15rem;
    font-size: 1.28rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.hero-profile .title {
    display: inline-block;
    margin: .35rem auto 0;
    padding: .32rem .9rem;
    max-width: 18rem;
    font-size: .88rem;
    font-weight: 700;
    line-height: 1.55;
    color: #fff;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.experience-pill {
    display: inline-flex;
    margin-top: .55rem;
    padding: .38rem .95rem;
    border-radius: 999px;
    background: rgba(4, 58, 66, 0.55);
    border: 1.5px solid rgba(255, 255, 255, 0.28);
    font-size: .7rem;
    font-weight: 700;
    backdrop-filter: blur(6px);
}

/* منحنى أبيض سفلي للهيرو */
.hero-curve {
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 130%;
    height: 3.25rem;
    background: var(--page-bg);
    border-radius: 50% 50% 0 0;
    z-index: 4;
}

/* محتوى الصفحة */
.body-wrap {
    position: relative;
    z-index: 5;
    margin-top: -2.75rem;
    padding: 0 .9rem 2.5rem;
}

.body-wrap > .closed-banner {
    margin-bottom: 0;
}

.body-wrap > .closed-banner + .card {
    margin-top: .65rem;
}

.card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    padding: 1rem;
    margin-bottom: .85rem;
}

.featured-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: .85rem;
    align-items: center;
    background: linear-gradient(135deg, #f0fafb 0%, #e8f6f8 100%);
    border: 1px solid rgba(13, 122, 134, 0.1);
    position: relative;
    overflow: hidden;
}

.pill {
    display: inline-block;
    padding: .18rem .55rem;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-size: .64rem;
    font-weight: 800;
    margin-bottom: .35rem;
}

.featured-card h3 {
    margin: 0 0 .22rem;
    font-size: .95rem;
    font-weight: 800;
}

.featured-card p {
    margin: 0;
    font-size: .72rem;
    color: var(--slate-500);
    line-height: 1.5;
    font-weight: 600;
}

.price-tag {
    font-size: 1rem;
    font-weight: 800;
    color: var(--accent);
    margin-top: .3rem;
}

.featured-icon {
    width: 4.25rem;
    height: 4.25rem;
    border-radius: 1rem;
    background: linear-gradient(145deg, #dff5f7, #b8ecef);
    display: grid;
    place-items: center;
    font-size: 2rem;
    flex-shrink: 0;
}

/* شريط البحث + زر الحجز جنباً إلى جنب */
.search-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: .55rem;
    margin-bottom: .85rem;
    align-items: stretch;
}

.search-box {
    display: flex;
    align-items: center;
    gap: .45rem;
    background: #fff;
    border: 1px solid var(--slate-200);
    border-radius: 999px;
    padding: .6rem .9rem;
    box-shadow: var(--shadow-soft);
    min-width: 0;
}

.search-box input {
    border: 0;
    outline: 0;
    flex: 1;
    min-width: 0;
    font: inherit;
    font-weight: 600;
    font-size: .82rem;
    background: transparent;
}

.btn-book-inline {
    border: 0;
    border-radius: 999px;
    padding: .65rem .85rem;
    font-family: var(--font);
    font-weight: 800;
    font-size: .72rem;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--teal-900));
    box-shadow: 0 8px 20px rgba(8, 90, 99, 0.28);
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: .3rem;
}

.btn-primary {
    width: 100%;
    border: 0;
    border-radius: 999px;
    padding: .9rem 1rem;
    font-family: var(--font);
    font-weight: 800;
    font-size: .92rem;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--teal-900));
    box-shadow: 0 10px 24px rgba(8, 90, 99, 0.25);
    cursor: pointer;
}

.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }

.pay-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: .55rem;
}

.pay-method {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .7rem .8rem;
    border: 1.5px solid var(--slate-200);
    border-radius: 14px;
    background: #fff;
    font-family: var(--font);
    font-weight: 700;
    font-size: .82rem;
    color: var(--slate-700, #334155);
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, background .15s;
}

.pay-method__icon { font-size: 1.15rem; line-height: 1; }
.pay-method__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pay-method.is-active {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 9%, #fff);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}

.pay-amount {
    margin: .7rem 0 0;
    font-size: .85rem;
    color: #475569;
}

.pay-amount strong { color: var(--accent); }

.btn-secondary {
    border: 1px solid var(--slate-200);
    background: #fff;
    color: var(--slate-900);
    border-radius: 999px;
    padding: .85rem 1rem;
    font-family: var(--font);
    font-weight: 700;
    cursor: pointer;
}

.section-title {
    margin: .85rem 0 .55rem;
    font-size: .92rem;
    font-weight: 800;
}

.services-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .6rem;
}

.service-tile {
    border: 0;
    background: #fff;
    border-radius: 1rem;
    padding: .8rem .75rem;
    text-align: start;
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: .15rem .4rem;
    align-items: start;
    transition: transform 0.15s ease;
}

.service-tile:active { transform: scale(0.97); }

.service-tile .icon {
    grid-row: 1 / 3;
    grid-column: 2;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: .7rem;
    display: grid;
    place-items: center;
    font-size: 1rem;
    align-self: center;
}

.service-tile h4 {
    margin: 0;
    font-size: .78rem;
    font-weight: 800;
    grid-column: 1;
}

.service-tile p {
    margin: 0;
    font-size: .62rem;
    color: var(--slate-500);
    line-height: 1.35;
    font-weight: 600;
    grid-column: 1;
}

.service-tile .arrow {
    display: none;
}

/* لوحة الحجز السريع */
.phone-panel {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.96) 0%, rgba(232, 247, 248, 0.98) 100%);
    border: 1px solid rgba(13, 122, 134, 0.14);
    border-radius: 1.35rem;
    padding: 1.15rem 1.1rem 1.05rem;
    margin-top: 1rem;
    margin-bottom: .85rem;
    box-shadow: var(--shadow-soft);
}

.phone-panel::before {
    content: '';
    position: absolute;
    inset-inline-end: -2rem;
    top: -2.5rem;
    width: 7rem;
    height: 7rem;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(13, 122, 134, 0.12), transparent 70%);
    pointer-events: none;
}

.phone-panel-head {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: .85rem;
    margin-bottom: 1rem;
}

.phone-panel-visual {
    position: relative;
    width: 3.75rem;
    height: 3.75rem;
    flex-shrink: 0;
    border-radius: 1.1rem;
    background: linear-gradient(145deg, var(--accent), var(--teal-900));
    display: grid;
    place-items: center;
    box-shadow: 0 10px 22px rgba(8, 90, 99, 0.28);
}

.phone-panel-icon {
    color: #fff;
    font-size: 1.35rem;
    line-height: 1;
}

.phone-panel-shield {
    position: absolute;
    inset-inline-start: -.35rem;
    bottom: -.3rem;
    width: 1.55rem;
    height: 1.55rem;
    border-radius: 999px;
    background: #fff;
    color: #16a34a;
    display: grid;
    place-items: center;
    font-size: .7rem;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
    border: 2px solid #e8f7f8;
}

.phone-panel-intro {
    min-width: 0;
}

.phone-panel h3 {
    margin: 0 0 .25rem;
    font-size: .95rem;
    font-weight: 800;
    color: var(--slate-900);
    line-height: 1.35;
}

.phone-panel .subtitle {
    margin: 0;
    font-size: .72rem;
    color: var(--slate-500);
    font-weight: 600;
    line-height: 1.55;
}

.phone-panel-body {
    position: relative;
    z-index: 1;
    min-width: 0;
}

.phone-label {
    display: block;
    margin-bottom: .4rem;
    font-size: .74rem;
    font-weight: 800;
    color: var(--slate-700);
}

.phone-input-row {
    display: flex;
    align-items: stretch;
    direction: ltr;
    margin-bottom: .8rem;
    border: 1.5px solid rgba(13, 122, 134, 0.18);
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
    overflow: hidden;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.phone-input-row:focus-within {
    border-color: color-mix(in srgb, var(--accent) 60%, #fff);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent);
}

.phone-prefix {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: 0 .9rem;
    font-weight: 800;
    font-size: .88rem;
    color: var(--accent);
    letter-spacing: .3px;
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--accent) 9%, #fff),
        color-mix(in srgb, var(--accent) 4%, #fff));
    border-inline-end: 1.5px solid rgba(13, 122, 134, 0.14);
    user-select: none;
}

.phone-prefix::before {
    content: "🇮🇶";
    font-size: 1.05rem;
    line-height: 1;
}

.phone-field {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: 0 .95rem;
    background: transparent;
}

.phone-field i {
    color: color-mix(in srgb, var(--accent) 55%, #94a3b8);
    font-size: .85rem;
}

.phone-field input {
    width: 100%;
    border: 0;
    outline: 0;
    padding: .85rem 0;
    font-family: var(--font);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: .5px;
    background: transparent;
    color: var(--slate-900);
}

.phone-field input::placeholder {
    color: #b0bccb;
    font-weight: 600;
    letter-spacing: normal;
}

.phone-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
}

.phone-submit i {
    font-size: .75rem;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    border: 1px solid var(--slate-200);
    border-radius: .75rem;
    padding: .7rem .8rem;
    font-family: var(--font);
    font-weight: 600;
    font-size: .85rem;
    background: #fff;
}

.secure-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    margin: .7rem 0 0;
    font-size: .68rem;
    color: var(--slate-500);
    font-weight: 700;
}

.secure-note i {
    color: #16a34a;
    font-size: .7rem;
}

.dual-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .7rem;
    margin: 1rem 0;
}

.action-chip {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .85rem .8rem;
    border-radius: 1.15rem;
    border: 1px solid transparent;
    background: #fff;
    text-decoration: none;
    color: var(--slate-900);
    box-shadow: var(--shadow-soft);
    transition: transform .15s ease, box-shadow .15s ease;
}

.action-chip:active {
    transform: scale(0.98);
}

.action-chip-icon {
    width: 2.55rem;
    height: 2.55rem;
    border-radius: .9rem;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    font-size: 1.05rem;
    color: #fff;
}

.action-chip-text {
    display: flex;
    flex-direction: column;
    gap: .12rem;
    min-width: 0;
}

.action-chip-text strong {
    font-size: .78rem;
    font-weight: 800;
    line-height: 1.3;
}

.action-chip-text small {
    font-size: .62rem;
    font-weight: 600;
    color: var(--slate-500);
}

.action-chip--call {
    border-color: rgba(14, 165, 233, 0.18);
    background: linear-gradient(145deg, #ffffff 0%, #f0f9ff 100%);
}

.action-chip--call .action-chip-icon {
    background: linear-gradient(145deg, #0ea5e9, #0284c7);
    box-shadow: 0 8px 18px rgba(14, 165, 233, 0.3);
}

.action-chip--whatsapp {
    border-color: rgba(34, 197, 94, 0.18);
    background: linear-gradient(145deg, #ffffff 0%, #f0fdf4 100%);
}

.action-chip--whatsapp .action-chip-icon {
    background: linear-gradient(145deg, #22c55e, #16a34a);
    box-shadow: 0 8px 18px rgba(34, 197, 94, 0.3);
}

.info-panel {
    background: #fff;
    border-radius: 1.25rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(226, 232, 240, 0.95);
    overflow: hidden;
}

.info-row {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: 1rem 1rem;
    text-decoration: none;
    color: inherit;
    background: #fff;
}

.info-row + .info-row {
    border-top: 1px solid #f1f5f9;
}

a.info-row:active {
    background: #f8fafc;
}

.info-row-icon {
    width: 2.65rem;
    height: 2.65rem;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.info-row--location .info-row-icon {
    color: #e11d48;
    background: #ffe4e6;
}

.info-row--hours .info-row-icon {
    color: var(--accent);
    background: #ccfbf1;
}

.info-row-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .18rem;
}

.info-row-body strong {
    font-size: .82rem;
    font-weight: 800;
    color: var(--slate-900);
}

.info-row-body span {
    font-size: .74rem;
    font-weight: 600;
    color: var(--slate-700);
    line-height: 1.45;
}

.info-row-body em {
    font-style: normal;
    font-size: .66rem;
    font-weight: 600;
    color: var(--slate-500);
    line-height: 1.4;
}

.info-row-arrow {
    color: #94a3b8;
    font-size: .72rem;
    flex-shrink: 0;
}

.booking-list { display: grid; gap: .65rem; }

.booking-item {
    border: 1px solid var(--slate-200);
    border-radius: 1rem;
    padding: .85rem;
    background: #fff;
}

.booking-item h4 {
    margin: 0 0 .25rem;
    font-size: .9rem;
    font-weight: 800;
}

.booking-item .meta {
    font-size: .74rem;
    color: var(--slate-500);
    line-height: 1.5;
    font-weight: 600;
}

.status-badge {
    display: inline-block;
    padding: .15rem .5rem;
    border-radius: 999px;
    font-size: .66rem;
    font-weight: 800;
    background: #e0f2fe;
    color: #0369a1;
}

.status-badge--pending { background: #fef3c7; color: #b45309; }
.status-badge--confirmed { background: #dcfce7; color: #15803d; }
.status-badge--completed { background: #e0e7ff; color: #4338ca; }
.status-badge--cancelled,
.status-badge--no_show { background: #fee2e2; color: #b91c1c; }

.booking-actions {
    display: flex;
    gap: .5rem;
    margin-top: .7rem;
    padding-top: .7rem;
    border-top: 1px dashed var(--slate-200);
}

.booking-action {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    padding: .55rem .5rem;
    border-radius: .75rem;
    font-family: var(--font);
    font-size: .78rem;
    font-weight: 800;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.booking-action i { font-size: .78rem; }

.booking-action--edit {
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, #fff);
    border-color: color-mix(in srgb, var(--accent) 22%, #fff);
}

.booking-action--edit:hover {
    background: color-mix(in srgb, var(--accent) 16%, #fff);
}

.booking-action--cancel {
    color: #b91c1c;
    background: #fef2f2;
    border-color: #fecaca;
}

.booking-action--cancel:hover {
    background: #fee2e2;
}

.form-field { margin-bottom: .75rem; }

.form-field label {
    display: block;
    font-size: .78rem;
    font-weight: 700;
    margin-bottom: .35rem;
}

.page-head {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .85rem;
}

.back-btn {
    border: 0;
    background: #fff;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--slate-900);
    position: relative;
    z-index: 6;
}

.page-head h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
}

.empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--slate-500);
    font-size: .84rem;
    font-weight: 600;
}

.closed-banner {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
    border-radius: 1rem;
    padding: .75rem .9rem;
    font-size: .76rem;
    font-weight: 700;
}

/* ── Clinic page background (like menu) ── */
.menu-bg-layer {
    position: fixed;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.08;
    pointer-events: none;
    z-index: 0;
}

.app-shell.has-menu-bg {
    background: var(--page-bg);
}

.app-shell.has-menu-bg #view {
    position: relative;
    z-index: 1;
}

@media (min-width: 481px) {
    body {
        padding: 20px 0;
    }

    .app-shell {
        border-radius: 24px;
        box-shadow: var(--shadow-lg);
        min-height: calc(100vh - 40px);
        overflow: hidden;
    }
}
