/* ============================================================
   ONMRIM — Responsive Mobile (v1)
   ============================================================
   Surcharge des inline-styles via sélecteurs d'attribut + !important.
   À inclure APRÈS front.css dans head.php.

   Breakpoints :
     - max-width: 1024px → tablette
     - max-width:  768px → tablette portrait + mobile (la majorité des correctifs)
     - max-width:  480px → smartphone uniquement (ajustements fins)
   ============================================================ */


/* ════════════════════════════════════════════════════════════
   BREAKPOINT TABLETTE PORTRAIT + MOBILE (≤ 768px)
   ════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* ── Sections : padding latéral réduit ──────────────────── */
  section { padding-left: 16px !important; padding-right: 16px !important; }

  /* ════════════════════════════════════════════════════════
     ⚡ FIX CRITIQUE — Grille principale annuaire (sidebar+main)
     ════════════════════════════════════════════════════════
     La grille `grid-template-columns:240px 1fr` du wrapper de
     l'annuaire ne se replie pas en mobile → overflow horizontal.
     Ce fix la passe en 1 colonne. */
  div[style*="grid-template-columns:240px 1fr"],
  div[style*="grid-template-columns: 240px 1fr"],
  div[style*="grid-template-columns:280px 1fr"],
  div[style*="grid-template-columns: 280px 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  /* Toute aside avec position:sticky devient statique pleine largeur */
  aside[style*="position:sticky"],
  aside[style*="position: sticky"] {
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 16px !important;
    box-sizing: border-box !important;
  }

  /* Filet de sécurité : empêche tout scroll horizontal sur mobile */
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }

  /* Conteneurs principaux ──────────────────────────────── */
  div[style*="max-width:1280px"],
  div[style*="max-width:1100px"],
  div[style*="max-width: 1100px"],
  div[style*="max-width:1000px"],
  div[style*="max-width:980px"],
  div[style*="max-width:920px"],
  div[style*="max-width:780px"] {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  /* ── Typographie : titres plus petits en mobile ─────────── */
  h1 { font-size: 32px !important; line-height: 1.2 !important; }
  h2 { font-size: 24px !important; line-height: 1.25 !important; }
  h3 { font-size: 16px !important; }

  /* Hero offre-premium : titre à 52px → 32px */
  section h1[style*="font-size:52px"] { font-size: 32px !important; }
  /* Sub-headers section */
  h2[style*="font-size:36px"],
  h2[style*="font-size:38px"],
  h2[style*="font-size:34px"],
  h2[style*="font-size:30px"] { font-size: 24px !important; }

  /* ════════════════════════════════════════════════════════
     GRIDS — basculement multi-colonnes → mono-colonne
     ════════════════════════════════════════════════════════ */

  /* 4 colonnes (KPIs, etc.) → 2 colonnes mobile */
  div[style*="grid-template-columns:repeat(4,1fr)"],
  div[style*="grid-template-columns:repeat(4, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* 3 colonnes (KPIs patients, comparaisons, etc.) → 1 colonne */
  div[style*="grid-template-columns:repeat(3,1fr)"],
  div[style*="grid-template-columns:repeat(3, 1fr)"] {
    grid-template-columns: 1fr !important;
  }

  /* 2 colonnes égales (cards, KPIs RDV, langues, tarifs) → 1 colonne */
  div[style*="grid-template-columns:1fr 1fr"],
  div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Profil médecin : 320px + 1fr → 1 colonne (photo en haut) */
  div[style*="grid-template-columns:320px 1fr"],
  div[style*="grid-template-columns: 320px 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Prendre RDV étape 2 : 1fr + 320px (form + récap) → récap d'abord */
  div[style*="grid-template-columns:1fr 320px"],
  div[style*="grid-template-columns: 1fr 320px"] {
    grid-template-columns: 1fr !important;
    display: flex !important;
    flex-direction: column-reverse !important;
  }
  div[style*="grid-template-columns:1fr 320px"] .card[style*="position:sticky"] {
    position: static !important;
  }

  /* Disponibilités : 4 colonnes (Jour/Actif/Slot1/Slot2) → empilé en cartes */
  div.dispo-row[style*="grid-template-columns:140px"] {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    padding: 16px !important;
    border-bottom: 2px solid var(--gray-200) !important;
    grid-template-areas:
      "jour toggle"
      "slot1 slot1"
      "slot2 slot2" !important;
  }
  div.dispo-row[style*="grid-template-columns:140px"] > div:nth-child(1) { grid-area: jour; font-size: 16px !important; }
  div.dispo-row[style*="grid-template-columns:140px"] > div:nth-child(2) { grid-area: toggle; text-align: right !important; }
  div.dispo-row[style*="grid-template-columns:140px"] > div:nth-child(3) { grid-area: slot1; }
  div.dispo-row[style*="grid-template-columns:140px"] > div:nth-child(4) { grid-area: slot2; }
  /* Header du tableau dispos : caché sur mobile (les libellés sont implicites) */
  div[style*="grid-template-columns:140px 60px 1fr 1fr"]:not(.dispo-row) {
    display: none !important;
  }
  /* Petit hint avant les slots sur mobile */
  div.dispo-row[style*="grid-template-columns:140px"] .slot-fields::before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 4px;
    font-weight: 700;
  }

  /* ════════════════════════════════════════════════════════
     ANNUAIRE — Modal médecin
     ════════════════════════════════════════════════════════ */

  /* Modal box */
  .modal-overlay { padding: 8px !important; }
  .modal-box {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    max-height: 95vh !important;
  }
  .modal-header { padding: 24px 18px !important; min-height: 0 !important; }
  .modal-body   { padding: 22px 18px !important; }
  .modal-close  { right: 10px !important; top: 10px !important; }
  .modal-fields { grid-template-columns: 1fr !important; }
  .mf-grid      { grid-template-columns: 1fr !important; }

  /* Bandeau Premium gold dans modal */
  div[style*="linear-gradient(90deg,#f0c050"] {
    font-size: 11px !important;
    padding: 9px 14px !important;
    letter-spacing: .03em !important;
  }

  /* Boutons d'action de la modal */
  div[style*="padding-top:14px;border-top:1px solid var(--gray-100)"][style*="flex-wrap:wrap"] button,
  div[style*="padding-top:14px;border-top:1px solid var(--gray-100)"][style*="flex-wrap:wrap"] a {
    flex: 1 1 calc(50% - 4px) !important;
    min-width: 0 !important;
    padding: 11px 6px !important;
    font-size: 12.5px !important;
    text-align: center !important;
    justify-content: center !important;
  }

  /* ════════════════════════════════════════════════════════
     ANNUAIRE — Liste des médecins (cartes)
     ════════════════════════════════════════════════════════ */
  div[style*="grid-template-columns:repeat(auto-fill,minmax(280px,1fr))"],
  div[style*="grid-template-columns:repeat(auto-fill,minmax(260px,1fr))"],
  div[style*="grid-template-columns:repeat(auto-fit,minmax(280px,1fr))"],
  div[style*="grid-template-columns:repeat(auto-fit,minmax(260px,1fr))"],
  div[style*="grid-template-columns:repeat(auto-fit,minmax(180px,1fr))"] {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* Filtres avancés sidebar : passer en bas en mobile */
  aside,
  div[style*="position:sticky;top:"][style*="width:280px"] {
    position: static !important;
    width: 100% !important;
    margin-bottom: 16px !important;
  }

  /* ════════════════════════════════════════════════════════
     ESPACE MÉDECIN — Header
     ════════════════════════════════════════════════════════ */

  /* Header (photo + nom + déconnexion) en colonne */
  div[style*="background:linear-gradient(135deg,var(--green-dark),#1a7a3e)"] > div {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 16px !important;
  }
  div[style*="background:linear-gradient(135deg,var(--green-dark),#1a7a3e)"] a[href*="logout"] {
    align-self: stretch !important;
    text-align: center !important;
  }

  /* Tabs : déjà overflow-x:auto, juste vérifier le padding */
  div[style*="position:sticky;top:0;z-index:10"] {
    padding: 0 8px !important;
  }
  div[style*="position:sticky;top:0;z-index:10"] a {
    padding: 12px 14px !important;
    font-size: 13px !important;
  }

  /* ════════════════════════════════════════════════════════
     PRENDRE RDV — Bandeau et stepper
     ════════════════════════════════════════════════════════ */

  /* Bandeau médecin (flex-wrap déjà actif) — réduire avatar et tarif */
  section[style*="background:linear-gradient(135deg,var(--green-dark)"] div[style*="width:64px;height:64px"] {
    width: 52px !important;
    height: 52px !important;
    font-size: 18px !important;
  }
  /* Tarif card : pleine largeur en bas si flex-wrap */
  section[style*="background:linear-gradient(135deg,var(--green-dark)"] div[style*="background:rgba(255,255,255,.1)"] {
    flex: 1 1 100% !important;
    text-align: center !important;
    margin-top: 8px !important;
  }

  /* Stepper : compactage */
  div[style*="background:#fff;border-bottom:1px solid var(--gray-200);padding:18px"] {
    padding: 14px 8px !important;
  }
  div[style*="background:#fff;border-bottom:1px solid var(--gray-200);padding:18px"] > div {
    gap: 4px !important;
  }
  /* Cacher les labels du stepper sur mobile, garder juste les bulles */
  div[style*="background:#fff;border-bottom:1px solid var(--gray-200);padding:18px"] > div > div > div:last-child {
    font-size: 11px !important;
    max-width: 70px !important;
    line-height: 1.2 !important;
  }
  /* Réduire les barres entre étapes */
  div[style*="background:#fff;border-bottom:1px solid var(--gray-200);padding:18px"] > div > div[style*="width:36px;height:2px"] {
    width: 12px !important;
  }

  /* ════════════════════════════════════════════════════════
     OFFRE PREMIUM — Sections diverses
     ════════════════════════════════════════════════════════ */

  /* Hero : padding réduit */
  section[style*="background:linear-gradient(135deg,var(--green-dark) 0%,#1a7a3e"] {
    padding: 48px 16px 56px !important;
  }
  /* Hero CTAs */
  section[style*="background:linear-gradient(135deg,var(--green-dark) 0%,#1a7a3e"] a {
    width: 100% !important;
    text-align: center !important;
    box-sizing: border-box !important;
  }
  /* Bannière offre 3 mois (hero) */
  section[style*="background:linear-gradient(135deg,var(--green-dark) 0%,#1a7a3e"] div[style*="background:linear-gradient(90deg,#f0c050"] {
    font-size: 13px !important;
    padding: 14px 18px !important;
  }

  /* Bannière offre lancement (pricing) */
  section div[style*="background:linear-gradient(90deg,#f0c050,#e8a820"] {
    padding: 18px 20px !important;
  }
  section div[style*="background:linear-gradient(90deg,#f0c050,#e8a820"] div[style*="font-size:30px"] {
    font-size: 22px !important;
  }

  /* Pricing cards : la card "highlight" perd son scale */
  div.card[style*="border:2px solid var(--green-main);transform:scale(1.03)"] {
    transform: none !important;
  }

  /* Tableau comparaison : scroll horizontal sur très petits écrans */
  table {
    font-size: 12.5px !important;
  }
  table th, table td {
    padding: 10px 10px !important;
  }

  /* FAQ accordion */
  details summary {
    padding: 14px 16px !important;
    font-size: 13.5px !important;
  }

  /* Footer CTA boutons */
  section[style*="background:var(--green-dark);padding:54px"] a {
    width: 100% !important;
    text-align: center !important;
    box-sizing: border-box !important;
    margin-bottom: 8px !important;
  }

  /* ════════════════════════════════════════════════════════
     FORMULAIRES en général
     ════════════════════════════════════════════════════════ */
  .card[style*="padding:36px"],
  .card[style*="padding:32px"] {
    padding: 22px 18px !important;
  }
  .form-input { font-size: 15px !important; } /* éviter le zoom auto iOS */
  .form-group { margin-bottom: 14px !important; }

  /* Champs téléphone/whatsapp côte-à-côte → empilés */
  div[style*="grid-template-columns:1fr 1fr;gap:14px"] {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  /* ════════════════════════════════════════════════════════
     ⚡ FIX VAGUE 2 — Layouts 2-col asymétriques + Espace Médecin
     ════════════════════════════════════════════════════════ */

  /* Tous les patterns "X + 1fr" et "1fr + X" qui ne se replient pas */
  div[style*="grid-template-columns:1fr 380px"],
  div[style*="grid-template-columns: 1fr 380px"],
  div[style*="grid-template-columns:380px 1fr"],
  div[style*="grid-template-columns: 380px 1fr"],
  div[style*="grid-template-columns:340px 1fr"],
  div[style*="grid-template-columns: 340px 1fr"],
  div[style*="grid-template-columns:1fr 340px"],
  div[style*="grid-template-columns: 1fr 340px"],
  div[style*="grid-template-columns:220px 1fr"],
  div[style*="grid-template-columns: 220px 1fr"],
  div[style*="grid-template-columns:200px 1fr"],
  div[style*="grid-template-columns: 200px 1fr"],
  div[style*="grid-template-columns:300px 1fr"],
  div[style*="grid-template-columns: 300px 1fr"],
  div[style*="grid-template-columns:1fr 280px"],
  div[style*="grid-template-columns: 1fr 280px"],
  div[style*="grid-template-columns:1fr 360px"],
  div[style*="grid-template-columns: 1fr 360px"],
  div[style*="grid-template-columns:1fr 420px"],
  div[style*="grid-template-columns: 1fr 420px"] {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  /* Sections en flex (hero accueil) → empilées en mobile */
  section[style*="display:flex"]:not([style*="flex-direction:column"]) {
    flex-direction: column !important;
  }

  /* Toutes les images : maximum 100% en largeur, hauteur auto */
  img {
    max-width: 100% !important;
    height: auto !important;
  }

  /* Formulaires : ne dépassent jamais de leur container */
  form {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Conteneurs avec max-width fixe en pixels → 100% en mobile */
  [style*="max-width:480px"],
  [style*="max-width: 480px"],
  [style*="max-width:540px"],
  [style*="max-width: 540px"],
  [style*="max-width:520px"],
  [style*="max-width: 520px"] {
    max-width: 100% !important;
  }

  /* Image hero accueil avec hauteur fixe → réduite */
  img[style*="height:340px"] {
    height: auto !important;
    max-height: 240px !important;
  }

  /* ⚡ Bouton "Espace Médecin" — était caché par front.css */
  /* En vague 4 : on cache l'ancien bouton .hd-cta complètement
     car Espace Médecin est maintenant dans le menu hamburger */
  .hd-cta {
    display: none !important;
  }

  /* ════════════════════════════════════════════════════════
     ⚡ MENU HAMBURGER FONCTIONNEL (vague 4)
     ════════════════════════════════════════════════════════ */

  /* Header layout : empêche le hamburger d'être poussé hors écran sur petits mobiles
     (iPhone 12/13 Pro = 390px notamment) */
  .hd-wrap {
    flex-wrap: nowrap !important;
  }
  .logo-wrap {
    min-width: 0 !important;
    flex-shrink: 1 !important;
    overflow: hidden !important;
  }
  .logo-img {
    flex-shrink: 0 !important;
  }
  .logo-fr,
  .logo-ar {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  /* Hamburger ☰ visible en mobile, jamais shrink */
  .menu-toggle {
    display: block !important;
    background: transparent !important;
    border: none !important;
    color: var(--gray-800) !important;
    font-size: 28px !important;
    padding: 6px 10px !important;
    cursor: pointer !important;
    line-height: 1 !important;
    margin-left: 8px !important;
    flex-shrink: 0 !important;
  }

  /* Nav principale : cachée par défaut en mobile, overlay quand .open */
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    padding: 12px;
    box-shadow: 0 12px 28px rgba(0,0,0,.18);
    z-index: 200;
    border-top: 3px solid var(--green-main);
    gap: 0;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
  }
  .main-nav.open {
    display: flex !important;
  }

  /* Liens dans le menu mobile */
  .main-nav .nav-link {
    padding: 13px 16px !important;
    border-bottom: 1px solid var(--gray-100) !important;
    color: var(--gray-700) !important;
    text-decoration: none !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    border-radius: 0 !important;
  }
  .main-nav .nav-link.active {
    color: var(--green-main) !important;
    font-weight: 700 !important;
    background: var(--green-pale, #f0fdf4) !important;
  }

  /* Bouton CTA "Espace Médecin" dans le menu mobile */
  .main-nav .nav-link-cta {
    background: var(--green-main, #166534) !important;
    color: #fff !important;
    font-weight: 700 !important;
    border-radius: 10px !important;
    margin-top: 10px !important;
    text-align: center !important;
    padding: 14px 16px !important;
    border-bottom: none !important;
  }

  /* ════════════════════════════════════════════════════════
     ⚡ BARRE DE RECHERCHE ANNUAIRE / HOME (vague 4)
     ════════════════════════════════════════════════════════ */

  /* Form recherche annuaire : 4 éléments en grid → 1 colonne (input, select, select, bouton empilés) */
  div[style*="grid-template-columns:1fr auto auto auto"],
  div[style*="grid-template-columns: 1fr auto auto auto"],
  div[style*="grid-template-columns:1fr auto auto"],
  div[style*="grid-template-columns: 1fr auto auto"] {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  /* Select avec min-width:200px (annuaire spec) → pleine largeur */
  select[style*="min-width:200px"] {
    min-width: 0 !important;
    width: 100% !important;
  }

  /* Le bouton "Rechercher" prend pleine largeur en bas */
  form[style*="background:rgba(255,255,255,.08)"] button[type="submit"],
  div[style*="grid-template-columns:1fr auto auto auto"] button[type="submit"] {
    width: 100% !important;
  }

  /* Form recherche HERO (home) : flex avec icône + input + sep + select + bouton → empilé */
  form[style*="display:flex"][style*="gap:10px"][style*="align-items:center"] {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }
  /* Cacher les séparateurs verticaux (1px de large) inutiles en mode colonne */
  form[style*="display:flex"] > div[style*="width:1px"] {
    display: none !important;
  }
  /* Bouton submit du form hero pleine largeur */
  form[style*="display:flex"][style*="align-items:center"] > button[type="submit"] {
    width: 100% !important;
    padding: 11px 18px !important;
  }

  /* ⚡ Force les grid items à pouvoir shrinker (CSS Grid bug:
     min-width: auto par défaut empêche le shrinking en dessous
     du min-content du contenu, ce qui causait l'overflow visuel
     même avec grid-template-columns:1fr) */
  div[style*="grid-template-columns"] > * {
    min-width: 0 !important;
  }

  /* Aussi sur les sections flex pour le hero accueil */
  section[style*="display:flex"] > *,
  section[style*="display:flex"] > * > * {
    min-width: 0 !important;
    max-width: 100% !important;
  }
}

/* ════════════════════════════════════════════════════════════
   DESKTOP : nav-link-cta caché (il est juste pour le menu mobile)
   ════════════════════════════════════════════════════════════ */
@media (min-width: 769px) {
  .main-nav .nav-link-cta {
    display: none !important;
  }
}


/* ════════════════════════════════════════════════════════════
   BREAKPOINT MOBILE STRICT (≤ 480px) — ajustements fins
   ════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {

  /* Hero typography très réduit */
  h1[style*="font-size:52px"] { font-size: 26px !important; }
  h1 { font-size: 26px !important; }
  h2 { font-size: 20px !important; }

  /* KPIs 4 colonnes → 2 colonnes (déjà fait) MAIS texte des chiffres réduit */
  div[style*="grid-template-columns:repeat(4,1fr)"] .card div[style*="font-size:24px;font-weight:700"] {
    font-size: 20px !important;
  }

  /* Boutons modal : 2 par ligne max au lieu de tous sur une ligne */
  div[style*="padding-top:14px;border-top:1px solid var(--gray-100)"][style*="flex-wrap:wrap"] {
    gap: 6px !important;
  }

  /* Modal photo : taille réduite */
  .card[style*="padding:22px;text-align:center"] img[style*="width:160px;height:160px"],
  .card[style*="padding:22px;text-align:center"] div[style*="width:160px;height:160px"] {
    width: 130px !important;
    height: 130px !important;
    font-size: 42px !important;
  }

  /* Header site (top bar) cacher partiellement */
  div[style*="background:var(--green-dark)"][style*="font-size:13px"] {
    padding: 6px 14px !important;
    font-size: 11.5px !important;
  }

  /* Logo + titre arabe : réduire */
  header img,
  div[style*="font-family:'Noto Naskh Arabic'"] {
    max-height: 48px !important;
  }
}


/* ════════════════════════════════════════════════════════════
   ACCESSIBILITÉ : tap targets minimum 44×44px en mobile
   ════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  button, a.btn, [role="button"] {
    min-height: 44px !important;
  }
}


/* ════════════════════════════════════════════════════════════
   BOUTON SCROLL-TO-TOP (universel desktop + mobile)
   ════════════════════════════════════════════════════════════ */
.scroll-top-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--green-main, #166534);
  color: #fff;
  border: none;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .25s ease, visibility .25s, transform .25s ease, background .15s;
  z-index: 9990;
  font-family: inherit;
  line-height: 1;
}
.scroll-top-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.scroll-top-btn:hover {
  background: var(--green-dark, #0d4a28);
  transform: translateY(-2px);
}
@media (max-width: 480px) {
  .scroll-top-btn {
    bottom: 18px;
    right: 18px;
    width: 44px;
    height: 44px;
    font-size: 18px;
  }
}

/* ════════════════════════════════════════════════════════════════════
   PHASE 2.1 — LOT 1 — Refonte fiche médecin (modale)
   Mobile first : on conçoit pour 380px, puis on étire pour desktop
   ════════════════════════════════════════════════════════════════════ */

/* ── Bandeau "Médecin Premium ONMRIM" en haut de modale ── */
.med-premium-banner {
  background: linear-gradient(90deg, #f0c050 0%, #c4942a 50%, #f0c050 100%);
  color: var(--green-dark, #0d4a28);
  padding: 11px 16px;
  text-align: center;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--gold, #fcd34d);
  box-shadow: inset 0 -2px 6px rgba(0, 0, 0, .06);
  line-height: 1.4;
}
@media (min-width: 768px) {
  .med-premium-banner {
    font-size: 12.5px;
    padding: 11px 18px;
    letter-spacing: .05em;
  }
}

/* ── Header de modale (Premium = vert + cover ; Standard = vert sans cover) ── */
.med-modal-header {
  position: relative;
  padding: 22px 20px 24px;
  background: linear-gradient(135deg, var(--green-main, #166534) 0%, var(--green-dark, #0d4a28) 100%);
  background-size: cover;
  background-position: center;
  color: #fff;
  text-align: left;
}
@media (min-width: 768px) {
  .med-modal-header {
    padding: 30px 32px 30px;
  }
}

/* Bouton fermeture toujours visible sur le header */
.med-modal-header .modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, .15);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
  z-index: 2;
}
.med-modal-header .modal-close:hover {
  background: rgba(255, 255, 255, .28);
}

/* ── Avatar dans le header de modale ── */
.med-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #6b4f3f; /* fallback */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 14px;
  border: 3px solid rgba(255, 255, 255, .35);
  overflow: hidden;
  position: relative;
  z-index: 1;
}
.med-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.med-avatar-premium {
  border-color: rgba(252, 211, 77, .85);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
}
@media (min-width: 768px) {
  .med-avatar {
    width: 72px;
    height: 72px;
    font-size: 26px;
  }
}

/* ── Badge titre + nom + spécialité du médecin ── */
.med-title-badge {
  display: inline-block;
  background: var(--gold, #fcd34d);
  color: var(--green-dark, #0d4a28);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .03em;
  padding: 4px 11px;
  border-radius: 6px;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}
.med-modal-header-standard .med-title-badge {
  background: rgba(255, 255, 255, .2);
  color: #fff;
}
.med-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 4px;
  line-height: 1.2;
  letter-spacing: -.01em;
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .35);
}
.med-spec {
  color: #a7f3c0;
  font-size: 14px;
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .35);
}
@media (min-width: 768px) {
  .med-name { font-size: 26px; }
  .med-spec { font-size: 15px; }
}

/* ── Alerte officielle (bandeau vert pâle "Médecin figure au Tableau...") ── */
.med-alert-official {
  background: var(--green-pale, #f0fdf4);
  border: 1px solid var(--green-pale, #dcfce7);
  border-left: 4px solid var(--green-main, #166534);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 18px;
}
.med-alert-official p {
  font-size: 13px;
  color: var(--green-main, #166534);
  font-weight: 500;
  margin: 0;
  line-height: 1.5;
}

/* ── Zone ACTIONS (position 2 — boutons gros, tappables) ── */
.med-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 22px;
}
@media (min-width: 480px) {
  .med-actions { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 768px) {
  /* Si plus de 2 boutons : on autorise une 3e colonne */
  .med-actions { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
}

.med-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 16px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 700;
  text-decoration: none;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: all .15s;
  text-align: center;
  min-height: 48px; /* tappable iOS minimum */
  line-height: 1.2;
}
.med-btn-rdv {
  background: #1d4ed8;
  color: #fff;
  grid-column: 1 / -1; /* RDV occupe toute la largeur (action principale) */
}
.med-btn-rdv:hover { background: #1e40af; }

.med-btn-call {
  background: var(--green-main, #166534);
  color: #fff;
}
.med-btn-call:hover { background: var(--green-dark, #0d4a28); }

.med-btn-wa {
  background: #25D366;
  color: #fff;
}
.med-btn-wa:hover { background: #1ebe57; }

.med-btn-email {
  background: #4F46E5;
  color: #fff;
}
.med-btn-email:hover { background: #4338ca; }

/* ── Sections de la modale (cabinet / langues / bio / agenda) ── */
.med-section {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--gray-100, #f3f4f6);
}
.med-section:last-of-type { border-bottom: none; }

.med-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gray-500, #6b7280);
  margin: 0 0 10px;
}

.med-section-body { display: flex; flex-direction: column; gap: 6px; }

.med-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--gray-700, #374151);
  line-height: 1.5;
}
.med-line-icon {
  flex-shrink: 0;
  width: 22px;
  text-align: center;
  font-size: 14px;
}

/* ── Langues parlées (tags) ── */
.med-langues {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.med-langue-tag {
  background: var(--green-pale, #f0fdf4);
  color: var(--green-main, #166534);
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* ── Biographie ── */
.med-bio {
  font-size: 14px;
  color: var(--gray-700, #374151);
  line-height: 1.65;
  margin: 0;
}

/* ── Agenda (dispos + tarif) ── */
.med-section-agenda {
  background: #eff6ff;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 22px;
}
.med-section-agenda { border-bottom: 1px solid #dbeafe; }
.med-dispos { display: flex; flex-wrap: wrap; gap: 6px; }
.med-dispo-tag {
  background: #fff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12.5px;
  color: #1d4ed8;
  font-weight: 600;
}
.med-tarif {
  font-size: 13px;
  color: #1d4ed8;
  margin-top: 10px;
  font-weight: 500;
}

/* ── Accordéon "Vérifier l'inscription" ── */
.med-verif-accordion {
  background: var(--gray-50, #f9fafb);
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 10px;
  margin-bottom: 18px;
  overflow: hidden;
}
.med-verif-accordion summary {
  cursor: pointer;
  padding: 13px 16px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--gray-700, #374151);
  display: flex;
  align-items: center;
  gap: 10px;
  list-style: none;
  user-select: none;
}
.med-verif-accordion summary::-webkit-details-marker { display: none; }
.med-verif-icon { font-size: 16px; }
.med-verif-title { flex: 1; }
.med-verif-chevron {
  font-size: 14px;
  color: var(--gray-400, #9ca3af);
  transition: transform .2s ease;
}
.med-verif-accordion[open] .med-verif-chevron { transform: rotate(180deg); }
.med-verif-accordion[open] summary {
  border-bottom: 1px solid var(--gray-200, #e5e7eb);
  background: #fff;
}

.med-verif-body { padding: 14px 16px 16px; background: #fff; }
.med-verif-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px 16px;
}
@media (min-width: 480px) {
  .med-verif-grid { grid-template-columns: 1fr 1fr; }
}
.med-verif-grid > div { display: flex; flex-direction: column; gap: 2px; }
.med-verif-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gray-400, #9ca3af);
  font-weight: 700;
}
.med-verif-value {
  font-size: 13.5px;
  color: var(--gray-700, #374151);
  font-weight: 600;
}

/* ── Teaser Premium pour les non-Premium ── */
.med-premium-teaser {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 1px solid #fcd34d;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
@media (min-width: 600px) {
  .med-premium-teaser {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}
.med-teaser-text {
  font-size: 13px;
  color: #78350f;
  line-height: 1.55;
  flex: 1;
}
.med-teaser-btn {
  background: var(--green-main, #166534);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .15s;
}
.med-teaser-btn:hover { background: var(--green-dark, #0d4a28); }

/* ── Boutons utilitaires (Fermer / Imprimer) ── */
.med-utility {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 14px;
  border-top: 1px solid var(--gray-100, #f3f4f6);
}
.med-util-btn {
  flex: 1;
  padding: 10px 14px;
  background: var(--gray-100, #f3f4f6);
  color: var(--gray-700, #374151);
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
  min-height: 42px;
}
.med-util-btn:hover { background: var(--gray-200, #e5e7eb); }

/* ════════════════════════════════════════════════════════════════════
   PHASE 2.1 — LOT 1 BIS — Hotfix
   • Bloc "aucun moyen de contact" sur fiche publique
   • Refonte mobile-first onglet "Mes patients"
   ════════════════════════════════════════════════════════════════════ */

/* ── Bloc 3 actions de rebond si pas de contact (fiche non-Premium) ── */
.med-no-contact {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-left: 4px solid #f59e0b;
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 22px;
}
.med-no-contact-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.med-no-contact-title {
  font-size: 14px;
  font-weight: 700;
  color: #92400e;
}
.med-no-contact-text {
  font-size: 13px;
  color: #78350f;
  line-height: 1.5;
  margin: 0 0 14px;
}
.med-no-contact-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 14px;
}
@media (min-width: 480px) {
  .med-no-contact-actions { grid-template-columns: 1fr 1fr; }
}
.med-no-contact-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  font-family: inherit;
  min-height: 44px;
  line-height: 1.3;
  text-align: center;
  transition: all .15s;
}
.med-no-contact-btn-primary {
  background: var(--green-main, #166534);
  color: #fff;
}
.med-no-contact-btn-primary:hover {
  background: var(--green-dark, #0d4a28);
}
.med-no-contact-btn-secondary {
  background: #fff;
  color: #92400e;
  border: 1.5px solid #f59e0b;
}
.med-no-contact-btn-secondary:hover {
  background: #fef3c7;
}
.med-no-contact-medecin {
  font-size: 12px;
  color: #78350f;
  padding-top: 12px;
  border-top: 1px dashed #fcd34d;
  line-height: 1.5;
}
.med-no-contact-medecin strong {
  display: block;
  margin-bottom: 4px;
  font-size: 12.5px;
}
.med-no-contact-link {
  color: var(--green-main, #166534);
  font-weight: 700;
  text-decoration: none;
  font-size: 12.5px;
}
.med-no-contact-link:hover { text-decoration: underline; }

/* ════════════════════════════════════════════════════════════════════
   ONGLET MES PATIENTS — Cards mobile / Table desktop
   ════════════════════════════════════════════════════════════════════ */

/* Grille KPI : 1 colonne mobile, 3 colonnes ≥600px */
.patients-kpi-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
@media (min-width: 600px) {
  .patients-kpi-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
}

/* Grille features dans l'état vide */
.patients-feat-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  max-width: 720px;
  margin: 0 auto;
}
@media (min-width: 600px) {
  .patients-feat-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
}

/* Cards de patients : visibles uniquement <768px */
.patients-cards { display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 768px) {
  .patients-cards { display: none; }
}

.patient-card {
  background: #fff;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}
.patient-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.patient-card-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-800, #1f2937);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.patient-card-rdv-badge {
  background: var(--green-pale, #f0fdf4);
  color: var(--green-main, #166534);
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}
.patient-card-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12.5px;
  color: var(--gray-600, #4b5563);
  margin-bottom: 12px;
  line-height: 1.4;
}
.patient-card-meta strong { color: var(--gray-700, #374151); }
.patient-card-next {
  color: #1d4ed8;
  font-weight: 700;
}
.patient-card-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 6px;
  margin-bottom: 10px;
}
.patient-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 8px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  font-family: inherit;
  min-height: 40px;
  line-height: 1.2;
  white-space: nowrap;
  transition: opacity .15s;
}
.patient-action-btn:active { opacity: .8; }
.patient-action-call { background: var(--green-main, #166534); color: #fff; }
.patient-action-wa   { background: #25D366; color: #fff; }
.patient-action-email{ background: #4F46E5; color: #fff; }

.patient-card-coords {
  font-size: 11.5px;
  color: var(--gray-500, #6b7280);
  line-height: 1.5;
  padding-top: 10px;
  border-top: 1px dashed var(--gray-200, #e5e7eb);
}

/* Table desktop : cachée <768px */
.patients-table-wrap { display: none; }
@media (min-width: 768px) {
  .patients-table-wrap { display: block; }
}

/* Boutons d'action dans la table desktop : icônes compactes */
.patient-row-actions {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}
.patient-row-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  font-size: 14px;
  text-decoration: none;
  font-family: inherit;
  transition: opacity .15s, transform .15s;
}
.patient-row-btn:hover { transform: translateY(-1px); }
.patient-row-btn-call { background: var(--green-main, #166534); color: #fff; }
.patient-row-btn-wa   { background: #25D366; color: #fff; }
.patient-row-btn-email{ background: #4F46E5; color: #fff; }

.patient-row-coords {
  font-size: 12.5px;
  color: var(--gray-700, #374151);
  line-height: 1.45;
}

/* ════════════════════════════════════════════════════════════════════
   PHASE 2.1 — LOT 2 — Assurances acceptées (item #5)
   ════════════════════════════════════════════════════════════════════ */

/* ── Espace médecin : grille de checkboxes (1 col mobile, 2 col ≥480, 3 col ≥768) ── */
.assurances-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 480px) {
  .assurances-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 768px) {
  .assurances-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Carte cliquable d'une assurance (cohérent avec le pattern des langues) */
.assurance-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  background: var(--gray-50, #f9fafb);
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13.5px;
  transition: all .15s;
  user-select: none;
  min-height: 44px; /* tappable iOS */
}
.assurance-item:hover {
  background: #fff;
  border-color: var(--gray-300, #d1d5db);
}
.assurance-item.is-checked {
  background: var(--green-pale, #f0fdf4);
  border-color: var(--green-main, #166534);
}
.assurance-item input[type="checkbox"] {
  margin: 0;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--green-main, #166534);
}
.assurance-label {
  flex: 1;
  color: var(--gray-700, #374151);
  font-weight: 500;
  line-height: 1.3;
}
.assurance-item.is-checked .assurance-label {
  color: var(--green-dark, #0d4a28);
  font-weight: 600;
}

/* ── Affichage public dans la modale : tags d'assurances ── */
.med-assurances {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.med-assurance-tag {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  line-height: 1.3;
}

/* ── Feedback "cochée" côté admin (background appliqué via JS) ── */
.adm-assurance-row:hover {
  background: var(--gray-50, #f9fafb);
}
