/* CliniquIA : feuille de style unique (vitrine, application, espace patient).
   Police système du parc (Segoe UI), aucun CDN ; responsive mobile, tablette, ordinateur.
   Couleur propre : vert-bleu santé #0a9e87 sur fond de nuit #062f33. */
:root {
  --accent: #0a9e87;
  --accent-fonce: #07715f;
  --nuit: #062f33;
  --nuit-2: #0b3f44;
  --accent-clair: #e4f5f1;
  --encre: #15232b;
  --attenue: #56656d;
  --fond: #f4f8f8;
  --carte: #ffffff;
  --trait: #dde8e8;
  --succes: #177a4a;
  --alerte: #9a6a00;
  --alerte-clair: #fff4dc;
  --danger: #b3261e;
  --danger-clair: #fdecea;
  --ln-violet: #602078;
  --ln-vert: #98b818;
  --rayon: 12px;
  --ombre: 0 1px 2px rgba(6, 47, 51, .06), 0 6px 20px rgba(6, 47, 51, .06);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--fond); color: var(--encre); line-height: 1.5;
}
a { color: var(--accent-fonce); }
img, svg { max-width: 100%; }
h1, h2, h3 { line-height: 1.22; }
.ico { width: 20px; height: 20px; flex: 0 0 auto; vertical-align: -4px; }
.ico.grand { width: 28px; height: 28px; }
.cache { display: none !important; }
.lnx { font-style: italic; white-space: nowrap; }
.lnx .l { color: var(--ln-violet); font-weight: 700; }
.lnx .x { color: var(--ln-vert); font-weight: 700; }
.pied-public .lnx .l { color: #fff; }

/* ── Vitrine ─────────────────────────────────────────────────────────── */
nav.vitrine {
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(6px); border-bottom: 1px solid var(--trait);
  padding: 10px 20px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 8px 16px; position: sticky; top: 0; z-index: 1000;
}
.marque { display: inline-flex; align-items: center; text-decoration: none; }
.marque img { height: 38px; width: auto; display: block; }
nav.vitrine .liens { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
nav.vitrine .liens a {
  text-decoration: none; color: var(--encre); padding: 8px 10px; border-radius: 8px; font-weight: 600; font-size: .93rem;
}
nav.vitrine .liens a:hover, nav.vitrine .liens a.actif { color: var(--accent-fonce); background: var(--accent-clair); }
nav.vitrine .liens a.bouton { background: var(--accent); color: #fff; }
nav.vitrine .liens a.bouton:hover { background: var(--accent-fonce); color: #fff; }
nav.vitrine .liens a.contour { border: 1px solid var(--accent); color: var(--accent-fonce); }
.choix-langue { border: 1px solid var(--trait); border-radius: 8px; padding: 6px 8px; background: #fff; font: inherit; font-size: .88rem; }

.hero {
  background: radial-gradient(1200px 500px at 85% -10%, rgba(10, 158, 135, .45), transparent 60%),
              linear-gradient(135deg, var(--nuit), var(--nuit-2));
  color: #eaf6f4; padding: 64px 20px 72px;
}
.hero .contenu { max-width: 1120px; margin: 0 auto; display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; }
.hero .surtitre { display: inline-flex; gap: 8px; align-items: center; font-size: .85rem; font-weight: 600;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); padding: 5px 12px; border-radius: 999px; }
.hero h1 { font-size: clamp(1.8rem, 4.2vw, 2.8rem); margin: 16px 0 14px; color: #fff; }
.hero h1 em { font-style: normal; color: #7fe3d1; }
.hero p.lead { font-size: 1.08rem; opacity: .94; margin: 0 0 26px; max-width: 640px; }
.hero .actions, .actions-cta { display: flex; flex-wrap: wrap; gap: 10px; }
.bouton-hero, .bouton-hero-secondaire {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 10px; text-decoration: none; font-weight: 700;
}
.bouton-hero { background: #fff; color: var(--nuit); }
.bouton-hero:hover { background: var(--accent-clair); }
.bouton-hero-secondaire { border: 1px solid rgba(255, 255, 255, .7); color: #fff; }
.hero .apercu { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .14); border-radius: 18px; padding: 18px; }
.apercu .ligne { display: flex; align-items: center; gap: 12px; background: rgba(255, 255, 255, .08); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.apercu .ligne:last-child { margin-bottom: 0; }
.apercu .ligne .ico { color: #7fe3d1; }
.apercu .ligne strong { display: block; color: #fff; font-size: .98rem; }
.apercu .ligne span { font-size: .84rem; opacity: .85; }
.hero .reassurance { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 22px; font-size: .9rem; opacity: .9; }
.hero .reassurance span { display: inline-flex; gap: 6px; align-items: center; }

.section-publique { max-width: 1120px; margin: 0 auto; padding: 56px 20px; }
.section-publique h2 { font-size: clamp(1.4rem, 3vw, 1.8rem); margin: 0 0 8px; }
.section-publique .intro { color: var(--attenue); max-width: 760px; margin: 0 0 28px; }
.bande { background: var(--carte); border-top: 1px solid var(--trait); border-bottom: 1px solid var(--trait); }
.bande-nuit { background: var(--nuit); color: #eaf6f4; }
.bande-nuit h2 { color: #fff; }
.bande-nuit .intro { color: #b8d8d4; }
.grille-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grille-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grille-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.bloc { background: var(--carte); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 20px; box-shadow: var(--ombre); }
.bloc h3 { margin: 10px 0 6px; font-size: 1.05rem; color: var(--nuit); }
.bloc p { margin: 0; color: var(--attenue); }
.bloc ul { margin: 8px 0 0; padding-left: 18px; color: var(--attenue); }
.bloc .pastille { display: inline-flex; width: 44px; height: 44px; align-items: center; justify-content: center;
  border-radius: 12px; background: var(--accent-clair); color: var(--accent-fonce); }
.bande-nuit .bloc { background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .12); box-shadow: none; }
.bande-nuit .bloc h3 { color: #fff; }
.bande-nuit .bloc p, .bande-nuit .bloc ul { color: #c4e0dc; }
.bande-nuit .bloc .pastille { background: rgba(10, 158, 135, .25); color: #7fe3d1; }
.cible { text-align: left; }
.cible .prix-depart { margin-top: 10px; font-weight: 700; color: var(--accent-fonce); }
.etapes { counter-reset: etape; }
.etapes .bloc::before { counter-increment: etape; content: counter(etape); display: inline-flex; width: 30px; height: 30px;
  align-items: center; justify-content: center; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 800; }
.chiffres { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 8px; }
.chiffres div { background: rgba(255, 255, 255, .06); border-radius: 12px; padding: 16px; }
.chiffres strong { display: block; font-size: 1.6rem; color: #7fe3d1; }
.bande-cta { text-align: center; padding: 56px 20px; background: linear-gradient(135deg, var(--accent-fonce), var(--accent)); color: #fff; }
.bande-cta h2 { margin: 0 0 8px; color: #fff; }
.bande-cta p { margin: 0 0 20px; opacity: .95; }
.bande-cta .actions-cta { justify-content: center; }
.bande-cta .bouton-hero { color: var(--accent-fonce); }

.formulaire-contact { max-width: 720px; }
.formulaire-contact .grille-2 { gap: 12px; }

.pied-public { background: var(--nuit); color: #cfe6e2; padding: 30px 20px; font-size: .9rem; }
.pied-public .contenu { max-width: 1120px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; }
.pied-public a { color: #fff; }
.pied-public .pied-liens { display: flex; flex-direction: column; gap: 6px; }
.pied-logo { height: 34px; width: auto; margin-bottom: 8px; }

/* Offres */
.offres { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.offre { display: flex; flex-direction: column; background: var(--carte); border: 1px solid var(--trait);
  border-radius: var(--rayon); padding: 22px; box-shadow: var(--ombre); }
.offre.phare { border: 2px solid var(--accent); }
.offre h3 { margin: 0 0 4px; font-size: 1.2rem; color: var(--nuit); }
.offre .prix { font-size: 1.5rem; font-weight: 800; color: var(--accent-fonce); margin: 10px 0 2px; }
.offre .annuel { color: var(--attenue); font-size: .88rem; }
.offre ul { padding-left: 18px; color: var(--attenue); flex: 1; }
.offre .btn { margin-top: 12px; text-align: center; }
.bascule-periode { display: inline-flex; border: 1px solid var(--trait); border-radius: 999px; padding: 4px; background: #fff; margin-bottom: 20px; }
.bascule-periode button { border: 0; background: transparent; color: var(--encre); padding: 6px 14px; border-radius: 999px; font-weight: 600; }
.bascule-periode button.actif { background: var(--accent); color: #fff; }

/* ── Formulaires et boutons (vitrine et application) ───────────────── */
label { display: block; font-size: .88rem; font-weight: 600; color: var(--encre); }
input, select, textarea {
  width: 100%; margin-top: 4px; padding: 9px 11px; border: 1px solid #c9d7d7; border-radius: 8px; font: inherit;
  font-size: .95rem; background: #fff; color: var(--encre);
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(10, 158, 135, .35); border-color: var(--accent); }
textarea { min-height: 84px; resize: vertical; }
input[type=checkbox] { width: auto; margin: 0 6px 0 0; }
.case { display: flex; align-items: center; font-weight: 500; }
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 700;
  font-size: .93rem; padding: 9px 16px; border-radius: 9px; border: 1px solid var(--accent); background: var(--accent);
  color: #fff; cursor: pointer; text-decoration: none; min-height: 40px;
}
button:hover, .btn:hover { background: var(--accent-fonce); border-color: var(--accent-fonce); }
button:disabled { opacity: .55; cursor: wait; }
button.secondaire, .btn.secondaire { background: #fff; color: var(--accent-fonce); }
button.secondaire:hover, .btn.secondaire:hover { background: var(--accent-clair); }
button.danger { background: var(--danger); border-color: var(--danger); }
button.petit, .btn.petit { padding: 5px 10px; font-size: .84rem; min-height: 32px; }
button.lien-bouton { background: none; border: 0; color: var(--accent-fonce); padding: 4px; min-height: 0; font-weight: 600; text-decoration: underline; }
.grille { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 14px; }
.grille.trois { grid-template-columns: repeat(3, 1fr); }
.grille .large { grid-column: 1 / -1; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.message { padding: 10px 14px; border-radius: 9px; margin: 8px 0; font-size: .93rem; }
.message.erreur { background: var(--danger-clair); color: var(--danger); border: 1px solid #f3c4bf; }
.message.ok { background: #e6f6ee; color: var(--succes); border: 1px solid #bfe5cf; }
.message.info { background: var(--accent-clair); color: var(--accent-fonce); border: 1px solid #bfe6dd; }
.message.alerte { background: var(--alerte-clair); color: var(--alerte); border: 1px solid #f1dca8; }

/* ── Application ─────────────────────────────────────────────────────── */
.entete {
  background: var(--nuit); color: #fff; padding: 8px 16px; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; position: sticky; top: 0; z-index: 900; flex-wrap: wrap;
}
.entete .marque img { height: 32px; }
.entete .etab { font-size: .82rem; color: #b8d8d4; margin-left: 10px; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entete .droite { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .88rem; }
.entete .choix-langue { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .3); }
.entete .choix-langue option { color: var(--encre); }
.entete button.secondaire { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .45); }
.badge-file { background: var(--alerte); color: #fff; border-radius: 999px; padding: 3px 10px; font-weight: 700; font-size: .8rem; display: inline-flex; gap: 6px; align-items: center; }
.disposition { display: grid; grid-template-columns: 232px 1fr; min-height: calc(100vh - 52px); }
nav.onglets { background: #fff; border-right: 1px solid var(--trait); padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; }
nav.onglets button {
  background: transparent; border: 0; color: var(--encre); justify-content: flex-start; font-weight: 600; padding: 9px 12px;
  border-radius: 9px; min-height: 40px; text-align: left; gap: 10px;
}
nav.onglets button:hover { background: var(--accent-clair); color: var(--accent-fonce); }
nav.onglets button.actif { background: var(--accent); color: #fff; }
main.app { padding: 22px; max-width: 1280px; width: 100%; min-width: 0; }
.disposition > *, .grille-2 > *, .grille-3 > *, .grille > *, .carte, .tuiles > * { min-width: 0; }
.barre-recherche > * { min-width: 0; }
.titre-vue { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 0 0 16px; }
.titre-vue h1 { font-size: 1.35rem; margin: 0; display: flex; align-items: center; gap: 10px; }
.carte { background: var(--carte); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 18px; box-shadow: var(--ombre); margin-bottom: 16px; }
.carte h2 { font-size: 1.08rem; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.carte h3 { font-size: .98rem; margin: 14px 0 8px; }
.tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tuile { background: var(--carte); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 14px 16px; box-shadow: var(--ombre); }
.tuile .valeur { font-size: 1.6rem; font-weight: 800; color: var(--nuit); }
.tuile .libelle { color: var(--attenue); font-size: .86rem; display: flex; align-items: center; gap: 6px; }
.tuile.alerte .valeur { color: var(--alerte); }
.table-defile { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--trait); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .02em; color: var(--attenue); background: #f7fbfb; }
tr.cliquable { cursor: pointer; }
tr.cliquable:hover td { background: var(--accent-clair); }
td.nombre, th.nombre { text-align: right; white-space: nowrap; }
.badge { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: .78rem; font-weight: 700; background: #eef3f3; color: var(--attenue); white-space: nowrap; }
.badge.vert { background: #e6f6ee; color: var(--succes); }
.badge.orange { background: var(--alerte-clair); color: var(--alerte); }
.badge.rouge { background: var(--danger-clair); color: var(--danger); }
.badge.bleu { background: var(--accent-clair); color: var(--accent-fonce); }
.attenue { color: var(--attenue); }
.vide { color: var(--attenue); font-style: italic; }
.barre-recherche { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 12px; }
.barre-recherche > * { flex: 1 1 200px; }
.barre-recherche button { flex: 0 0 auto; }
.fiche-patient { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; font-size: .94rem; }
.fiche-patient dt { color: var(--attenue); font-size: .8rem; }
.fiche-patient dd { margin: 0 0 6px; font-weight: 600; }
.onglets-internes { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; border-bottom: 1px solid var(--trait); padding-bottom: 8px; }
.onglets-internes button { background: #fff; color: var(--encre); border-color: var(--trait); font-weight: 600; }
.onglets-internes button.actif { background: var(--accent); color: #fff; border-color: var(--accent); }
.lits { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.lit { border: 1px solid var(--trait); border-radius: 10px; padding: 12px; background: #fff; }
.lit.occupe { border-color: #f1dca8; background: #fffaf0; }
.lit .num { font-weight: 800; }
.ia-proposition { white-space: pre-wrap; background: #f7fbfb; border: 1px dashed var(--accent); border-radius: 10px; padding: 12px; }
.ecran-auth { max-width: 460px; margin: 40px auto; }
.sep { height: 1px; background: var(--trait); margin: 14px 0; }
#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; max-width: 360px; }
#toasts .message { box-shadow: var(--ombre); }
.bandeau-hors-ligne { background: var(--alerte-clair); color: var(--alerte); padding: 8px 16px; font-size: .9rem; display: flex; gap: 8px; align-items: center; }
.qr-carte { text-align: center; }
.pied-app { text-align: center; color: var(--attenue); font-size: .8rem; padding: 16px; }

/* ── Espace patient ─────────────────────────────────────────────────── */
.espace-patient { max-width: 760px; margin: 0 auto; padding: 20px 16px; }

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 1000px) {
  .grille-4 { grid-template-columns: repeat(2, 1fr); }
  .chiffres { grid-template-columns: repeat(2, 1fr); }
  .hero .contenu { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .disposition { grid-template-columns: 1fr; }
  nav.onglets { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--trait); padding: 8px; position: sticky; top: 52px; z-index: 800; }
  nav.onglets button { white-space: nowrap; flex: 0 0 auto; }
  .grille-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .grille-4, .grille-3, .grille-2, .grille, .grille.trois, .chiffres, .fiche-patient { grid-template-columns: 1fr; }
  main.app { padding: 14px; }
  .hero { padding: 40px 16px 48px; }
  .section-publique { padding: 40px 16px; }
  nav.vitrine { padding: 8px 12px; }
  nav.vitrine .liens a { padding: 6px 8px; font-size: .88rem; }
  .entete .etab { display: none; }
  th, td { padding: 8px 6px; }
}
