/* =========================================
   PAGE.CSS — Pages internes (spécialités, services)
   Clinique Achifaa Oujda · 2026
========================================= */

:root {
  --blue-dark:   #1E3A8A;
  --blue-main:   #2563EB;
  --blue-soft:   #DBEAFE;
  --green-med:   #10B981;
  --green-light: #34D399;
  --green-soft:  #D1FAE5;
  --red:         #DC2626;
  --bg-primary:  #F9FAFB;
  --bg-white:    #FFFFFF;
  --border:      #E5E7EB;
  --text-dark:   #111827;
  --text-body:   #374151;
  --text-muted:  #6B7280;
  --shadow-sm:   0 1px 2px 0 rgba(0,0,0,0.05);
  --shadow-md:   0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg:   0 12px 32px -8px rgba(15,23,42,0.18);
  --shadow-xl:   0 24px 60px -12px rgba(15,23,42,0.25);
  --radius-sm:   8px;
  --radius-md:   14px;
  --radius-lg:   22px;
  --transition:  220ms cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Poppins', -apple-system, system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-dark);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
html[dir="rtl"] body { font-family: 'Cairo', sans-serif; }
img { max-width: 100%; display: block; height: auto; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; }

.container { width: min(1180px, 92%); margin-inline: auto; }

.skip-link {
  position: absolute; top: -40px; left: 8px;
  background: var(--blue-dark); color: white;
  padding: 8px 14px; border-radius: 8px;
  z-index: 9999; font-weight: 600; font-size: 14px;
  transition: top 200ms ease;
}
.skip-link:focus { top: 8px; }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ====== NAVBAR (lite) ====== */
.navbar {
  position: sticky;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid; place-items: center;
  overflow: hidden;
  background: white;
  box-shadow: 0 4px 12px -4px rgba(31,93,140,0.25);
  flex-shrink: 0;
}
.brand-logo img { width: 100%; height: 100%; object-fit: contain; padding: 2px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-weight: 800; font-size: 16px; color: var(--text-dark); letter-spacing: -0.01em; }
.brand-sub  { font-size: 11px; color: var(--text-muted); letter-spacing: 0.12em; font-weight: 500; }

.nav-menu { display: flex; align-items: center; gap: 4px; }
.nav-link {
  padding: 9px 14px;
  font-size: 14px; font-weight: 500;
  color: var(--text-body);
  border-radius: 10px;
  transition: var(--transition);
}
.nav-link:hover { color: var(--blue-dark); background: var(--bg-primary); }
.nav-actions { display: flex; align-items: center; gap: 10px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px;
  border-radius: 12px;
  font-size: 14.5px; font-weight: 600;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-primary { background: var(--green-med); color: white; box-shadow: 0 8px 20px -8px rgba(16,185,129,0.55); }
.btn-primary:hover { background: #0FA874; transform: translateY(-1px); }
.btn-blue { background: var(--blue-main); color: white; box-shadow: 0 8px 20px -8px rgba(37,99,235,0.55); }
.btn-blue:hover { background: #1D4ED8; transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--blue-dark); border: 1.5px solid var(--blue-main); }
.btn-outline:hover { background: var(--blue-main); color: #fff; }
.btn-wa { background: #25D366; color: white; }
.btn-wa:hover { background: #1DA851; transform: translateY(-1px); }

.urgence-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: #FEF2F2;
  color: var(--red);
  border-radius: 999px;
  font-size: 13px; font-weight: 600;
  border: 1px solid #FECACA;
}
.urgence-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red);
  animation: pulse 1.6s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(220,38,38,0.6); }
  100% { box-shadow: 0 0 0 12px rgba(220,38,38,0); }
}

.nav-burger {
  display: none;
  width: 42px; height: 42px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: white;
  flex-direction: column;
  justify-content: center; align-items: center; gap: 5px;
}
.nav-burger span {
  display: block;
  width: 18px; height: 2px;
  background: var(--text-dark);
  border-radius: 2px;
}
@media (max-width: 900px) {
  .nav-menu { display: none; }
  .nav-burger { display: flex; }
  .urgence-pill { display: none; }
}

/* ====== HERO ====== */
.page-hero {
  position: relative;
  padding: 50px 0 64px;
  background: linear-gradient(135deg, #EFF6FF 0%, #ECFDF5 100%);
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.page-hero::before {
  content: "";
  position: absolute; inset: -10%;
  background:
    radial-gradient(circle at 15% 30%, rgba(37,99,235,0.15), transparent 40%),
    radial-gradient(circle at 85% 70%, rgba(16,185,129,0.18), transparent 45%);
  pointer-events: none;
}
.page-hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  align-items: center;
}
@media (max-width: 900px) {
  .page-hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .page-hero { padding: 36px 0 44px; }
}
.breadcrumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-muted);
  margin-bottom: 14px;
}
.breadcrumb a { color: var(--blue-main); font-weight: 500; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--border); }

.eyebrow {
  display: inline-block;
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--green-med);
  margin-bottom: 12px;
}

