/* ================= Tokens ================= */
:root {
  --primary: #0e9f9a;
  --primary-dark: #0b7f7b;
  --primary-soft: #e6f6f5;
  --accent: #ff8a4c;
  --accent-dark: #f0722f;
  /* RGB parts so colours can be used with transparency: rgba(var(--primary-rgb), .2) */
  --primary-rgb: 14, 159, 154;
  --accent-rgb: 255, 138, 76;
  --ink: #1d2b3a;
  --muted: #6b7a8c;
  --soft-bg: #f5f8fa;
  --border: #e3e9ee;
  --danger: #e5484d;
  --whatsapp: #25d366;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 2px 10px rgba(29, 43, 58, .06);
  --shadow: 0 10px 30px rgba(29, 43, 58, .08);
  --shadow-lg: 0 18px 40px rgba(var(--primary-rgb), .18);
}

/* ================= Base ================= */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
}
body {
  font-family: 'Tajawal', sans-serif;
  color: var(--ink);
  background: #fff;
  overflow-x: hidden;
}
a { color: var(--primary); }
.text-primary-clinic { color: var(--primary); }
.bg-soft { background: var(--soft-bg); }

.section { padding: 64px 0; }
.section-head { max-width: 640px; margin: 0 auto 40px; }
.section-tag {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 50px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  font-size: .85rem;
  margin-bottom: 12px;
}
.section-title { font-weight: 800; font-size: 1.6rem; margin-bottom: 10px; }
.section-subtitle { color: var(--muted); margin: 0; }

/* ================= Buttons ================= */
.btn { border-radius: 12px; font-weight: 700; transition: all .2s ease; }
.btn-lg { padding: .8rem 1.5rem; font-size: 1.05rem; }

