/* Polices auto-hébergées (site public) : fichiers variables, un seul woff2
   sert les graisses 400/600/700 — cf. frontend/static/frontend/fonts/. */
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/figtree-latin.202cfb54d4e6.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}
@font-face {
  font-family: "Noto Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/noto-sans-latin.10f8972e3579.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}

:root {
  /* Palette officielle CABDOK — reprise des deux couleurs du logo :
     turquoise ("cab") et violet profond ("dok"). */
  --primary: #14877c;
  --primary-dark: #0d5f57;
  --primary-light: #e3f4f2;
  --accent: #259d93;
  --secondary: #36035f;
  --secondary-dark: #220340;
  --secondary-light: #efe7f7;
  --ink: #1a2b2a;
  --ink-soft: #5c6b6a;
  --border: #e5eceb;
  --bg: #f4f7f7;
  --card: #ffffff;
  --danger: #b3401f;
  --danger-bg: #fbeae5;
  --warn: #a5730f;
  --warn-bg: #fbf1de;
  --ok: #1a7a4c;
  --ok-bg: #e6f5ec;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --shadow: 0 1px 2px rgba(16, 40, 38, 0.05), 0 2px 12px rgba(16, 40, 38, 0.05);
  --shadow-lift: 0 10px 28px rgba(16, 40, 38, 0.13);
  /* Site public : ombres plus douces et superposées (redesign 2026-09). */
  --shadow-soft: 0 1px 2px rgba(16, 40, 38, 0.04), 0 10px 30px -10px rgba(16, 40, 38, 0.10);
  --shadow-soft-lift: 0 24px 48px -16px rgba(16, 40, 38, 0.20), 0 2px 6px rgba(16, 40, 38, 0.06);
  --font-heading: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-body: "Noto Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --icon-blue: #2f6fed; --icon-blue-bg: #e8f0fe;
  --icon-green: #1a9c63; --icon-green-bg: #e1f7ec;
  --icon-orange: #d98a1b; --icon-orange-bg: #fdf0dd;
  --icon-purple: #8151e0; --icon-purple-bg: #f1eafd;
  /* Palette design — deux couleurs d'accent en plus du vert de marque :
     corail (chaleur, alerte douce) et indigo (info, planification). */
  --coral: #ef6a56; --coral-dark: #d54f3c; --coral-bg: #fdece8;
  --indigo: #3d5ce0; --indigo-dark: #2c45b8; --indigo-bg: #e9edfd;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { letter-spacing: -0.01em; }

/* ---------- Layout ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--secondary) 0%, var(--secondary-dark) 100%);
  color: #eafbf6;
  display: flex;
  flex-direction: column;
  padding: 20px 0;
  /* Reste visible pendant qu'on fait défiler une page longue (ex. consultation avec
     beaucoup de champs de spécialité) — sinon le menu disparaît une fois qu'on a
     dépassé sa hauteur, et il faut remonter tout en haut pour changer de page. */
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-weight: 700;
  font-size: 17px;
  padding: 0 20px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  margin-bottom: 14px;
}
.sidebar .brand small { display: block; width: 100%; font-weight: 400; opacity: 0.7; font-size: 12px; }
.brand-icon { margin-right: 2px; }

/* ---------- Logo (coin de chaque page + page d'accueil) ---------- */
.brand-logo {
  width: 148px; height: 52px; object-fit: contain; border-radius: 10px;
  flex-shrink: 0; background: #fff; padding: 8px 10px; box-sizing: border-box;
  box-shadow: var(--shadow);
}
.portal-hero-logo {
  width: 300px; height: 130px; object-fit: contain; border-radius: 22px;
  background: #fff; padding: 18px 24px; box-sizing: border-box;
  box-shadow: var(--shadow-lift); margin-bottom: 10px;
}
.login-card-logo {
  width: 160px; height: 66px; object-fit: contain; border-radius: 12px;
  background: #fff; padding: 10px 12px; box-sizing: border-box;
  box-shadow: var(--shadow); margin-bottom: 12px;
}
.sidebar nav { padding: 0 12px; }
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #c9e6df;
  padding: 9px 12px;
  font-size: 14px;
  border-radius: 9px;
  margin: 2px 0;
  transition: background 0.12s ease, color 0.12s ease;
}
.sidebar nav a:hover { background: rgba(255,255,255,0.08); color: #fff; text-decoration: none; }
.sidebar nav a.active { background: #ffffff; color: var(--primary); font-weight: 700; box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.sidebar .nav-section-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700;
  color: rgba(234,251,246,0.4); padding: 14px 12px 6px 12px;
}
.sidebar .nav-section-label:first-child { padding-top: 4px; }
.sidebar-ad {
  margin: 16px 20px 0 20px; padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.12);
}
.sidebar-ad-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em;
  color: rgba(255,255,255,0.5); margin-bottom: 6px;
}
.sidebar-ad img {
  display: block; width: 100%; border-radius: 8px;
}
.sidebar .user-box {
  margin-top: auto;
  padding: 16px 20px 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.12);
  font-size: 13px;
  opacity: 0.9;
}
.sidebar .user-box-name { font-weight: 600; color: #eafbf6; }
.sidebar .user-box-role { font-size: 12px; opacity: 0.75; margin-bottom: 6px; }
.sidebar .user-box form { margin-top: 6px; }
.sidebar .user-box button {
  background: none; border: none; color: #d7ece7; padding: 0;
  font-size: 13px; cursor: pointer; text-decoration: underline;
}

.main { flex: 1; padding: 28px 36px; max-width: 1100px; min-width: 0; }

.sidebar-toggle-btn {
  display: none; position: fixed; top: 14px; left: 14px; z-index: 1100;
  width: 42px; height: 42px; align-items: center; justify-content: center;
  border: none; border-radius: 10px; background: var(--secondary); color: #fff;
  font-size: 19px; line-height: 1; cursor: pointer; box-shadow: var(--shadow-lift);
}
.sidebar-overlay {
  display: none; position: fixed; inset: 0; background: rgba(10, 8, 20, 0.45); z-index: 900;
}
.sidebar-overlay.visible { display: block; }

@media (max-width: 900px) {
  .sidebar-toggle-btn { display: flex; }
  .app-shell { flex-direction: column; }
  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh; width: 260px; z-index: 1000;
    transform: translateX(-100%); transition: transform 0.22s ease; overflow-y: auto;
  }
  .sidebar.open { transform: translateX(0); }
  .main { padding: 76px 16px 28px 16px; max-width: 100%; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .page-header > div:last-child, .page-header > form { width: 100%; }
  .field-row { grid-template-columns: 1fr; }
  .card:has(> table) { overflow-x: auto; }
  table { min-width: 540px; }
  .card { padding: 16px; }
  .dash-hero { padding: 22px 20px; flex-wrap: wrap; gap: 14px; }
  .dash-hero h1 { font-size: 19px; }
  .dash-hero-icon { width: 52px; height: 52px; }
  .dash-hero-icon svg { width: 28px; height: 28px; }
  .stat-cards { gap: 12px; }
  .stat-card { min-width: 140px; padding: 14px 16px; }
  .tab-bar a { padding: 9px 12px; font-size: 13px; }
  .entity-header { flex-wrap: wrap; }
  .btn { padding: 9px 14px; }
}

@media (max-width: 480px) {
  .stat-card { min-width: 100%; }
  .dash-hero-icon { display: none; }
  .main { padding: 70px 12px 24px 12px; }
  .card { padding: 14px; }
}

.page-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 22px; flex-wrap: wrap; gap: 12px; }
.page-header h1 { font-size: 21px; margin: 0; }
.page-header .subtitle { color: var(--ink-soft); font-size: 13px; margin-top: 2px; }