.page-h1 {
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  color: var(--text-dark);
  font-weight: 800;
}
.page-h1 em {
  font-style: normal;
  background: linear-gradient(135deg, var(--blue-main), var(--green-med));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.page-lead {
  font-size: 17px;
  color: var(--text-body);
  margin: 0 0 24px;
  max-width: 56ch;
}

.hero-meta {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 24px;
}
.meta-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12.5px; font-weight: 600;
  color: var(--text-body);
}
.meta-chip svg { color: var(--green-med); }

.page-hero-cta {
  display: flex; flex-wrap: wrap; gap: 10px;
}

.page-hero-img {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  aspect-ratio: 4/3;
}
.page-hero-img img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.page-hero-img::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(15,23,42,0.4));
  pointer-events: none;
}
.page-hero-badge {
  position: absolute;
  bottom: 16px; left: 16px;
  background: rgba(255,255,255,0.95);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px; font-weight: 700;
  color: var(--blue-dark);
  box-shadow: var(--shadow-sm);
}

/* ====== SECTIONS ====== */
.section { padding: 64px 0; }
.section-narrow { padding: 48px 0; }
@media (max-width: 720px) { .section { padding: 48px 0; } }

.section-head { max-width: 760px; margin-bottom: 32px; }
.section-h2 {
  font-size: clamp(24px, 3.5vw, 34px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  font-weight: 800;
  margin: 0 0 12px;
  color: var(--text-dark);
}
.section-sub {
  font-size: 16px;
  color: var(--text-muted);
  margin: 0;
}

.prose {
  max-width: 70ch;
  font-size: 16px;
  color: var(--text-body);
}
.prose p { margin: 0 0 14px; }
.prose strong { color: var(--text-dark); }

/* ====== INTRO BLOCK (GEO chunk) ====== */
.intro-block {
  background: white;
  border-left: 4px solid var(--green-med);
  padding: 22px 26px;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  font-size: 16px;
  color: var(--text-body);
  margin-bottom: 28px;
}
.intro-block strong { color: var(--text-dark); }

/* ====== CARD GRID ====== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}
.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  transition: var(--transition);
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--blue-soft);
}
.card-icon {
  width: 42px; height: 42px;
  border-radius: 11px;
  background: var(--blue-soft);
  color: var(--blue-main);
  display: grid; place-items: center;
  margin-bottom: 14px;
}
.card-title {
  font-size: 16px; font-weight: 700;
  margin: 0 0 6px;
  color: var(--text-dark);
}
.card-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}

/* ====== CARD WITH PHOTO (services index) ====== */
.card.has-photo {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card-photo {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: linear-gradient(135deg, #E6F1F8 0%, #DCEAF5 100%);
}
.card-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 600ms cubic-bezier(.16,1,.3,1);
}
.card.has-photo:hover .card-photo img { transform: scale(1.06); }
.card-photo-cat {
  position: absolute;
  top: 12px; left: 12px;
  padding: 5px 11px;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #1F5D8C;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  z-index: 2;
}
.card-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.card-body .card-title { font-size: 17px; line-height: 1.25; margin: 0 0 6px; }
.card-body .card-desc { font-size: 13.5px; line-height: 1.45; }
.card-link {
  margin-top: auto;
  padding-top: 14px;
  display: inline-flex; align-items: center; gap: 6px;
  color: #2F80B7;
  font-size: 13px;
  font-weight: 600;
  transition: gap 220ms cubic-bezier(.16,1,.3,1), color 180ms;
}
.card-link svg { width: 14px; height: 14px; transition: transform 220ms cubic-bezier(.16,1,.3,1); }
.card.has-photo:hover .card-link { color: #1F5D8C; gap: 10px; }
.card.has-photo:hover .card-link svg { transform: translateX(3px); }
html[dir="rtl"] .card-link svg { transform: scaleX(-1); }
html[dir="rtl"] .card.has-photo:hover .card-link svg { transform: scaleX(-1) translateX(3px); }

/* ====== LIST ====== */
.checklist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}
.checklist li {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14.5px;
  color: var(--text-body);
}
.checklist li::before {
  content: "";
  flex-shrink: 0;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--green-soft) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2310B981' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") center/12px no-repeat;
  margin-top: 2px;
}

/* ====== STEPS ====== */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  counter-reset: step;
}
.step {
  background: white;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  position: relative;
  counter-increment: step;
}
.step::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  top: -14px; left: 18px;
  background: var(--blue-main);
  color: white;
  font-weight: 800;
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 8px;
}
.step h4 { font-size: 16px; margin: 6px 0 6px; color: var(--text-dark); }
.step p { font-size: 14px; color: var(--text-muted); margin: 0; }