.btn-accent { background: var(--accent); color: #fff; border: none; box-shadow: 0 6px 16px rgba(var(--accent-rgb), .3); }
.btn-accent:hover, .btn-accent:focus { background: var(--accent-dark); color: #fff; transform: translateY(-2px); }

.btn-primary-clinic { background: var(--primary); color: #fff; border: none; }
.btn-primary-clinic:hover, .btn-primary-clinic:focus { background: var(--primary-dark); color: #fff; }
.btn-primary-clinic:disabled { background: #b8d9d8; color: #fff; }

.btn-outline-clinic { border: 2px solid var(--primary); color: var(--primary); background: transparent; }
.btn-outline-clinic:hover { background: var(--primary); color: #fff; }

.btn-whatsapp { background: var(--whatsapp); color: #fff; padding: .75rem; }
.btn-whatsapp:hover { background: #1ebe5a; color: #fff; }

.btn:focus-visible, .form-control:focus, .cal-day:focus-visible, .slot:focus-visible {
  outline: none;
  box-shadow: 0 0 0 .25rem rgba(var(--primary-rgb), .25);
}

/* ================= Navbar ================= */
#mainNav {
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(8px);
  padding: .75rem 0;
  transition: box-shadow .3s, padding .3s;
}
#mainNav.scrolled { box-shadow: var(--shadow-sm); padding: .5rem 0; }
.logo-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: var(--primary);
  color: #fff;
  font-size: 1.2rem;
}
.logo-text { font-size: 1.25rem; color: var(--ink); }
.footer .logo-text { color: #fff; }
.logo-text strong { color: var(--primary); }
#mainNav .nav-link {
  color: var(--ink);
  font-weight: 500;
  padding: .6rem 1rem;
  border-radius: 10px;
}
#mainNav .nav-link:hover { color: var(--primary); background: var(--primary-soft); }
#mainNav .nav-link.active { color: var(--primary); font-weight: 700; }
.navbar-toggler { color: var(--ink); }

@media (max-width: 991.98px) {
  #navMenu { padding-top: .5rem; }
  #navMenu .btn { width: 100%; }
}

/* ================= Hero ================= */
.hero {
  padding: 110px 0 48px;
  background: linear-gradient(180deg, var(--primary-soft) 0%, #fff 100%);
}
.hero-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  border-radius: 50px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  color: var(--primary);
  font-weight: 700; font-size: .9rem;
  margin-bottom: 18px;
}
.hero-title { font-size: 2.3rem; font-weight: 800; line-height: 1.3; margin-bottom: 16px; }
.hero-subtitle { color: var(--muted); font-size: 1.05rem; line-height: 1.9; margin-bottom: 28px; }

.hero-visual { position: relative; max-width: 480px; margin: 0 auto; }
.hero-blob {
  position: absolute; inset: 8% 4% -4% 4%;
  background: var(--primary);
  opacity: .12;
  border-radius: 42% 58% 55% 45% / 45% 45% 55% 55%;
}
.hero-img {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 4.2;
  object-fit: cover;
  border-radius: 28px;
  box-shadow: var(--shadow);
}
.img-fallback {
  background: linear-gradient(135deg, var(--primary-soft), rgba(var(--primary-rgb), .25));
  color: transparent;
}
.float-card {
  position: absolute;
  display: flex; align-items: center; gap: 10px;
  background: #fff;
  padding: 10px 14px;
  border-radius: 14px;
  box-shadow: var(--shadow);
  font-size: .85rem;
  animation: float 4s ease-in-out infinite;
}
.float-card-top { top: 18px; inset-inline-start: -8px; }
.float-card-bottom { bottom: 22px; inset-inline-end: -8px; animation-delay: 1.5s; }
.float-card .bi-star-fill { font-size: 1.4rem; }
.dot-online {
  width: 12px; height: 12px; border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, .2);
}
@keyframes float { 50% { transform: translateY(-8px); } }

.trust-row { margin-top: 36px; }
.trust-badge {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 8px;
  text-align: center;
  height: 100%;
  transition: transform .2s, box-shadow .2s;
}
.trust-badge:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.trust-badge i { color: var(--primary); font-size: 1.5rem; }
.trust-badge div { font-weight: 800; font-size: 1.3rem; }
.trust-badge small { color: var(--muted); }

/* ================= Booking card & stepper ================= */
.booking-card {
  background: #fff;
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 20px 16px;
}
.stepper {
  list-style: none;
  display: flex;
  justify-content: space-between;
  padding: 0;
  margin: 0 0 12px;
}
.step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; }
.step-circle {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--soft-bg);
  border: 2px solid var(--border);
  color: var(--muted);
  font-size: 1.05rem;
  transition: all .3s;
  position: relative; z-index: 1;
}
.step-label { font-size: .75rem; color: var(--muted); font-weight: 500; }
.step.active .step-circle { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 0 0 5px var(--primary-soft); }
.step.active .step-label { color: var(--primary); font-weight: 700; }
.step.done .step-circle { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); cursor: pointer; }
.step.done .step-label { color: var(--ink); }
.progress-thin { height: 6px; border-radius: 10px; background: var(--soft-bg); }
.progress-thin .progress-bar { background: var(--primary); transition: width .4s ease; }

.panel-title { font-weight: 800; font-size: 1.2rem; margin-bottom: 18px; }
.step-panel { animation: fadeIn .35s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.step-actions {
  display: flex; justify-content: space-between; gap: 10px;
  margin-top: 28px; padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* Doctor cards */
.doctor-card {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  height: 100%;
  display: flex; flex-direction: column;
  transition: all .25s;
  background: #fff;
}
.doctor-card:hover { border-color: var(--primary); transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.doctor-card.selected { border-color: var(--primary); background: var(--primary-soft); }
.doctor-photo {
  width: 88px; height: 88px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 12px;
  border: 4px solid var(--primary-soft);
  background: var(--primary-soft);
}
.doctor-card h5 { font-weight: 800; font-size: 1.05rem; margin-bottom: 4px; }
.doctor-spec {
  display: inline-block;
  color: var(--primary);
  font-weight: 700; font-size: .85rem;
  margin-bottom: 8px;
}
.doctor-bio { color: var(--muted); font-size: .88rem; line-height: 1.7; flex-grow: 1; }
.doctor-meta { font-size: .8rem; color: var(--muted); margin-bottom: 12px; }
.doctor-meta i { color: #f5b301; }

/* Calendar */
.calendar {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.calendar-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.calendar-head strong { font-size: 1.05rem; }
.cal-nav {
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  transition: all .2s;
}
.cal-nav:hover:not(:disabled) { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
.cal-nav:disabled { opacity: .35; cursor: not-allowed; }
.calendar-weekdays, .calendar-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.calendar-weekdays span { text-align: center; font-size: .72rem; color: var(--muted); font-weight: 700; padding: 4px 0; }
.cal-day {
  aspect-ratio: 1;
  border: none;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--ink);
  font-weight: 700;
  font-size: .95rem;
  transition: all .15s;
}
.cal-day:hover:not(:disabled) { background: var(--primary); color: #fff; transform: scale(1.06); }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--primary); }
.cal-day.selected { background: var(--primary); color: #fff; box-shadow: 0 6px 14px rgba(var(--primary-rgb), .35); }
.cal-day:disabled { background: transparent; color: #c3ccd5; text-decoration: line-through; cursor: not-allowed; }
.cal-day.empty { visibility: hidden; }

.calendar-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 14px; font-size: .8rem; color: var(--muted); }
.legend-dot { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: middle; margin-inline-end: 4px; }
.legend-dot.available { background: var(--primary-soft); border: 1px solid var(--primary); }
.legend-dot.selected { background: var(--primary); }
.legend-dot.disabled { background: #e9edf1; }

.side-summary {
  background: var(--soft-bg);
  border-radius: var(--radius);
  padding: 18px;
}
.mini-doctor { display: flex; align-items: center; gap: 12px; }
.mini-doctor img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: var(--primary-soft); }
.side-summary .info-line { display: flex; gap: 8px; align-items: center; margin-top: 12px; font-size: .9rem; color: var(--muted); }
.side-summary .info-line i { color: var(--primary); }

/* Time slots */
.slots-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.slot-group-title { font-weight: 700; font-size: .9rem; color: var(--muted); margin: 18px 0 10px; }
.slot-group-title:first-child { margin-top: 0; }
.slot {
  border: 1.5px solid var(--border);
  background: #fff;
  border-radius: 50px;
  padding: 10px 6px;
  font-weight: 700;
  font-size: .9rem;
  color: var(--ink);
  transition: all .15s;
}
.slot:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.slot.selected { background: var(--primary); border-color: var(--primary); color: #fff; }
.slot:disabled { background: #eef1f4; border-color: #eef1f4; color: #aab4be; text-decoration: line-through; cursor: not-allowed; }

.slot-skeleton {
  height: 44px;
  border-radius: 50px;
  background: linear-gradient(90deg, #eef1f4 25%, #f7f9fa 50%, #eef1f4 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.empty-state {
  text-align: center;
  padding: 36px 16px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
}
.empty-state i { font-size: 2.6rem; color: #c3ccd5; }
.empty-state h6 { color: var(--ink); font-weight: 800; margin: 10px 0 6px; }

/* ================= Forms & validation ================= */
.form-label { font-weight: 700; font-size: .92rem; }
.form-control {
  border-radius: 12px;
  border: 1.5px solid var(--border);
  padding: .7rem 1rem;
  transition: border-color .2s, box-shadow .2s;
}
.form-control:focus { border-color: var(--primary); }
.form-control::placeholder { color: #aab4be; }
.input-icon { position: relative; }
.input-icon > i {
  position: absolute; top: 50%; inset-inline-start: 14px;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.input-icon .form-control { padding-inline-start: 2.6rem; }
.form-control.is-invalid {
  border-color: var(--danger);
  background-color: #fff6f6;
  background-image: none;
  padding-inline-end: 1rem;
  animation: shake .35s;
}
.form-control.is-invalid:focus { box-shadow: 0 0 0 .25rem rgba(229, 72, 77, .15); }
.form-control.is-valid { border-color: #22c55e; background-image: none; }
.input-icon:has(.is-invalid) > i { color: var(--danger); }
.invalid-feedback { font-weight: 500; }
.invalid-feedback::before { content: "\F33A"; font-family: 'bootstrap-icons'; margin-inline-end: 4px; }
.is-invalid ~ .invalid-feedback, .invalid-feedback.show { display: block; }
@keyframes shake {
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* ================= Confirmation ================= */
.success-icon {
  width: 84px; height: 84px;
  margin: 0 auto;
  border-radius: 50%;
  display: grid; place-items: center;
  background: #22c55e;
  color: #fff;
  font-size: 2.6rem;
  box-shadow: 0 0 0 10px rgba(34, 197, 94, .15);
  animation: pop .5s cubic-bezier(.3, 1.6, .5, 1);
}
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }
.summary-box {
  max-width: 520px;
  margin: 24px auto 0;
  background: var(--soft-bg);
  border-radius: var(--radius);
  padding: 6px 18px;
}
.summary-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--border); }
.summary-row:last-child { border-bottom: none; }
.summary-row span { color: var(--muted); }
.summary-row strong { text-align: end; }

/* ================= About ================= */
.about-img-wrap { position: relative; }
.about-img {
  width: 100%;
  aspect-ratio: 5 / 4;
  object-fit: cover;
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.about-badge {
  position: absolute;
  bottom: -18px; inset-inline-end: 18px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  padding: 14px 20px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.about-badge strong { display: block; font-size: 1.8rem; line-height: 1; }
.about-badge span { font-size: .85rem; }
.service-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  height: 100%;
  transition: all .2s;
}
.service-card:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); transform: translateY(-3px); }
.service-card h6 { font-weight: 800; margin: 0 0 2px; }
.service-card small { color: var(--muted); }
.service-icon {
  flex-shrink: 0;
  width: 48px; height: 48px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 1.35rem;
  transition: all .2s;
}
.service-card:hover .service-icon { background: var(--primary); color: #fff; }

/* ================= Contact ================= */
.map-placeholder {
  height: 220px;
  border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  color: var(--primary-dark);
  font-weight: 700;
  background-color: var(--primary-soft);
  background-image:
    linear-gradient(rgba(var(--primary-rgb), .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--primary-rgb), .08) 1px, transparent 1px);
  background-size: 28px 28px;
  border: 1px solid var(--border);
}
.map-pin { font-size: 2.6rem; color: var(--danger); animation: float 2.5s ease-in-out infinite; }
.info-card, .hours-card, .contact-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px;
  height: 100%;
}
.info-card { display: flex; gap: 12px; }
.info-card > i { font-size: 1.4rem; color: var(--primary); }
.info-card h6 { font-weight: 800; margin-bottom: 4px; }
.info-card p { margin: 0; color: var(--muted); font-size: .92rem; }
.info-card a { text-decoration: none; }
.hours-card { height: auto; }
.hours-table td { padding: .55rem 0; color: var(--muted); }
.hours-table td:last-child { text-align: end; color: var(--ink); font-weight: 700; }
.hours-table tr.today td { color: var(--primary); }
.hours-table tr.today td small { font-size: .8rem; }
.contact-card { padding: 24px; }

/* ================= Footer ================= */
.footer { background: #0f2230; color: rgba(255, 255, 255, .7); padding: 48px 0 20px; }
.footer-text { line-height: 1.9; max-width: 360px; }
.footer-title { color: #fff; font-weight: 800; margin-bottom: 14px; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: rgba(255, 255, 255, .7); text-decoration: none; transition: color .2s; }
.footer-links a:hover { color: var(--accent); }
.social { display: flex; flex-wrap: wrap; gap: 10px; }
.social a {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-size: 1.1rem;
  transition: all .2s;
}
.social a:hover { background: var(--primary); transform: translateY(-3px); }
.footer hr { border-color: rgba(255, 255, 255, .12); margin: 28px 0 16px; }
.copyright { text-align: center; font-size: .85rem; margin: 0; }

/* ================= Floating WhatsApp ================= */
.whatsapp-float {
  position: fixed;
  bottom: 20px; inset-inline-end: 20px; /* left in Arabic, right in English */
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--whatsapp);
  color: #fff;
  display: grid; place-items: center;
  font-size: 1.7rem;
  box-shadow: 0 8px 20px rgba(37, 211, 102, .45);
  z-index: 1030;
  text-decoration: none;
  animation: pulse 2.2s infinite;
}
.whatsapp-float:hover { color: #fff; transform: scale(1.08); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, .5); }
  70% { box-shadow: 0 0 0 14px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* ================= Tablet / Desktop ================= */
@media (min-width: 576px) {
  .slots-grid { grid-template-columns: repeat(4, 1fr); }
  .step-label { font-size: .85rem; }
}
@media (min-width: 768px) {
  .section { padding: 88px 0; }
  .section-title { font-size: 2rem; }
  .booking-card { padding: 32px; }
  .hero-title { font-size: 2.8rem; }
  .step-circle { width: 48px; height: 48px; font-size: 1.2rem; }
  .slots-grid { grid-template-columns: repeat(6, 1fr); }
  .trust-badge { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 18px; flex-wrap: wrap; }
  .trust-badge i { font-size: 1.9rem; }
}
@media (min-width: 992px) {
  .hero { padding: 140px 0 72px; }
  .hero-title { font-size: 3.4rem; }
  .booking-card { padding: 40px; }
  .map-placeholder { height: 260px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ================= Dynamic content states ================= */
.doctor-skeleton {
  min-height: 330px;
  border-color: transparent;
  background: linear-gradient(90deg, #eef1f4 25%, #f7f9fa 50%, #eef1f4 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}
.doctor-skeleton:hover { transform: none; box-shadow: none; }
.doctor-photo-fallback, .mini-fallback {
  display: grid; place-items: center;
  color: var(--primary);
  font-size: 2.2rem;
}
.mini-fallback {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--primary-soft);
  font-size: 1.5rem;
}
.about-text { white-space: pre-line; }
.map-placeholder.has-map { padding: 0; overflow: hidden; background: none; }
.map-placeholder.has-map iframe { width: 100%; height: 100%; border: 0; }

/* ================= Language switch & English (LTR) ================= */
.btn-lang {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--ink);
  border-radius: 10px;
  padding: .4rem .75rem;
  font-weight: 700;
  font-size: .9rem;
}
.btn-lang:hover, .btn-lang:focus-visible { border-color: var(--primary); color: var(--primary); }
.btn-lang i { color: var(--primary); }
@media (max-width: 991.98px) {
  .navbar > .container { flex-wrap: wrap; }
  .navbar .btn-lang span { font-size: .85rem; }
}

/* Direction arrows are drawn for Arabic: mirror them in English */
[dir="ltr"] .bi-dir { display: inline-block; transform: scaleX(-1); }
[dir="ltr"] .hero-title { letter-spacing: -0.5px; }