/* ---------- En-tête fiche patient (avatar + méta) ---------- */
.entity-header { display: flex; align-items: center; gap: 16px; }
.entity-header-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; font-size: 12.5px; color: var(--ink-soft); }
.entity-header-meta span { white-space: nowrap; }
.patient-header-card { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.patient-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.patient-header-card h1 { font-size: 19px; margin: 0; }

/* ---------- Barre d'onglets (navigation par ancre, fiche patient) ---------- */
.tab-bar {
  display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--border);
  margin-bottom: 20px; padding: 0 2px;
}
.tab-bar a {
  padding: 10px 16px; font-size: 13.5px; font-weight: 600; color: var(--ink-soft);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab-bar a:hover { text-decoration: none; }
.tab-bar a.tab-teal:hover { color: var(--primary); border-bottom-color: var(--primary); }
.tab-bar a.tab-purple:hover { color: var(--icon-purple); border-bottom-color: var(--icon-purple); }
.tab-bar a.tab-coral:hover { color: var(--coral-dark); border-bottom-color: var(--coral); }
.tab-bar a.tab-indigo:hover { color: var(--indigo-dark); border-bottom-color: var(--indigo); }
.tab-bar a.tab-green:hover { color: var(--ok); border-bottom-color: var(--ok); }
.tab-bar a.tab-orange:hover { color: var(--icon-orange); border-bottom-color: var(--icon-orange); }

/* ---------- Accents colorés par section (fiche patient) ---------- */
.card-accent-teal { border-left: 4px solid var(--primary); }
.card-accent-purple { border-left: 4px solid var(--icon-purple); }
.card-accent-coral { border-left: 4px solid var(--coral); }
.card-accent-indigo { border-left: 4px solid var(--indigo); }
.card-accent-green { border-left: 4px solid var(--ok); }
.card-accent-orange { border-left: 4px solid var(--icon-orange); }

/* ---------- Pastilles de méta-info colorées (en-tête fiche patient) ---------- */
.meta-pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.meta-pill.green { background: var(--ok-bg); color: var(--ok); }
.meta-pill.orange { background: var(--icon-orange-bg); color: var(--icon-orange); }
.meta-pill.indigo { background: var(--indigo-bg); color: var(--indigo-dark); }

/* ---------- Icônes colorées (grille Informations générales) ---------- */
.info-item-row { display: flex; align-items: flex-start; gap: 10px; }
.info-icon {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 28px; height: 28px; border-radius: 8px; font-size: 13px;
}
.info-icon.teal { background: var(--primary-light); color: var(--primary-dark); }
.info-icon.orange { background: var(--icon-orange-bg); color: var(--icon-orange); }
.info-icon.purple { background: var(--icon-purple-bg); color: var(--icon-purple); }
.info-icon.green { background: var(--icon-green-bg); color: var(--icon-green); }
.info-icon.blue { background: var(--icon-blue-bg); color: var(--icon-blue); }
.info-icon.coral { background: var(--coral-bg); color: var(--coral-dark); }
.info-icon.indigo { background: var(--indigo-bg); color: var(--indigo-dark); }

/* ---------- Champs teintés (Antécédents & allergies) ---------- */
.field-tint-coral { border-left: 3px solid var(--coral); background: var(--coral-bg); padding: 10px 12px 12px 12px; border-radius: 0 8px 8px 0; }
.field-tint-orange { border-left: 3px solid var(--icon-orange); background: var(--icon-orange-bg); padding: 10px 12px 12px 12px; border-radius: 0 8px 8px 0; }
.field-tint-teal { border-left: 3px solid var(--primary); background: var(--primary-light); padding: 10px 12px 12px 12px; border-radius: 0 8px 8px 0; }

/* ---------- Puces colorées (liste des consultations) ---------- */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.dot-c0 { background: var(--indigo); }
.dot-c1 { background: var(--primary); }
.dot-c2 { background: var(--icon-purple); }
.dot-c3 { background: var(--icon-orange); }
.dot-c4 { background: #d6478a; }
.dot-c5 { background: #2ba3a3; }

/* ---------- Section repliable (Informations générales) ---------- */
.info-collapse summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px;
  font-size: 15px; font-weight: 700; color: var(--ink);
}
.info-collapse summary::-webkit-details-marker { display: none; }
.info-collapse summary::after {
  content: "▾"; color: var(--ink-soft); font-size: 12px; margin-left: 4px;
  transition: transform 0.15s ease; flex-shrink: 0;
}
.info-collapse[open] summary::after { transform: rotate(180deg); }
.info-summary-preview { font-size: 12.5px; font-weight: 500; color: var(--ink-soft); }
.info-summary-hint {
  margin-left: auto; font-size: 11.5px; font-weight: 700; color: var(--primary);
  background: var(--primary-light); padding: 3px 10px; border-radius: 999px; white-space: nowrap;
}
.info-collapse[open] .info-summary-hint { display: none; }
.info-collapse .info-grid { margin-top: 18px; }

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 20px;
  transition: box-shadow 0.15s ease;
}
.card:hover { box-shadow: var(--shadow-lift); }
.card h2 { font-size: 15px; margin: 0 0 14px 0; color: var(--ink); }
.card h2 .count { color: var(--ink-soft); font-weight: 400; }

/* ---------- Bannière d'accueil (tableau de bord) ---------- */
.dash-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  border-radius: var(--radius-lg); padding: 30px 34px; margin-bottom: 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  color: #fff; box-shadow: var(--shadow-lift); position: relative; overflow: hidden;
}
.dash-hero-content { position: relative; z-index: 1; }
.dash-hero-badge {
  display: inline-block; background: rgba(255,255,255,0.16); color: #fff;
  font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 999px;
  margin-bottom: 10px; text-transform: capitalize; letter-spacing: 0.01em;
}
.dash-hero h1 { color: #fff; margin: 0; font-size: 23px; }
.dash-hero .subtitle { color: rgba(255,255,255,0.85); margin-top: 5px; font-size: 13.5px; }
.dash-hero-icon {
  position: relative; z-index: 1; flex-shrink: 0; width: 78px; height: 78px;
  border-radius: 50%; background: rgba(255,255,255,0.14); display: flex;
  align-items: center; justify-content: center;
}
.dash-hero-icon svg { width: 38px; height: 38px; stroke: #fff; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: 0.9; }
.dash-hero-blob { position: absolute; border-radius: 50%; background: rgba(255,255,255,0.08); pointer-events: none; }
.dash-hero-blob-1 { width: 220px; height: 220px; top: -110px; right: 40px; }
.dash-hero-blob-2 { width: 140px; height: 140px; bottom: -80px; right: 200px; background: rgba(255,255,255,0.06); }

/* ---------- Courbe d'activité (tableau de bord) ---------- */
.sparkline { width: 100%; height: 110px; display: block; }
.sparkline-labels { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11px; color: var(--ink-soft); }

/* ---------- Stat cards (tableau de bord) ---------- */
.stat-cards { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.stat-card {
  flex: 1; min-width: 180px; display: flex; align-items: center; gap: 14px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 18px 20px; transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.stat-card:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.stat-card-icon {
  width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.stat-card-icon svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.stat-card-icon.blue { background: var(--icon-blue-bg); color: var(--icon-blue); }
.stat-card-icon.green { background: var(--icon-green-bg); color: var(--icon-green); }
.stat-card-icon.orange { background: var(--icon-orange-bg); color: var(--icon-orange); }
.stat-card-icon.purple { background: var(--icon-purple-bg); color: var(--icon-purple); }
.stat-card .num { font-size: 23px; font-weight: 800; color: var(--ink); line-height: 1.15; }
.stat-card .label { font-size: 12.5px; color: var(--ink-soft); margin-top: 1px; }

/* ---------- Avatars (initiales) ---------- */
.avatar-circle {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 40px; height: 40px; border-radius: 50%; background: var(--primary-light);
  color: var(--primary-dark); font-weight: 700; font-size: 14px;
}
.avatar-circle.lg { width: 64px; height: 64px; font-size: 22px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 820px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- Table ---------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--ink-soft); font-weight: 700; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; padding: 10px; background: var(--bg); }
thead th:first-child { border-radius: 8px 0 0 8px; }
thead th:last-child { border-radius: 0 8px 8px 0; }
td { padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:hover td { background: var(--bg); }
tr:last-child td { border-bottom: none; }
.empty-row { color: var(--ink-soft); font-style: italic; padding: 16px 10px; }

/* Tableau "fiche" (libellé à gauche / valeur à droite), utilisé pour les
   informations générales d'un patient. */
.card table:not(:has(thead)) th {
  text-transform: none; font-size: 14px; font-weight: 600; color: var(--ink-soft);
  border-bottom: none; background: transparent; width: 200px;
}
.card table:not(:has(thead)) td { border-bottom: 1px solid var(--border); }
.card table:not(:has(thead)) tr:last-child td { border-bottom: none; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-wait { background: var(--warn-bg); color: var(--warn); }
.badge-progress { background: var(--primary-light); color: var(--primary-dark); }
.badge-done { background: var(--ok-bg); color: var(--ok); }
.badge-none { background: #eef1f1; color: var(--ink-soft); }
.badge-info { background: var(--indigo-bg); color: var(--indigo-dark); }
.badge-cancelled { background: var(--coral-bg); color: var(--coral-dark); }
.badge-live { background: var(--ok-bg); color: var(--ok); }

/* ---------- Ligne de rendez-vous colorée par statut (agenda) ---------- */
.appt-row-scheduled { border-left: 3px solid var(--indigo); }
.appt-row-confirmed { border-left: 3px solid var(--primary); }
.appt-row-completed { border-left: 3px solid var(--ok); }
.appt-row-cancelled, .appt-row-no_show { border-left: 3px solid var(--coral); }

/* ---------- Forms ---------- */
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: var(--ink); }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=datetime-local], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 7px;
  font-size: 14px; font-family: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.field { margin-bottom: 14px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ---------- Champs personnalisés (distincts des champs standards) ---------- */
.field-custom {
  border-left: 3px solid var(--icon-purple); background: var(--icon-purple-bg);
  padding: 10px 12px 12px 12px; border-radius: 0 8px 8px 0;
}
.field-custom label { color: var(--icon-purple); display: flex; align-items: center; gap: 6px; }
.field-custom label::after {
  content: "Personnalisé"; font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.03em; background: #fff; color: var(--icon-purple);
  border-radius: 999px; padding: 2px 7px; margin-left: auto;
}

.btn {
  display: inline-block; padding: 9px 18px; border-radius: 8px; font-size: 14px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; background: var(--primary); color: white;
  box-shadow: 0 1px 2px rgba(10,77,66,0.15);
  transition: background 0.12s ease, transform 0.06s ease;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-secondary { background: white; color: var(--ink); border-color: var(--border); }
.btn-secondary:hover { background: #f1f4f3; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #8f3319; }
.btn-disabled, .btn-disabled:hover {
  background: #ccc; color: #777; cursor: not-allowed; box-shadow: none; pointer-events: none;
}

/* ---------- Alerts ---------- */
.alert { padding: 11px 14px; border-radius: 7px; font-size: 13px; margin-bottom: 16px; }
.alert-error { background: var(--danger-bg); color: var(--danger); }
.alert-ok { background: var(--ok-bg); color: var(--ok); }

/* ---------- Landing page (page d'accueil / connexion) ---------- */
.landing {
  font-family: var(--font-body);
  background:
    radial-gradient(circle at 50% 0%, #e9f7f5 0%, transparent 55%),
    #fbfdfd;
}
.landing h1, .landing h2, .landing h3,
.login-wrap h1, .login-wrap h2 { font-family: var(--font-heading); }

.landing-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 40px; background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: saturate(160%) blur(10px); backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.landing-nav-links { display: flex; align-items: center; gap: 26px; }
.landing-nav-links a:not(.btn) { color: var(--ink); font-weight: 600; font-size: 14px; }
.landing-nav-links a:not(.btn):hover { color: var(--primary); text-decoration: none; }
.landing-nav-toggle {
  display: none; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px; background: none; border: none; font-size: 22px; cursor: pointer;
  color: var(--ink); padding: 4px 8px; line-height: 1; border-radius: 8px;
}
.landing-nav-toggle:hover { background: var(--primary-light); }

.landing-hero {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 44px; padding: 64px 40px 0 40px; max-width: 1100px; margin: 0 auto;
  color: #fff;
  background:
    radial-gradient(circle at 85% 12%, rgba(34, 197, 94, 0.32) 0%, transparent 50%),
    radial-gradient(circle at 12% 88%, rgba(16, 163, 74, 0.22) 0%, transparent 55%),
    linear-gradient(160deg, #050605 0%, #0d1710 100%);
}
.landing-hero-split {
  flex-direction: row; align-items: center; text-align: left;
  width: 100%; max-width: none; margin: 0;
  gap: 56px; padding: 70px max(40px, calc((100% - 1280px) / 2));
}
.landing-hero-split .landing-hero-text { max-width: 520px; flex: 1 1 460px; }
.landing-hero-split .landing-hero-text p { margin: 0 0 26px 0; }
.landing-hero-split .landing-hero-highlights { justify-content: flex-start; }
.landing-hero-split .landing-hero-actions { justify-content: flex-start; }
.landing-hero-split .landing-hero-visual { flex: 1 1 480px; width: auto; }
.landing-hero-split .landing-hero-screenshot.mockup-window { margin-bottom: 0; max-width: 100%; }
.landing-hero-screenshot.mockup-window {
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.landing-hero-text { max-width: 680px; }
.landing-eyebrow {
  display: inline-block; background: rgba(255, 255, 255, 0.12); color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 13.5px; font-weight: 700; padding: 6px 16px; border-radius: 999px; margin-bottom: 20px;
  letter-spacing: 0.01em;
}
.landing-hero-text h1 { font-size: 46px; font-weight: 700; line-height: 1.14; margin: 0 0 18px 0; color: #fff; letter-spacing: -0.02em; }
.landing-hero-text h1 span { color: #4ade80; }
.landing-hero-text p { font-size: 16.5px; color: rgba(255, 255, 255, 0.78); line-height: 1.65; max-width: 520px; margin: 0 auto 26px auto; }
.landing-hero-highlights {
  display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 0 0 26px 0;
}
.landing-hero-highlights span {
  display: inline-flex; align-items: center; gap: 9px; border: 1px solid rgba(255, 255, 255, 0.14); color: var(--ink);
  font-size: 14.5px; font-weight: 700; padding: 7px 16px 7px 7px; border-radius: 999px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}
.landing-hero-highlights .hl-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px;
  border-radius: 50%; flex-shrink: 0;
}
.landing-hero-highlights .hl-icon svg {
  width: 15px; height: 15px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2.2;
  stroke-linecap: round; stroke-linejoin: round;
}
.landing-hero-highlights .hl-blue { background: var(--icon-blue-bg); }
.landing-hero-highlights .hl-blue .hl-icon { background: #fff; color: var(--icon-blue); }
.landing-hero-highlights .hl-green { background: var(--icon-green-bg); }
.landing-hero-highlights .hl-green .hl-icon { background: #fff; color: var(--icon-green); }
.landing-hero-highlights .hl-coral { background: var(--coral-bg); }
.landing-hero-highlights .hl-coral .hl-icon { background: #fff; color: var(--coral-dark); }
.landing-hero-highlights .hl-orange { background: var(--icon-orange-bg); }
.landing-hero-highlights .hl-orange .hl-icon { background: #fff; color: var(--icon-orange); }
.landing-hero-highlights .hl-indigo { background: var(--indigo-bg); }
.landing-hero-highlights .hl-indigo .hl-icon { background: #fff; color: var(--indigo-dark); }
.landing-hero-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.landing-hero-actions .btn { padding: 12px 22px; font-size: 15px; }

/* Site public : les boutons d'action principaux passent en indigo (au lieu du
   teal partagé avec l'app authentifiée) pour marquer une identité propre au
   site vitrine. .btn-secondary et .btn-whatsapp gardent leur propre style. */
.landing .btn:not(.btn-secondary):not(.btn-whatsapp),
.login-wrap .btn:not(.btn-secondary):not(.btn-whatsapp) {
  background: #22c55e; border-color: #22c55e; color: #050605;
}
.landing .btn:not(.btn-secondary):not(.btn-whatsapp):hover,
.login-wrap .btn:not(.btn-secondary):not(.btn-whatsapp):hover {
  background: #16a34a; border-color: #16a34a;
}

.landing-hero-visual { width: 100%; position: relative; display: flex; justify-content: center; }
.landing-hero-screenshot.mockup-window {
  transform: none; max-width: 1100px; width: 100%; margin-bottom: -80px;
}
.landing-hero-screenshot img { display: block; width: 100%; height: auto; }
.mockup-window {
  width: 100%; max-width: 420px; background: #fff; border-radius: var(--radius-xl); overflow: hidden;
  box-shadow: var(--shadow-soft-lift); transform: rotate(-2deg); border: 1px solid var(--border);
}
.mockup-titlebar { display: flex; gap: 6px; padding: 10px 14px; background: #f1f4f3; }
.mockup-titlebar span { width: 9px; height: 9px; border-radius: 50%; background: #d7dedd; }
.mockup-body { display: flex; }
.mockup-sidebar {
  width: 68px; background: linear-gradient(180deg, var(--secondary) 0%, var(--secondary-dark) 100%);
  padding: 14px 10px; display: flex; flex-direction: column; gap: 10px;
}
.mockup-sidebar-logo { width: 22px; height: 22px; border-radius: 6px; background: rgba(255,255,255,0.9); margin-bottom: 6px; }
.mockup-sidebar-item { height: 8px; border-radius: 4px; background: rgba(255,255,255,0.25); }
.mockup-sidebar-item.active { background: #fff; }
.mockup-content { flex: 1; padding: 16px; background: var(--bg); }
.mockup-hero { height: 46px; border-radius: 10px; background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%); margin-bottom: 12px; }
.mockup-stats { display: flex; gap: 8px; margin-bottom: 12px; }
.mockup-stat { flex: 1; height: 30px; border-radius: 8px; background: var(--icon-blue-bg); }
.mockup-stat.orange { background: var(--icon-orange-bg); }
.mockup-stat.green { background: var(--icon-green-bg); }
.mockup-table { background: #fff; border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.mockup-row { height: 7px; border-radius: 4px; background: var(--border); }
.mockup-row:nth-child(2) { width: 80%; }
.mockup-row:nth-child(3) { width: 60%; }
.mockup-float {
  position: absolute; background: #fff; border-radius: 10px; padding: 8px 14px;
  box-shadow: var(--shadow-lift); font-size: 12.5px; font-weight: 700; color: var(--ink);
  border: 1px solid var(--border);
}
.mockup-float-1 { top: 6%; right: -4%; }
.mockup-float-2 { bottom: 10%; left: -6%; }
@media (max-width: 720px) { .mockup-float { display: none; } }

.landing-security { padding: 56px 40px 24px; max-width: 1180px; margin: 0 auto; }
.landing-security-row { display: flex; align-items: center; gap: 56px; }
.landing-security-text { flex: 1 1 460px; text-align: left; }
.landing-security-text h2 { font-size: 32px; font-weight: 700; margin: 14px 0 10px; color: var(--ink); letter-spacing: -0.01em; }
.landing-security-text .landing-section-subtitle { max-width: none; margin: 0 0 22px; }
.landing-security-text .landing-check-list { margin-bottom: 26px; }
.landing-security-badge {
  display: inline-flex; align-items: center; gap: 8px; background: var(--primary-light); color: var(--primary-dark);
  font-size: 13px; font-weight: 700; padding: 7px 16px; border-radius: 999px;
}
.landing-security-badge svg { stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.landing-security-video {
  flex: 1 1 420px; max-width: 420px; aspect-ratio: 1 / 1; border-radius: var(--radius-xl); overflow: hidden;
  border: 4px solid var(--primary); box-shadow: var(--shadow-soft-lift); background: #0b2a27;
}
.landing-security-video video { display: block; width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 860px) {
  .landing-security-row { flex-direction: column; }
  .landing-security-text { text-align: left; }
  .landing-security-video { width: 100%; max-width: none; flex: 0 0 auto; }
}

.landing-features { padding: 70px 40px; max-width: 1180px; margin: 0 auto; text-align: center; }
.landing-features-header {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 40px;
  text-align: left; margin-bottom: 44px; flex-wrap: wrap;
}
.landing-kicker {
  display: block; font-size: 12.5px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.09em; color: var(--primary); margin-bottom: 10px;
}
.landing-features h2 { font-size: 32px; font-weight: 700; margin: 0; color: var(--ink); text-align: left; max-width: 480px; letter-spacing: -0.01em; }
.landing-section-subtitle { color: var(--ink-soft); font-size: 15px; margin: 0; max-width: 320px; text-align: left; }
.landing-features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; text-align: left; }
.landing-feature {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-xl);
  padding: 24px; box-shadow: var(--shadow-soft); transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.landing-feature:hover { transform: translateY(-4px); box-shadow: var(--shadow-soft-lift); border-color: var(--primary-light); }
.landing-feature-highlight {
  grid-column: span 2; padding: 30px;
  background: linear-gradient(120deg, var(--primary-light) 0%, #fff 70%);
  border-color: var(--primary-light);
}
.landing-feature-highlight .landing-feature-icon { width: 68px; height: 68px; }
.landing-feature-highlight h3 { font-size: 21px; }
.landing-feature-highlight p { font-size: 15px; max-width: 440px; }
@media (max-width: 700px) {
  .landing-features-header { align-items: flex-start; }
  .landing-feature-highlight { grid-column: span 1; }
}
.landing-feature-icon {
  width: 56px; height: 56px; border-radius: 14px; display: flex; align-items: center;
  justify-content: center; margin-bottom: 16px;
}
.landing-feature-icon.blue { background: var(--icon-blue-bg); color: var(--icon-blue); }
.landing-feature-icon.green { background: var(--icon-green-bg); color: var(--icon-green); }
.landing-feature-icon.orange { background: var(--icon-orange-bg); color: var(--icon-orange); }
.landing-feature-icon.purple { background: var(--icon-purple-bg); color: var(--icon-purple); }
.landing-feature-icon.coral { background: var(--coral-bg); color: var(--coral-dark); }
.landing-feature-icon.indigo { background: var(--indigo-bg); color: var(--indigo-dark); }
.landing-feature-icon svg { width: 30px; height: 30px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.landing-feature-highlight .landing-feature-icon svg { width: 36px; height: 36px; }
.landing-feature h3 { font-size: 18.5px; font-weight: 800; margin: 0 0 8px 0; color: var(--ink); }
.landing-feature p { font-size: 14.5px; color: var(--ink-soft); line-height: 1.55; margin: 0; }

.landing-showcase { display: flex; flex-direction: column; gap: 76px; margin-top: 64px; text-align: left; }
.landing-showcase-row { display: flex; align-items: center; gap: 52px; }
.landing-showcase-row.reverse { flex-direction: row-reverse; }
.landing-showcase-text { flex: 0 0 300px; }
.landing-showcase-text h3 { font-size: 22px; margin: 0 0 12px 0; color: var(--ink); }
.landing-showcase-text p { font-size: 15px; color: var(--ink-soft); line-height: 1.6; margin: 0; }
.landing-showcase-image {
  flex: 1; min-width: 280px; background: #fff; border-radius: var(--radius-xl);
  overflow: hidden; box-shadow: var(--shadow-soft-lift); border: 1px solid var(--border);
  transition: transform 0.2s ease;
}
.landing-check-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.landing-check-list li { display: flex; align-items: flex-start; gap: 12px; }
.landing-check-list .check-icon {
  flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%; background: var(--ok-bg); color: var(--ok);
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; margin-top: 2px;
}
.landing-check-list strong { display: block; font-size: 15px; color: var(--ink); margin-bottom: 2px; }
.landing-check-list p { font-size: 13.5px; color: var(--ink-soft); line-height: 1.5; margin: 0; }
.landing-showcase-image img { display: block; width: 100%; height: auto; }
.landing-showcase-row.compact { max-width: 780px; margin: 0 auto; gap: 36px; }
.landing-showcase-row.compact .landing-showcase-text { flex-basis: 240px; }
.landing-showcase-row.compact .landing-showcase-text h3 { font-size: 19px; }
.landing-showcase-row.compact .landing-showcase-text p { font-size: 14px; }
.landing-showcase-row.compact .landing-showcase-image { min-width: 200px; }
@media (max-width: 860px) {
  .landing-showcase-row, .landing-showcase-row.reverse, .landing-showcase-row.compact { flex-direction: column; }
  .landing-showcase-row.compact { max-width: none; margin: 0; }
  .landing-showcase-text { flex-basis: auto; }
}

.landing-login {
  padding: 70px 20px 60px 20px;
  background: radial-gradient(circle at 15% 0%, #259d9330 0%, transparent 45%),
              radial-gradient(circle at 88% 92%, #36035f26 0%, transparent 45%),
              radial-gradient(rgba(20,135,124,0.14) 1.4px, transparent 1.4px) 0 0/22px 22px,
              var(--bg);
  display: flex; flex-direction: column; align-items: center;
}

.landing-footer {
  text-align: center; padding: 40px 20px; border-top: 1px solid var(--border);
  background: #fff; color: var(--ink-soft); font-size: 13px;
}
.landing-footer .brand-logo { margin-bottom: 12px; }

@media (max-width: 860px) {
  .landing-hero { padding: 44px 22px 0 22px; }
  .landing-hero-screenshot { margin-bottom: -40px; }
  .landing-hero-text p { margin-left: auto; margin-right: auto; }
  .landing-hero-actions { justify-content: center; }
  .landing-hero-split {
    flex-direction: column; text-align: center; padding: 44px 22px 0 22px; gap: 40px;
  }
  .landing-hero-split .landing-hero-text { max-width: 560px; text-align: center; }
  .landing-hero-split .landing-hero-text p { margin: 0 auto 26px auto; }
  .landing-hero-split .landing-hero-highlights { justify-content: center; }
  .landing-hero-split .landing-hero-actions { justify-content: center; }
  .landing-hero-split .landing-hero-screenshot.mockup-window { margin-bottom: -40px; }
  .landing-nav { padding: 12px 18px; }
  .landing-nav-links { gap: 14px; }
  .landing-features { padding: 50px 20px; }
}

@media (max-width: 720px) {
  .landing-nav { position: relative; }
  .landing-nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .landing-nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 30;
    flex-direction: column; align-items: stretch; gap: 4px;
    background: #fff; border-bottom: 1px solid var(--border); padding: 14px 18px; box-shadow: var(--shadow-lift);
  }
  .landing-nav-links.open { display: flex; }
  .landing-nav-links a:not(.btn) { padding: 10px 4px; border-bottom: 1px solid var(--border); }
  .landing-nav-links a.btn { width: 100%; text-align: center; margin-top: 4px; }
}

/* ---------- Login / page d'accueil (sélecteur de rôle) ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  font-family: var(--font-body);
  background: radial-gradient(circle at 50% 0%, #e9f7f5 0%, transparent 55%), var(--bg);
}
.login-card { width: 380px; max-width: 100%; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-soft); padding: 32px; }
.login-hint { text-align: center; color: var(--ink-soft); font-size: 15px; font-weight: 600; margin: 8px 0 0 0; }
.login-card h1, .login-card h2 { font-size: 19px; margin: 0 0 4px 0; }
.login-card .subtitle { color: var(--ink-soft); font-size: 13px; margin-bottom: 22px; }
.login-alt-link { text-align: center; font-size: 13px; color: var(--ink-soft); margin-top: 16px; }

.portal-page {
  min-height: 100vh;
  background: radial-gradient(circle at 15% 0%, #259d9330 0%, transparent 45%),
              radial-gradient(circle at 88% 92%, #36035f26 0%, transparent 45%),
              radial-gradient(circle at 85% 6%, #36035f1a 0%, transparent 40%),
              radial-gradient(rgba(20,135,124,0.14) 1.4px, transparent 1.4px) 0 0/22px 22px,
              var(--bg);
  padding: 56px 20px 60px 20px;
  display: flex; flex-direction: column; align-items: center;
}
.portal-hero { text-align: center; max-width: 520px; margin-bottom: 34px; }
.portal-hero-icon { font-size: 38px; margin-bottom: 6px; }
.portal-hero h1 { font-size: 26px; margin: 0 0 8px 0; color: var(--secondary); }
.portal-hero p { color: var(--ink-soft); font-size: 14px; margin: 0; }

.role-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
  max-width: 620px; width: 100%; margin-bottom: 32px;
}
@media (max-width: 720px) {
  .role-grid { grid-template-columns: repeat(2, 1fr); }
  /* 3 cartes sur 2 colonnes : la dernière occupe toute la largeur. */
  .role-grid .role-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

.role-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px 14px; text-align: center; color: var(--ink);
  box-shadow: var(--shadow-soft); transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.role-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-soft-lift); text-decoration: none; }
.role-card.active { border-color: var(--primary); background: var(--primary-light); }
.role-card-admin { color: var(--ink-soft); }
.role-photo {
  width: 84px; height: 84px; object-fit: cover; border-radius: 50%;
  margin: 0 auto 10px auto; display: block; box-shadow: var(--shadow);
  border: 3px solid #fff;
}
.role-photo-doctor { object-position: 62% 68%; }
.role-photo-secretary { object-position: 42% 26%; }
.role-photo-patient { object-position: 55% 22%; }
.role-photo-admin { object-fit: contain; border-radius: 12px; background: #fff; padding: 6px; box-sizing: border-box; }
.role-title { font-weight: 700; font-size: 14px; margin-bottom: 3px; }
.role-desc { font-size: 12px; color: var(--ink-soft); line-height: 1.35; }

/* ---------- Espace patient ---------- */
.patient-body { background: var(--bg); }
.patient-topbar { background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.patient-topbar-inner {
  max-width: 980px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.patient-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--secondary); font-size: 16px; }
.patient-nav { display: flex; gap: 4px; }
.patient-nav a {
  padding: 8px 14px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--ink-soft);
}
.patient-nav a:hover { background: var(--primary-light); text-decoration: none; }
.patient-nav a.active { background: var(--primary); color: white; }
.patient-user { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-soft); }
.patient-user form { display: inline; }
.patient-user button { background: none; border: none; color: var(--primary); font-size: 13px; cursor: pointer; text-decoration: underline; padding: 0; }
.patient-main { max-width: 980px; margin: 0 auto; padding: 28px 24px 60px 24px; }
@media (max-width: 640px) {
  .patient-topbar-inner { padding: 12px 16px; }
  .patient-nav { gap: 2px; width: 100%; overflow-x: auto; }
  .patient-nav a { padding: 8px 10px; font-size: 13.5px; white-space: nowrap; }
  .patient-main { padding: 20px 14px 40px 14px; }
}

.specialty-filter { max-width: 640px; margin-bottom: 22px; }
.specialty-filter label { margin-bottom: 5px; }
.specialty-filter .field-row { grid-template-columns: 1fr 1fr; }
@media (max-width: 600px) { .specialty-filter .field-row { grid-template-columns: 1fr; } }

.doctor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.doctor-grid[hidden] { display: none; } /* sinon "display: grid" ci-dessus l'emporte sur l'attribut hidden */
.doctor-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; transition: box-shadow 0.12s ease, transform 0.12s ease;
}
.doctor-card:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.doctor-card-avatar { font-size: 22px; margin-bottom: 6px; }
.doctor-card-name { font-weight: 700; font-size: 15px; color: var(--primary-dark); }
.doctor-card-specialty { font-size: 12px; color: var(--ink-soft); margin-bottom: 8px; }
.doctor-card-address { font-size: 12px; color: var(--ink-soft); margin-bottom: 6px; }
.doctor-card-bio { font-size: 12px; color: var(--ink); line-height: 1.4; margin: 0; }

.booking-panel { border: 2px solid var(--primary); }
.doctor-card-selected { border-color: var(--primary); box-shadow: var(--shadow-lift); }
.slot-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.appointment-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 4px; border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.appointment-row:last-child { border-bottom: none; }
.appointment-doctor { font-weight: 600; font-size: 14px; }
.appointment-meta { font-size: 12px; color: var(--ink-soft); margin-top: 2px; text-transform: capitalize; }
.appointment-actions { display: flex; align-items: center; gap: 10px; }
.appointment-actions form { display: inline; }

.stat-row { display: flex; gap: 16px; margin-bottom: 4px; }
.stat { flex: 1; background: var(--primary-light); border-radius: var(--radius); padding: 14px 16px; }
.stat .num { font-size: 24px; font-weight: 700; color: var(--primary-dark); }
.stat .label { font-size: 12px; color: var(--ink-soft); }

/* ---------- Popup d'autocomplétion (médicaments/analyses/imagerie) ---------- */
.autocomplete-box {
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 4px 16px rgba(16,40,38,0.14); max-height: 220px; overflow-y: auto;
  z-index: 1000;
}
.autocomplete-item { padding: 8px 12px; font-size: 13px; cursor: pointer; }
.autocomplete-item:hover, .autocomplete-item.active { background: var(--primary-light); }
.autocomplete-add { color: var(--primary-dark); font-weight: 600; border-top: 1px solid var(--border); }
.autocomplete-chip {
  display: inline-flex; align-items: center; gap: 6px; background: var(--primary-light);
  color: var(--primary-dark); border-radius: 999px; padding: 4px 6px 4px 12px;
  font-size: 13px; margin: 3px 6px 3px 0;
}
.autocomplete-chip button {
  border: none; background: none; color: var(--primary-dark); cursor: pointer;
  font-size: 14px; line-height: 1; padding: 2px 4px;
}

/* ---------- Langue de l'en-tête (Mon cabinet) ---------- */
.lang-picker { display: flex; gap: 10px; flex-wrap: wrap; }
.lang-option {
  display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500;
  color: var(--ink); background: #fbfcfc; border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 12px; cursor: pointer;
}
.lang-option input { width: auto; margin: 0; }
.lang-note { font-size: 12px; color: var(--ink-soft); margin: 10px 0; }
#arabic-fields { border-top: 1px dashed var(--border); padding-top: 4px; margin-top: 4px; }
.letter-preview {
  border: 1px solid var(--border); border-radius: 8px; padding: 20px; background: #fbfcfc;
}

/* ---------- Agenda — vue calendrier mensuel ---------- */
.calendar-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; flex-wrap: wrap; gap: 10px; }
.calendar-nav { display: flex; align-items: center; gap: 14px; }
.calendar-nav-btn {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border);
  background: #fff; display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 14px; color: var(--ink); flex-shrink: 0;
}
.calendar-nav-btn:hover { background: var(--bg); text-decoration: none; }
.calendar-month-title { font-size: 17px; font-weight: 700; text-transform: capitalize; min-width: 170px; text-align: center; }
.view-toggle { display: flex; gap: 3px; background: var(--bg); border-radius: 9px; padding: 3px; }
.view-toggle a { padding: 6px 14px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.view-toggle a:hover { text-decoration: none; }
.view-toggle a.active { background: #fff; color: var(--ink); box-shadow: var(--shadow); }

.calendar-wrap { overflow-x: auto; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(108px, 1fr)); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; min-width: 760px; }
.calendar-weekday {
  background: var(--bg); padding: 9px 8px; text-align: center; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); border-bottom: 1px solid var(--border);
}
.calendar-cell { min-height: 108px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 6px; background: #fff; }
.calendar-grid > .calendar-cell:nth-child(7n) { border-right: none; }
.calendar-cell.out-month { background: var(--bg); }
.calendar-cell.out-month .calendar-day-num { color: #c3cccb; }
.calendar-day-num { font-size: 12.5px; font-weight: 700; color: var(--ink); margin-bottom: 5px; display: inline-flex; align-items: center; justify-content: center; }
.calendar-cell.is-today .calendar-day-num { background: var(--primary); color: #fff; width: 21px; height: 21px; border-radius: 50%; }
.calendar-appt {
  display: block; font-size: 11px; font-weight: 600; color: #fff; border-radius: 5px;
  padding: 2px 6px; margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.calendar-appt:hover { text-decoration: none; opacity: 0.9; }
/* Palette variée par patient — repérage rapide dans le calendrier */
.calendar-appt-c0 { background: var(--indigo); }
.calendar-appt-c1 { background: var(--primary); }
.calendar-appt-c2 { background: var(--icon-purple); }
.calendar-appt-c3 { background: var(--icon-orange); }
.calendar-appt-c4 { background: #d6478a; }
.calendar-appt-c5 { background: #2ba3a3; }
.calendar-appt-muted { background: #aeb6b5; }
.calendar-more { font-size: 10.5px; color: var(--ink-soft); padding: 0 6px; }

/* ---------- Grille d'infos horizontale (fiche patient) ---------- */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px 24px;
}
.info-grid .info-item { min-width: 0; }
.info-grid .info-item .info-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em;
  color: var(--ink-soft); font-weight: 600; margin-bottom: 3px;
}
.info-grid .info-item .info-value {
  font-size: 14px; color: var(--ink); overflow-wrap: break-word;
}
.info-grid .info-item .info-value-hint {
  font-size: 11px; color: var(--ink-soft); margin-top: 1px;
}

/* ---------- Messagerie (secrétaire) ---------- */
#mailbox-badge { margin-left: 6px; padding: 1px 7px; background: var(--coral-bg); color: var(--coral-dark); }

.message-toast-container {
  position: fixed; bottom: 20px; right: 20px; z-index: 1000;
  display: flex; flex-direction: column; gap: 10px; max-width: 320px;
}
.message-toast {
  background: var(--surface, #fff); border: 1px solid var(--border);
  border-left: 4px solid var(--primary); border-radius: 8px; padding: 12px 14px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12); animation: toast-in 0.2s ease-out;
}
.message-toast strong { display: block; font-size: 13px; margin-bottom: 4px; }
.message-toast p { font-size: 13px; color: var(--ink-soft); margin: 0; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ===== Pages publiques : accueil, contact, pages légales ===== */
.landing-footer-links { display: flex; justify-content: center; gap: 22px; flex-wrap: wrap; margin: 0 0 14px; }
.landing-footer-links a { color: var(--ink-soft); font-weight: 600; }
.landing-footer-links a:hover { color: var(--primary); }

.landing-free {
  max-width: 1000px; margin: 20px auto 10px; padding: 52px 30px; text-align: center;
  background:
    radial-gradient(circle at 85% 15%, rgba(34, 197, 94, 0.30) 0%, transparent 55%),
    radial-gradient(circle at 12% 85%, rgba(16, 163, 74, 0.20) 0%, transparent 55%),
    linear-gradient(135deg, #050605 0%, #0d1710 100%);
  border: none; border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft-lift);
  color: #fff;
}
.landing-free h2 { margin: 0 0 10px; font-size: 30px; font-weight: 700; color: #fff; letter-spacing: -0.01em; }
.landing-free p { max-width: 560px; margin: 0 auto 22px; color: rgba(255, 255, 255, 0.78); font-size: 15.5px; }
.landing-free-more { display: block; width: fit-content; margin: 16px auto 0; color: #fff; font-weight: 600; font-size: 14.5px; text-decoration: underline; text-underline-offset: 3px; }
.landing-free-more:hover { color: rgba(255, 255, 255, 0.82); }

.landing-faq { max-width: 820px; margin: 0 auto; padding: 56px 24px 20px; }
.landing-faq h2 { margin: 0 0 22px; font-size: 30px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
.faq-item { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 0 20px; margin-bottom: 10px; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.faq-item:hover { border-color: var(--primary-light); box-shadow: var(--shadow-soft); }
.faq-item summary {
  cursor: pointer; padding: 18px 4px; font-weight: 700; color: var(--ink); list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; flex: none; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--primary-light); color: var(--primary-dark); font-size: 17px; line-height: 1;
  transition: transform 0.2s ease;
}
.faq-item[open] summary::after { transform: rotate(135deg); }
.faq-item p { margin: 0 0 18px; color: var(--ink-soft); font-size: 14.5px; line-height: 1.6; }

.landing-contact {
  max-width: 1000px; margin: 30px auto 70px; padding: 0 24px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start;
}
.landing-contact h2 { margin: 0 0 10px; font-size: 28px; color: var(--ink); }
.landing-contact-text p { color: var(--ink-soft); font-size: 15px; }
.landing-contact-number { font-weight: 700; color: var(--ink); margin-top: 12px; }
.btn-whatsapp { background: #25d366; border-color: #25d366; color: #073b1a; display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.btn-whatsapp:hover { background: #1fbd5a; border-color: #1fbd5a; }
.landing-contact-form { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 26px; box-shadow: var(--shadow-soft); }
.landing-contact-form textarea { width: 100%; resize: vertical; }
.contact-honeypot { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); opacity: 0; pointer-events: none; }
@media (max-width: 860px) { .landing-contact { grid-template-columns: 1fr; gap: 28px; } }

.legal { max-width: 780px; margin: 0 auto; padding: 48px 24px 70px; color: var(--ink); line-height: 1.65; }
.legal h1 { font-size: 32px; margin: 0 0 6px; }
.legal h2 { font-size: 19px; margin: 30px 0 8px; }
.legal p, .legal li { font-size: 15px; color: var(--ink-soft); }
.legal ul { padding-left: 22px; }
.legal-updated { font-size: 13px; }
.legal-todo { background: #fff3bf; color: #5c4400; padding: 1px 6px; border-radius: 4px; font-weight: 600; }

/* ---------- Page « Pourquoi CABDOK est gratuit » ---------- */
.why-free { max-width: 780px; margin: 0 auto; padding: 48px 24px 70px; color: var(--ink); line-height: 1.65; display: flex; flex-direction: column; gap: 40px; }
.why-free h1 { font-family: var(--font-heading); font-size: clamp(30px, 5.4vw, 42px); line-height: 1.15; margin: 10px 0 0; text-wrap: balance; }
.why-free h2 { font-family: var(--font-heading); font-size: 23px; line-height: 1.25; margin: 0 0 12px; text-wrap: balance; }
.why-free p { margin: 0; font-size: 16px; color: var(--ink-soft); max-width: 66ch; }
.why-free-lead { font-size: 18px !important; margin-top: 14px !important; }
.why-free-answer { background: var(--primary-light); border-left: 4px solid var(--primary); border-radius: 0 var(--radius-lg) var(--radius-lg) 0; padding: 20px 22px; font-size: 17.5px !important; color: var(--ink) !important; max-width: none !important; }
.why-free-answer strong { color: var(--primary-dark); }

.why-free-screen { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-soft); }
.why-free-screen-bar { display: flex; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.why-free-screen-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--border); }
.why-free-screen-body { position: relative; display: grid; grid-template-columns: 150px 1fr; min-height: 300px; }
.why-free-screen-side { border-right: 1px solid var(--border); padding: 14px; display: flex; flex-direction: column; gap: 9px; }
.why-free-screen-side span { height: 10px; border-radius: 3px; background: var(--border); }
.why-free-screen-side span.on { background: var(--primary); }
.why-free-screen-work { padding: 16px 16px 84px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.why-free-screen-tag { font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--primary-dark); font-weight: 700; }
.why-free-screen-line { height: 10px; border-radius: 3px; background: var(--border); }
.why-free-screen-rx { border: 1px dashed #c9d6d4; border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.why-free-ad { position: absolute; right: 12px; bottom: 12px; width: 62px; height: 62px; border: 2px solid var(--secondary); border-radius: 8px; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--secondary); background: var(--secondary-light); }
.why-free-ad-label { position: absolute; right: 86px; bottom: 22px; font-size: 13px; line-height: 1.3; text-align: right; color: var(--ink-soft); }
.why-free-ad-label strong { color: var(--ink); }
.why-free-caption { font-size: 14px !important; margin-top: 10px !important; }

.why-free-never { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.why-free-never li { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 13px 15px; font-size: 14.5px; color: var(--ink-soft); }
.why-free-never li strong { display: block; color: var(--ink); font-size: 15px; }

.why-free-compare { overflow-x: auto; margin-top: 16px; }
.why-free-compare table { border-collapse: collapse; width: 100%; min-width: 460px; background: #fff; border: 1px solid var(--border); font-size: 15px; }
.why-free-compare th, .why-free-compare td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.why-free-compare th { font-size: 13.5px; font-weight: 700; }
.why-free-compare td { color: var(--ink-soft); }
.why-free-compare .us { background: var(--primary-light); color: var(--primary-dark); font-weight: 700; }

.why-free-cta { border-top: 1px solid var(--border); padding-top: 28px; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.why-free-cta h2 { margin: 0; }
.why-free-cta .btn { padding: 12px 24px; font-size: 15px; }
.why-free-cta p { font-size: 14.5px; }

@media (max-width: 560px) {
  .why-free { padding: 32px 16px 56px; gap: 32px; }
  .why-free-screen-body { grid-template-columns: 64px 1fr; }
  .why-free-ad-label { max-width: 130px; }
  .why-free-never { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  /* En colonne, flex-basis devenait une HAUTEUR de 480 px : la capture s'étirait. */
  .landing-hero-split .landing-hero-visual { flex: 0 0 auto; align-items: flex-start; }
}

/* ===== Arabe (RTL) et sélecteur de langue ===== */
.lang-switch { font-weight: 700; }
.contact-consent { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--ink-soft); margin: 4px 0 14px; line-height: 1.5; }
.contact-consent input { margin-top: 3px; flex: none; }
html[lang=ar] body { font-family: "Segoe UI", Tahoma, "Noto Sans Arabic", "Noto Naskh Arabic", Arial, sans-serif; }
html[dir=rtl] .landing-hero-split .landing-hero-text,
html[dir=rtl] .landing-features-header,
html[dir=rtl] .landing-features h2,
html[dir=rtl] .landing-section-subtitle,
html[dir=rtl] .landing-features-grid,
html[dir=rtl] .landing-faq,
html[dir=rtl] .landing-contact,
html[dir=rtl] .landing-showcase-text { text-align: right; }
html[dir=rtl] .landing-hero-actions,
html[dir=rtl] .landing-hero-highlights { justify-content: flex-start; }
html[dir=rtl] .landing-hero-text h1,
html[dir=rtl] .landing-hero-text h1 span { letter-spacing: 0; }
html[dir=rtl] .landing-kicker { letter-spacing: 0; }
html[dir=rtl] .landing-check-list .check-icon { margin-inline-end: 10px; margin-left: 0; margin-right: 0; }
@media (max-width: 860px) {
  html[dir=rtl] .landing-hero-split .landing-hero-text { text-align: center; }
  html[dir=rtl] .landing-hero-actions, html[dir=rtl] .landing-hero-highlights { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .landing-feature, .role-card, .landing-showcase-image, .faq-item, .faq-item summary::after {
    transition: none !important;
  }
  .landing-feature:hover, .role-card:hover { transform: none !important; }
}

/* ===== Vidéo de démonstration ===== */
.landing-demo { max-width: 1100px; margin: 0 auto; padding: 70px 24px 10px; }
.landing-demo-frame { max-width: 980px; margin: 0 auto; border-radius: 16px; overflow: hidden; background: #0b3b37;
  box-shadow: var(--shadow-lift); border: 1px solid var(--border); aspect-ratio: 16 / 9; }
.landing-demo-frame video { display: block; width: 100%; height: 100%; object-fit: contain; background: #0b3b37; }
.landing-demo-note { text-align: center; color: var(--ink-soft); font-size: 13px; margin: 12px 0 0; }
@media (max-width: 860px) { .landing-demo { padding: 46px 16px 0; } }

/* ===== Dentiste : odontogramme et fiche dentaire ===== */
.dental-flags { background: var(--danger-bg); color: var(--danger); border-left: 4px solid var(--danger); }
.dental-flags ul { margin: 6px 0 0; padding-left: 20px; }
.dental-status-warn { background: #fff6e0; color: #8a5a00; border-left: 4px solid #e0a020; }

.odonto-toolbar { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.odonto-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; align-self: flex-start; }
.odonto-switch button { border: 0; background: #fff; padding: 8px 14px; font: inherit; font-size: 13px; cursor: pointer; color: var(--ink-soft); }
.odonto-switch button.active { background: var(--primary); color: #fff; font-weight: 600; }
.odonto-palette { display: flex; flex-wrap: wrap; gap: 8px; }
.odonto-state { display: inline-flex; align-items: center; gap: 7px; border: 1.5px solid var(--border); background: #fff; border-radius: 999px;
  padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; color: var(--ink); }
.odonto-state i, .odonto-chip i { display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: var(--c); }
.odonto-state:hover { border-color: var(--c); }
.odonto-state.active { border-color: var(--c); background: color-mix(in srgb, var(--c) 14%, #fff); font-weight: 700; }
.odonto-help { margin: 0; font-size: 12.5px; color: var(--ink-soft); }

.odonto-chart { overflow-x: auto; padding: 8px 4px 4px; }
.odonto-row { display: flex; gap: 4px; width: max-content; margin: 0 auto; align-items: center; }
.odonto-row + .odonto-row { margin-top: 10px; padding-top: 10px; border-top: 2px dashed var(--border); }
.tooth { --c: #cfd8d6; display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; background: none; padding: 2px; cursor: pointer; font: inherit; }
.tooth.after-mid { margin-left: 14px; }
.tooth-num { font-size: 11px; font-weight: 600; color: var(--ink-soft); }
.tooth-shape { display: block; background: #fff; border: 2px solid var(--c); border-radius: 8px 8px 12px 12px; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .04); transition: background .12s, transform .12s; }
.tooth:hover .tooth-shape { transform: translateY(-2px); }
.odonto-row + .odonto-row .tooth-shape { border-radius: 12px 12px 8px 8px; }
.tooth.kind-inc .tooth-shape { width: 24px; height: 34px; }
.tooth.kind-can .tooth-shape { width: 26px; height: 38px; border-radius: 12px 12px 14px 14px / 10px 10px 18px 18px; }
.tooth.kind-pre .tooth-shape { width: 30px; height: 32px; }
.tooth.kind-mol .tooth-shape { width: 38px; height: 34px; }
.tooth[data-state] .tooth-shape { background: color-mix(in srgb, var(--c) 22%, #fff); }
.tooth[data-state=""] { --c: #cfd8d6; }
.tooth[data-state=carie] { --c: #e2483d; }
.tooth[data-state=obturation] { --c: #2b7fd4; }
.tooth[data-state=couronne] { --c: #c8962b; }
.tooth[data-state=devitalisee] { --c: #7a4bc4; }
.tooth[data-state=implant] { --c: #0f9d8a; }
.tooth[data-state=bridge] { --c: #e0762d; }
.tooth[data-state=fracture] { --c: #b0367d; }
.tooth[data-state=a_extraire] { --c: #111827; }
.tooth[data-state=absente] { --c: #9aa5a3; }
.tooth[data-state=incluse] { --c: #4b6cb7; }
.tooth[data-state=absente] .tooth-shape { border-style: dashed; background: #f3f5f5; opacity: .7; }
.tooth[data-state=a_extraire] .tooth-shape { background: color-mix(in srgb, #111827 12%, #fff); }
.tooth[data-state=a_extraire] .tooth-shape::after, .tooth[data-state=absente] .tooth-shape::after {
  content: "\2715"; display: flex; height: 100%; align-items: center; justify-content: center; font-size: 15px; color: var(--c); }
.tooth:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 8px; }
.odonto-sides { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-soft); padding: 6px 8px 0; }
.odonto-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.odonto-chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 11px; font-size: 12.5px;
  background: color-mix(in srgb, var(--c) 12%, #fff); border: 1px solid color-mix(in srgb, var(--c) 40%, #fff); }
.odonto-none { font-size: 13px; color: var(--ink-soft); }
.odonto-actions { display: flex; align-items: center; gap: 14px; margin-top: 14px; flex-wrap: wrap; }
.odonto-status { font-size: 13px; color: var(--ink-soft); }

.dental-section { border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 16px 14px; margin: 0 0 16px; min-width: 0; }
.dental-section legend { font-weight: 700; padding: 0 8px; font-size: 14px; }
.dental-hint { margin: 2px 0 12px; font-size: 12.5px; color: var(--ink-soft); }
.dental-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 4px 18px; }
.dental-checks, .dental-wide { grid-column: 1 / -1; }
.dental-check-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 8px 22px; margin-top: 6px; }
.dental-check { display: flex; gap: 9px; align-items: flex-start; font-weight: 400; font-size: 13px; line-height: 1.35; cursor: pointer; }
.dental-check input, .dental-confirm input { width: auto; flex: none; margin-top: 2px; }
.dental-confirm { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; margin: 4px 0 14px; cursor: pointer; }
@media (max-width: 860px) { .tooth.after-mid { margin-left: 8px; } .dental-section { padding: 6px 12px 12px; } }
.odonto-scroll-hint { display: none; margin: 0 0 4px; font-size: 12px; color: var(--ink-soft); }
@media (max-width: 860px) { .odonto-scroll-hint { display: block; } }
.landing-mail-actions { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin: 8px 0 0; font-size: 13px; }
.copy-email { border: 1px solid var(--border); background: #fff; border-radius: 8px; padding: 5px 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--primary-dark); }
.copy-email:hover { background: var(--primary-light); }
.access-denied-who { font-size: 14px; margin: 14px 0 6px; }
.access-denied-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 6px; }
.access-denied-actions form { margin: 0; }
.access-denied-tip { font-size: 12.5px; color: var(--ink-soft); margin: 16px 0 0; line-height: 1.5; }

/* ===== Champs personnalisés : emplacement et ordre ===== */
.cf-group td { background: var(--primary-light); font-weight: 700; font-size: 12.5px; color: var(--primary-dark); padding: 7px 12px; }
.cf-place { min-width: 250px; max-width: 100%; }
.cf-order form { display: inline-flex; gap: 4px; margin: 0; }
.cf-order .btn[disabled] { opacity: .35; cursor: default; }
.info-edit-toggle { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.edit-identity-form { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border); }
.identity-custom { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border); }
.identity-custom-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 4px 18px; }

/* ===== Présentation du médecin ===== */
.presentation-card { margin: 20px 0 0; }
.presentation-intro { margin: 0 0 14px; color: var(--ink-soft); font-size: 14px; line-height: 1.5; max-width: 760px; }
.presentation-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; font-size: 12.5px; color: var(--ink-soft); }
.presentation-preview-box { margin: 4px 0 16px; }
.presentation-preview-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); margin-bottom: 8px; }
.presentation-preview-card { max-width: 420px; border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; background: #fff; }
.presentation-preview-name { font-weight: 700; }
.presentation-preview-spec { font-size: 13px; color: var(--primary-dark); margin-bottom: 8px; }
.presentation-preview-text { font-size: 13px; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
.presentation-preview-text.is-empty { color: var(--ink-soft); font-style: italic; }
.presentation-hint { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.presentation-hint .btn { margin-left: auto; }
.e2ee-invite { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.e2ee-invite a.btn { margin-left: auto; }
.e2ee-invite strong { color: var(--danger); font-size: 17px; }
.doctor-bio { margin-top: 8px; font-size: 12.5px; }
.doctor-bio summary { cursor: pointer; color: var(--primary-dark); font-weight: 600; }
.doctor-bio-text { line-height: 1.5; overflow-wrap: anywhere; margin-top: 6px; color: var(--ink); }
.doctor-bio-full { background: var(--primary-light); border-radius: 10px; padding: 12px 14px; margin: 0 0 16px; font-size: 13.5px; }
.doctor-bio-full-title { font-weight: 700; margin-bottom: 4px; color: var(--primary-dark); }

.doctor-name-link { color: inherit; text-decoration: none; }
.doctor-name-link:hover { color: var(--primary-dark); text-decoration: underline; }
.doctor-bio-link { border: 0; background: none; padding: 0; margin: 4px 0 0; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--primary-dark); cursor: pointer; text-align: left; }
.doctor-bio-link:hover { text-decoration: underline; }
.doctor-dialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); border: 0; border-radius: 16px; padding: 22px 24px; box-shadow: 0 24px 60px rgba(0, 0, 0, .28); color: var(--ink); }
.doctor-dialog::backdrop { background: rgba(10, 30, 28, .55); }
.doctor-dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.doctor-dialog-head form { margin: 0; }
.doctor-dialog-name { font-size: 19px; font-weight: 800; }
.doctor-dialog-close { border: 0; background: var(--primary-light); width: 32px; height: 32px; border-radius: 50%; font-size: 15px; cursor: pointer; }
.doctor-dialog-body { font-size: 14px; line-height: 1.6; padding: 12px 0; border-top: 1px solid var(--border); max-height: 50vh; overflow-y: auto; }
.doctor-dialog-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }
.doctor-dialog-actions form { margin: 0; }

/* ===== Bouton « Assistant IA » (médecin) ===== */
.ai-assistant { position: fixed; right: 18px; bottom: 18px; z-index: 900; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.ai-fab-group { display: flex; box-shadow: 0 8px 24px rgba(15, 118, 110, .35); border-radius: 999px; overflow: hidden; }
.ai-fab { border: 0; background: linear-gradient(135deg, #0f766e, #14b8a6); color: #fff; font: inherit; font-weight: 700; font-size: 14px; padding: 12px 18px; cursor: pointer; }
.ai-fab small { font-weight: 600; opacity: .9; }
.ai-fab:hover { filter: brightness(1.06); }
.ai-fab-change { border: 0; border-left: 1px solid rgba(255, 255, 255, .35); background: #0d5f58; color: #fff; padding: 0 14px; cursor: pointer; font-size: 15px; }
.ai-panel { width: min(360px, calc(100vw - 36px)); max-height: calc(100vh - 110px); overflow-y: auto; background: #fff; border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 20px 50px rgba(10, 30, 28, .28); padding: 16px 18px; }
.ai-panel[hidden] { display: none; }
.ai-panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.ai-close { border: 0; background: var(--primary-light); width: 28px; height: 28px; border-radius: 50%; cursor: pointer; }
.ai-intro { margin: 0 0 10px; font-size: 13px; color: var(--ink-soft); line-height: 1.45; }
.ai-list { display: grid; gap: 4px; margin-bottom: 10px; }
.ai-option { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--border); border-radius: 10px; padding: 5px 12px; cursor: pointer; }
.ai-option:has(input:checked) { border-color: var(--primary); background: var(--primary-light); }
.ai-option input { width: auto; flex: none; }
.ai-option span { display: flex; flex-direction: column; }
.ai-option small { color: var(--ink-soft); font-size: 12px; }
.ai-custom-url { width: 100%; }
.ai-notice { background: #fff6e0; border-left: 3px solid #e0a020; border-radius: 6px; padding: 9px 11px; font-size: 12.5px; line-height: 1.45; color: #6b4a00; margin-bottom: 10px; }
.ai-ack { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 10px; cursor: pointer; }
.ai-ack[hidden] { display: none; }
.ai-ack input { width: auto; }
.ai-error { color: var(--danger); font-size: 12.5px; margin: 0 0 8px; }
.ai-error[hidden] { display: none; }
@media (max-width: 860px) { .ai-assistant { right: 12px; bottom: 12px; } .ai-fab small { display: none; } }
@media print { .ai-assistant { display: none; } }
.ai-help { background: var(--primary-light); border-radius: 8px; padding: 9px 11px; font-size: 12.5px; line-height: 1.45; margin-bottom: 8px; }
.ai-blocked { background: #fdecea; color: var(--danger); border-radius: 8px; padding: 9px 11px; font-size: 13px; margin: 0 0 8px; }
.ai-blocked[hidden] { display: none; }
.ai-blocked a { font-weight: 700; }

/* ===== Alerte allergie à l'ordonnance ===== */
.allergy-banner { background: #fdecea; border-left: 4px solid var(--danger); color: #7a1f16; border-radius: 8px; padding: 11px 14px; margin-bottom: 16px; font-size: 14px; }
.allergy-banner-none { background: #fff6e0; border-left-color: #e0a020; color: #6b4a00; }
.allergy-banner-link { margin-left: 10px; font-weight: 700; white-space: nowrap; }
.allergy-alert ul { margin: 8px 0; padding-left: 20px; }
.allergy-alert .allergy-attention { color: #8a5a00; }
.allergy-disclaimer { font-size: 12.5px; margin: 6px 0; opacity: .85; }
.allergy-confirm { display: flex; gap: 9px; align-items: flex-start; font-weight: 600; font-size: 13.5px; cursor: pointer; margin-top: 8px; }
.allergy-confirm input { width: auto; margin-top: 3px; flex: none; }
.allergy-note { font-size: 12px; line-height: 1.35; margin-top: 4px; border-radius: 6px; padding: 5px 8px; }
.allergy-note-danger { background: #fdecea; color: #a3261b; font-weight: 600; }
.allergy-note-attention { background: #fff6e0; color: #8a5a00; }

/* Réservation : présentation du médecin dans une colonne de droite, seule (photo + texte). */
.booking-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.booking-main { min-width: 0; }
.doctor-presentation { position: sticky; top: 16px; background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 20px; box-shadow: var(--shadow-lift); }
.dp-placeholder { margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.5; text-align: center; padding: 24px 8px; }
.dp-photo { display: block; width: 100%; max-width: 260px; aspect-ratio: 1; object-fit: cover; border-radius: 16px; margin: 0 auto 14px; background: var(--primary-light); }
.dp-photo-empty { display: flex; align-items: center; justify-content: center; font-size: 64px; }
.dp-name { margin: 0; font-size: 20px; text-align: center; }
.dp-specialty { text-align: center; color: var(--primary-dark); font-weight: 600; font-size: 14px; margin: 2px 0 6px; }
.dp-address { text-align: center; color: var(--ink-soft); font-size: 13px; margin-bottom: 8px; }
.dp-bio { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 12px; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; max-height: 55vh; overflow-y: auto; }
.dp-empty { border-top: 1px solid var(--border); margin: 12px 0 0; padding-top: 12px; color: var(--ink-soft); font-style: italic; font-size: 13.5px; text-align: center; }
.doctor-card-photo { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; margin-bottom: 6px; display: block; }
@media (max-width: 900px) {
  .booking-layout { grid-template-columns: minmax(0, 1fr); }
  .doctor-presentation { position: static; }
}
/* Photo dans le profil du médecin */
.photo-field-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.photo-thumb { width: 96px; height: 96px; border-radius: 16px; object-fit: cover; background: var(--primary-light); }
.photo-thumb-empty { display: flex; align-items: center; justify-content: center; font-size: 36px; }
.photo-remove { display: block; margin-top: 8px; font-size: 13px; }
.presentation-preview-photo { display: block; width: 96px; height: 96px; border-radius: 14px; object-fit: cover; margin-bottom: 10px; }

/* Déconnexion : toujours visible en haut à droite, même quand le menu latéral dépasse de l'écran. */
.topbar-logout { position: fixed; top: 14px; right: 18px; z-index: 1100; margin: 0; }
.topbar-logout-btn { border: 1px solid var(--icon-blue); background: #fff; color: var(--icon-blue); font: inherit; font-size: 13px; font-weight: 700; padding: 9px 14px; border-radius: 10px; cursor: pointer; box-shadow: var(--shadow); }
.topbar-logout-btn:hover { background: var(--icon-blue); color: #fff; }
.app-shell .main { padding-top: 64px; }
@media (max-width: 900px) { .app-shell .main { padding-top: 76px; } }
@media (max-width: 480px) { .app-shell .main { padding-top: 70px; } .topbar-logout { right: 12px; } .topbar-logout-btn { padding: 9px 11px; } }
@media print { .topbar-logout { display: none; } }

/* Réservation : jours en boutons (le champ date est peu visible sur téléphone). */
.date-chips-title { font-size: 13px; font-weight: 700; color: var(--ink-soft); margin: 0 0 8px; }
.date-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; margin: 0 -2px 8px; -webkit-overflow-scrolling: touch; }
.date-chip { flex: 0 0 auto; min-width: 62px; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 9px 8px; border: 1.5px solid var(--border); border-radius: 12px; background: #fff; color: var(--ink); text-decoration: none; line-height: 1.2; }
.date-chip:hover { border-color: var(--primary); text-decoration: none; }
.date-chip b { font-size: 19px; }
.date-chip small, .date-chip-day { font-size: 11.5px; text-transform: capitalize; color: var(--ink-soft); }
.date-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.date-chip.active small, .date-chip.active .date-chip-day { color: rgba(255, 255, 255, .9); }
.date-other { margin-top: 6px; }
.booking-date-input { display: block; width: 100%; max-width: 260px; min-height: 46px; font-size: 16px; box-sizing: border-box; -webkit-appearance: none; appearance: none; background: #fff; }

/* ---------- En-tête public : Créer un compte / Se connecter toujours visibles ---------- */
.landing-nav { gap: 26px; }
.landing-nav-brand { margin-inline-end: auto; }
.landing-nav-cta { display: flex; align-items: center; gap: 10px; }
@media (max-width: 720px) {
  .landing-nav { flex-wrap: wrap; gap: 10px 8px; padding: 10px 14px 12px 14px; }
  .landing-nav-brand .brand-logo { width: 112px; height: 40px; padding: 5px 8px; }
  .landing-nav-toggle { order: 2; font-size: 24px; min-width: 44px; min-height: 44px; }
  /* Deuxième ligne, pleine largeur : deux gros boutons faciles à toucher. */
  .landing-nav-cta { order: 3; flex: 0 0 100%; gap: 8px; }
  .landing-nav-cta .btn { flex: 1 1 0; min-height: 44px; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 14.5px; padding: 8px 10px; }
  .landing-nav-links { top: 100%; }
}

/* ---------- Téléphone : polices plus lisibles, champs à 16 px (sinon iPhone zoome à la saisie), zones tactiles de 44 px ---------- */
@media (max-width: 600px) {
  body { font-size: 16px; }
  label { font-size: 14px; }
  input[type=text], input[type=email], input[type=password], input[type=date], input[type=datetime-local], input[type=tel],
  input[type=number], input[type=url], input[type=search], input[type=time], select, textarea {
    font-size: 16px; min-height: 44px; padding: 10px 12px;
  }
  textarea { min-height: 96px; }
  .btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; font-size: 15px; padding: 10px 18px; }
  .btn-sm { min-height: 40px; font-size: 14px; padding: 8px 14px; }
  .page-header h1 { font-size: 21px; }
  .page-header .subtitle { font-size: 14px; }
  table { font-size: 14px; }

  .landing-hero { padding: 30px 18px 0 18px; }
  .landing-hero-text h1 { font-size: 30px; line-height: 1.2; }
  .landing-hero-text p { font-size: 16px; }
  .landing-eyebrow { font-size: 13px; }
  .landing-hero-highlights span { font-size: 14px; }
  .landing-hero-actions .btn { flex: 1 1 100%; }
  .landing-features { padding: 40px 18px; }
  .landing-features h2 { font-size: 24px; }
  .landing-section-subtitle { font-size: 15px; max-width: none; }
  .landing-feature { padding: 20px; }
  .landing-feature h3 { font-size: 18px; }
  .landing-feature p { font-size: 15.5px; }
  .landing-showcase { gap: 44px; margin-top: 40px; }
  .landing-showcase-text h3 { font-size: 20px; }
  .landing-showcase-text p, .landing-check-list p { font-size: 15px; }
  .landing-check-list strong { font-size: 16px; }
  .login-card { padding: 24px 18px; }
  .login-card h1, .login-card h2 { font-size: 21px; }
  .login-wrap { padding: 16px; }
  .landing-footer { font-size: 14px; padding: 28px 16px; }
  .landing-footer-links a { display: inline-block; padding: 6px 4px; }
}

/* Agenda : jours cliquables, nombre de RDV et bouton « Tout voir » bien visible. */
.calendar-cell-head { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-bottom: 4px; }
.calendar-cell-head .calendar-day-num { margin-bottom: 0; }
.calendar-day-link { display: inline-flex; padding: 2px; border-radius: 6px; }
.calendar-day-link:hover { background: var(--primary-light); text-decoration: none; }
.calendar-count { font-size: 11px; font-weight: 700; color: var(--primary-dark); background: var(--primary-light); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.calendar-count:hover { background: var(--primary); color: #fff; text-decoration: none; }
.calendar-more-btn { display: block; margin-top: 4px; padding: 6px 8px; border: 1.5px solid var(--primary); border-radius: 7px; background: var(--primary-light); color: var(--primary-dark); font-size: 12px; font-weight: 700; text-align: center; line-height: 1.25; }
.calendar-more-btn:hover { background: var(--primary); color: #fff; text-decoration: none; }
.calendar-hint { margin: 0 0 10px; font-size: 13.5px; color: var(--ink-soft); }
.day-back { margin-bottom: 12px; }
@media (max-width: 600px) { .calendar-hint { font-size: 14px; } .calendar-count { font-size: 10.5px; padding: 2px 6px; } }

/* Téléphone : la liste des points forts de la page d'accueil est alignée à gauche (à droite en arabe), une ligne par point. */
@media (max-width: 720px) {
  .landing-hero-highlights, .landing-hero-split .landing-hero-highlights { flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 10px; }
  .landing-hero-highlights span { font-size: 15px; }
}

/* ---------- Date de naissance en jour/mois/année ---------- */
.dob-fields { display: flex; gap: 6px; }
.dob-fields input { text-align: center; }
.dob-fields input[name$="_day"], .dob-fields input[name$="_month"] { flex: 0 0 62px; }
.dob-fields input[name$="_year"] { flex: 0 0 88px; }
@media (max-width: 600px) {
  .dob-fields input[name$="_day"], .dob-fields input[name$="_month"] { flex: 1 1 0; }
  .dob-fields input[name$="_year"] { flex: 1.3 1 0; }
}

/* ---------- Horaires du médecin : jours en cases à cocher, plusieurs à la fois ---------- */
.weekday-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.weekday-chip { position: relative; }
.weekday-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.weekday-chip span {
  display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 40px;
  padding: 6px 10px; border: 1.5px solid var(--border); border-radius: 10px; font-size: 13px; font-weight: 700;
  color: var(--ink); cursor: pointer; background: #fff;
}
.weekday-chip input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.weekday-chip input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- Bouton en forme de lien (ex. « changer » dans un champ) ---------- */
.text-btn { border: 0; background: none; padding: 0; font: inherit; color: var(--primary-dark); text-decoration: underline; cursor: pointer; }

/* Réservation : lien pour revenir à la liste des médecins une fois qu'un a été choisi. */
.change-doctor-link { display: inline-block; margin: 0 0 12px; }

/* Horaires du médecin : formulaire de modification en ligne d'une plage existante. */
.inline-edit-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; background: var(--bg); padding: 10px; border-radius: 8px; }

/* Réservation : filtre par ville + bouton « Utiliser ma position ». */
.city-field-row { display: flex; gap: 8px; align-items: center; }
.city-field-row select { flex: 1; min-width: 0; }
.city-field-row .btn { flex: 0 0 auto; font-size: 16px; padding: 9px 12px; }
.nearest-city-suggestion { background: var(--primary-light); color: var(--primary-dark); border: 1px solid var(--primary); }

/* Fiche patient : envoi d'un résultat d'analyse/imagerie */
.upload-document-form { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.upload-document-form .field { margin-bottom: 0; min-width: 220px; }

/* Fiche patient : analyses/imagerie enregistrées sur l'ordinateur du médecin */
.doc-folder-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; font-size: 14px; }
.doc-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }

/* Écran de bienvenue (feux d'artifice) affiché une seule fois, juste après l'inscription d'un médecin. */
.doctor-welcome-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at center, rgba(20, 135, 124, 0.94), rgba(26, 43, 42, 0.98));
  overflow: hidden;
}
.doctor-welcome-fireworks { position: absolute; inset: 0; pointer-events: none; }
.doctor-welcome-spark {
  position: absolute; width: 6px; height: 6px; border-radius: 50%;
  animation: doctor-welcome-spark-burst 1.1s ease-out forwards;
}
@keyframes doctor-welcome-spark-burst {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0); opacity: 0; }
}
.doctor-welcome-card { position: relative; z-index: 1; text-align: center; color: #fff; padding: 40px 32px; max-width: 420px; }
.doctor-welcome-card h1 { font-family: var(--font-heading); font-size: 1.7rem; margin: 0 0 12px; }
.doctor-welcome-card p { font-size: 1.1rem; margin: 0 0 26px; opacity: 0.92; }
.doctor-welcome-btn {
  display: inline-block; padding: 11px 28px; border-radius: var(--radius); font-size: 14px; font-weight: 700;
  border: none; cursor: pointer; background: #fff; color: var(--primary-dark);
  transition: transform 0.06s ease;
}
.doctor-welcome-btn:hover { background: #f1f4f3; }
.doctor-welcome-btn:active { transform: translateY(1px); }

/* Déverrouillage/activation/récupération E2EE : ces classes étaient posées
   dans plusieurs gabarits (base.html, e2ee_activate.html, e2ee_recovery.html)
   sans jamais être définies globalement — l'écran de déverrouillage
   s'affichait sans aucun style (voir ledger, revue finale I4). */
.e2ee-backup-overlay {
  position: fixed; inset: 0; background: rgba(255, 255, 255, 0.96); z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
/* `display: flex` ci-dessus est une règle AUTEUR : elle l'emporte sur la
   règle UA `[hidden] { display: none }` (priorité par origine, pas par
   spécificité) — sans cette surcharge, l'attribut `hidden` posé en HTML
   n'a AUCUN effet et l'overlay reste visible en permanence, même quand le
   JS le laisse délibérément masqué (bug reproduit en direct : un médecin
   tout juste créé, sans aucune clé, se voyait réclamer un déverrouillage
   dès le chargement de la page). */
.e2ee-backup-overlay[hidden] { display: none; }
.e2ee-backup-card {
  max-width: 480px; width: 100%; padding: 24px; background: #fff; border-radius: var(--radius-lg);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}
.e2ee-backup-card h2 { margin-top: 0; }
.e2ee-backup-card label { display: block; margin: 14px 0 6px; font-size: 13px; color: var(--ink-soft); }
.e2ee-backup-card input[type="password"],
.e2ee-backup-card input[type="text"] {
  width: 100%; padding: 10px 12px; border-radius: var(--radius); border: 1px solid #d8dedc; font-size: 15px;
}
.e2ee-backup-code {
  font-family: monospace; font-size: 22px; letter-spacing: 1px; text-align: center;
  margin: 20px 0; padding: 16px; border: 1px solid #ccc; border-radius: var(--radius);
}
.e2ee-ack { display: flex; align-items: center; gap: 8px; margin: 14px 0; font-size: 13px; }
.e2ee-error { color: var(--danger); background: var(--danger-bg); padding: 9px 12px; border-radius: var(--radius); font-size: 13px; margin-top: 10px; }

/* Page dédiée d'affichage de la clé de secours (frontend:e2ee_backup_key) —
   bannière pleine largeur + carte de message + clé en grand, lisibles sur
   mobile comme à l'impression. */
.e2ee-important-banner {
  background: var(--danger); color: #fff; font-weight: 700; font-size: 20px;
  text-align: center; padding: 16px 12px; letter-spacing: 0.5px;
}
.e2ee-backup-page { max-width: 640px; }
.e2ee-backup-message {
  background: #fff8f0; border: 1px solid #f0d9b5; border-radius: var(--radius-lg);
  padding: 18px 20px; margin: 18px 0;
}
.e2ee-backup-message p { margin: 10px 0; }
.e2ee-backup-message ul { margin: 10px 0; padding-left: 22px; }
.e2ee-backup-key-display {
  font-family: monospace; font-size: 26px; font-weight: 700; letter-spacing: 2px;
  text-align: center; word-break: break-word; margin: 20px 0; padding: 20px;
  border: 2px solid var(--primary-dark); border-radius: var(--radius-lg); background: #fff;
}
.e2ee-backup-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 14px 0; }
.e2ee-copy-feedback { color: var(--primary-dark); font-weight: 700; font-size: 13px; }
@media (max-width: 480px) {
  .e2ee-backup-key-display { font-size: 18px; letter-spacing: 1px; }
  .e2ee-important-banner { font-size: 16px; }
}

/* ---- Import de données ---- */
.import-types { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.import-type { display: flex; flex-direction: column; gap: 8px; padding: 20px; background: var(--card, #fff); border: 2px solid var(--line, #dfe6e6); border-radius: 14px; color: inherit; text-decoration: none; }
a.import-type:hover { border-color: var(--primary); box-shadow: 0 4px 14px rgba(20, 135, 124, .15); }
.import-type.is-disabled { opacity: .6; }
.import-type-icon { font-size: 30px; }
.import-type span { color: var(--ink-soft); font-size: 14px; }
.import-type-go { color: var(--primary-dark) !important; font-weight: 700; margin-top: auto; }
.import-summary { display: flex; gap: 12px; flex-wrap: wrap; margin: 12px 0 18px; }
.import-stat { flex: 1 1 150px; padding: 14px 16px; border-radius: 12px; background: #eef1f1; display: flex; flex-direction: column; }
.import-stat strong { font-size: 28px; line-height: 1.1; }
.import-stat span { font-size: 13px; color: var(--ink-soft); }
.import-stat.is-ok { background: var(--ok-bg); }
.import-stat.is-bad { background: var(--danger-bg); }
.import-note { color: var(--ink-soft); font-size: 13px; margin: 8px 0; }
.import-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 18px; }
.import-actions form { margin: 0; }
.import-medical-note { background: var(--indigo-bg); }
.import-medical-note p { margin: 6px 0 0; }

/* ---- Surveillance des interactions (ordonnance) ---- */
.interaction-panel { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.interaction-panel[hidden] { display: none; }
.interaction-alert { border-radius: 10px; padding: 10px 14px; border-left: 5px solid; }
.interaction-alert p { margin: 4px 0; }
.interaction-alert small { color: var(--ink-soft); }
.interaction-contre_indication { background: var(--danger-bg); border-color: var(--danger); }
.interaction-deconseille { background: var(--warn-bg); border-color: var(--warn); }
.interaction-precaution { background: var(--indigo-bg); border-color: var(--indigo-dark); }
.interaction-a_prendre_en_compte { background: #f3f5f5; border-color: var(--ink-soft); }
.interaction-also { font-size: 13px; color: var(--ink-soft); }
.interaction-note { margin: 0; color: var(--ink-soft); font-size: 13.5px; }
.interaction-ok { margin: 0; color: var(--ok); font-size: 13.5px; font-weight: 600; }

/* ---- Dictée de l'ordonnance ---- */
.dictation-card { margin-bottom: 16px; }
.dictation-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.dictation-head h2 { margin: 0; }
.dictation-chip { padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; background: #eef1f1; color: var(--ink-soft); }
.dictation-ready { background: var(--ok-bg); color: var(--ok); }
.dictation-absent, .dictation-nostt { background: var(--danger-bg); color: var(--danger); }
.dictation-unpaired { background: var(--warn-bg); color: var(--warn); }
.dictation-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.dictation-pair { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.dictation-pair input { width: 150px; text-transform: uppercase; letter-spacing: 2px; }
.dictation-pair[hidden], .dictation-review[hidden], .dictation-actions [hidden] { display: none; }
.dictation-rec { color: var(--danger); font-weight: 700; animation: dictation-pulse 1.2s ease-in-out infinite; }
@keyframes dictation-pulse { 50% { opacity: .35; } }
.dictation-busy { color: var(--ink-soft); font-size: 13.5px; }
.dictation-review { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.dictation-review textarea { width: 100%; }
.dictation-result { margin: 12px 0 0; font-weight: 600; color: var(--primary-dark); }
.dictation-error { color: var(--danger); font-weight: 600; }
.dictation-help { margin: 12px 0 0; font-size: 12.5px; color: var(--ink-soft); }
.rx-doubt { outline: 2px solid #e8890c; background: #fff7e8; }
.rx-note { outline: 2px dashed var(--primary); }
.rx-suggestions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.rx-suggestion { border: 1px solid #e8890c; background: #fff; color: var(--ink); border-radius: 999px; padding: 3px 10px; font-size: 12.5px; cursor: pointer; }
.rx-suggestion:hover { background: #fff7e8; }

/* ---- Résumé du dossier ---- */
.summary-panel { margin-bottom: 16px; border-left: 5px solid var(--primary); }
.summary-panel[hidden] { display: none; }
.summary-bar { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }  /* sous le titre : le bouton fixe « Se déconnecter » occupe le coin haut droit */
.summary-bar h2 { margin: 0; }
.summary-actions { display: flex; gap: 8px; align-items: center; }
.summary-feedback { color: var(--primary-dark); font-weight: 700; font-size: 13px; }
.summary-head { display: flex; flex-direction: column; gap: 2px; margin: 10px 0 4px; }
.summary-head span { color: var(--ink-soft); font-size: 14px; }
.summary-section { margin-top: 14px; }
.summary-section h3 { margin: 0 0 6px; font-size: 14px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); }
.summary-section p { margin: 0; }
.summary-allergies { background: var(--danger-bg); border-radius: 10px; padding: 10px 14px; }
.summary-allergies h3 { color: var(--danger); }
.summary-strong { font-weight: 700; color: var(--danger); }
.summary-item { padding: 8px 0; border-top: 1px solid var(--border, #e3e8e8); }
.summary-item:first-of-type { border-top: 0; }
.summary-item p { color: var(--ink-soft); font-size: 14px; }
.summary-item ul { margin: 4px 0 0; padding-left: 20px; }
.summary-source { font-size: 12.5px; margin-left: 6px; }
.summary-empty { color: var(--ink-soft); font-size: 14px; }
.summary-warn { color: var(--danger); font-weight: 600; }
.summary-foot { margin-top: 16px; font-size: 12.5px; color: var(--ink-soft); }
@media print {
  body.summary-printing * { visibility: hidden; }
  body.summary-printing #summary-panel, body.summary-printing #summary-panel * { visibility: visible; }
  body.summary-printing #summary-panel { position: absolute; left: 0; top: 0; width: 100%; box-shadow: none; border: 0; }
  body.summary-printing .summary-actions { display: none; }
}

.dictation-install { margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: var(--warn-bg); }
.dictation-install[hidden] { display: none; }
.dictation-install p { margin: 0 0 8px; }
.agent-card { margin-bottom: 16px; }
.agent-steps { padding-left: 22px; display: flex; flex-direction: column; gap: 10px; }
.agent-download { margin-top: 14px; }
.agent-note { color: var(--ink-soft); font-size: 13.5px; }
.agent-card code { background: #eef1f1; padding: 1px 6px; border-radius: 4px; }