/* ====== INFO TABLE ====== */
/* ====== BIDI: keep phone numbers LTR inside Arabic context ====== */
[href^="tel:"],
[href*="wa.me"],
.info-table td,
.footer-contact div {
  unicode-bidi: plaintext;
}
html[dir="rtl"] [href^="tel:"],
html[dir="rtl"] [href*="wa.me"] {
  direction: ltr;
  unicode-bidi: embed;
  display: inline-block;
}
/* Phone numbers in tables — force LTR but keep RTL header alignment */
html[dir="rtl"] .info-table td:has([href^="tel:"]),
html[dir="rtl"] .info-table td:has([href*="wa.me"]) {
  direction: ltr;
  text-align: right;
}

.info-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  font-size: 14.5px;
}
.info-table th, .info-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.info-table th {
  background: var(--bg-primary);
  font-weight: 700;
  color: var(--text-dark);
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.info-table tr:last-child td { border-bottom: 0; }
.info-table tr:hover td { background: rgba(219,234,254,0.3); }
html[dir="rtl"] .info-table th, html[dir="rtl"] .info-table td { text-align: right; }

/* ====== FAQ ====== */
.faq-list {
  display: flex; flex-direction: column;
  gap: 10px;
}
.faq-item {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.faq-q {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 18px 22px;
  text-align: left;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text-dark);
}
.faq-q:hover { background: var(--bg-primary); }
.faq-chev {
  flex-shrink: 0;
  transition: transform var(--transition);
  color: var(--blue-main);
}
.faq-item.is-open .faq-chev { transform: rotate(180deg); }
.faq-a {
  padding: 0 22px;
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition), padding var(--transition);
}
.faq-item.is-open .faq-a {
  padding: 0 22px 18px;
  max-height: 500px;
}
.faq-a p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--text-body);
}
html[dir="rtl"] .faq-q { text-align: right; }

/* ====== SISTER LINKS ====== */
.sister-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.sister-link {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: var(--transition);
}
.sister-link:hover {
  border-color: var(--blue-main);
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}
html[dir="rtl"] .sister-link:hover { transform: translateX(-4px); }
.sister-link img {
  width: 44px; height: 44px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}
.sister-link-text strong { display: block; font-size: 14.5px; color: var(--text-dark); }
.sister-link-text span { font-size: 12.5px; color: var(--text-muted); }

/* ====== CTA BANNER ====== */
.cta-banner {
  background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue-main) 100%);
  color: white;
  border-radius: 22px;
  padding: 40px 44px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 30px;
  position: relative;
  overflow: hidden;
}
.cta-banner::before {
  content: "";
  position: absolute;
  top: -40%; right: -10%;
  width: 380px; height: 380px;
  background: radial-gradient(circle, rgba(52,211,153,0.35), transparent 70%);
  pointer-events: none;
}
.cta-banner h3 {
  font-size: clamp(20px, 3vw, 28px);
  margin: 0 0 6px;
  position: relative;
}
.cta-banner p {
  margin: 0;
  opacity: 0.85;
  font-size: 15px;
  position: relative;
}
.cta-banner .btn-group {
  display: flex; gap: 10px; flex-wrap: wrap;
  position: relative;
}
.cta-banner .btn-blue { background: white; color: var(--blue-dark); }
.cta-banner .btn-blue:hover { background: var(--green-light); color: white; }
@media (max-width: 720px) {
  .cta-banner { grid-template-columns: 1fr; padding: 30px; }
}

/* ====== FOOTER ====== */
.footer {
  background: #0F172A;
  color: #CBD5E1;
  padding: 56px 0 24px;
  margin-top: 60px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 36px;
  border-bottom: 1px solid #1F2937;
}
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 28px; }
}
@media (max-width: 540px) {
  .footer-grid { grid-template-columns: 1fr; }
}
.footer h4 {
  color: white;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 14px;
}
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer ul li { margin-bottom: 8px; font-size: 14px; }
.footer ul li a { color: #CBD5E1; transition: color var(--transition); }
.footer ul li a:hover { color: white; }
.footer-tagline { font-size: 14px; line-height: 1.6; max-width: 32ch; margin: 14px 0 18px; color: #94A3B8; }
.footer-brand .brand-name, .footer-brand .brand-sub { color: white; }
.footer .socials { display: flex; gap: 8px; }
.footer .socials a {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: #1F2937;
  color: #CBD5E1;
  transition: var(--transition);
}
.footer .socials a:hover { background: var(--green-med); color: white; }
.copyright {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
  padding-top: 22px;
  font-size: 12.5px;
  color: #64748B;
}

/* ====== FLOATING ====== */
.floating {
  position: fixed;
  bottom: 22px; right: 22px;
  display: flex; flex-direction: column;
  gap: 10px;
  z-index: 990;
}
html[dir="rtl"] .floating { right: auto; left: 22px; }
.fab {
  width: 52px; height: 52px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: white;
  box-shadow: 0 12px 24px -8px rgba(0,0,0,0.25);
  transition: var(--transition);
}
.fab:hover { transform: scale(1.1); }
.fab-red { background: var(--red); }
.fab-green { background: #25D366; }
.fab-blue { background: var(--blue-main); }
@media (max-width: 540px) {
  .floating { bottom: 14px; right: 14px; gap: 8px; }
  .fab { width: 48px; height: 48px; }
}

/* ====== UTILITIES ====== */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.muted { color: var(--text-muted); }

/* ====== LANG TOGGLE ====== */
.lang-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: white;
  font-size: 13px; font-weight: 600;
  color: var(--text-body);
  transition: var(--transition);
}
.lang-toggle:hover { border-color: var(--blue-main); color: var(--blue-main); }

/* ====== RTL OVERRIDES (Arabic) ====== */
html[dir="rtl"] body { font-family: 'Cairo', 'Poppins', sans-serif; }
html[dir="rtl"] .breadcrumb { flex-direction: row-reverse; justify-content: flex-end; }
html[dir="rtl"] .checklist li { flex-direction: row-reverse; }
html[dir="rtl"] .step::before { left: auto; right: 18px; }
html[dir="rtl"] .sister-link:hover { transform: translateX(-4px); }
html[dir="rtl"] .info-table th,
html[dir="rtl"] .info-table td { text-align: right; }
html[dir="rtl"] .floating { right: auto; left: 22px; }
html[dir="rtl"] .page-hero-badge { left: auto; right: 16px; }
html[dir="rtl"] .intro-block {
  border-left: 0;
  border-right: 4px solid var(--green-med);
}
html[dir="rtl"] .page-hero-cta { flex-direction: row-reverse; justify-content: flex-end; }
html[dir="rtl"] .hero-meta { flex-direction: row-reverse; justify-content: flex-end; }
html[dir="rtl"] .nav-inner { flex-direction: row-reverse; }
html[dir="rtl"] .nav-menu,
html[dir="rtl"] .nav-actions { flex-direction: row-reverse; }
html[dir="rtl"] .footer-grid { direction: rtl; }
html[dir="rtl"] .copyright { flex-direction: row-reverse; }
html[dir="rtl"] .faq-q .faq-chev { margin-right: auto; margin-left: 0; }

@media (max-width: 540px) {
  html[dir="rtl"] .floating { left: 14px; }
}
