/* Palette IRRINEO — refonte 2026.
   Clair : valeurs ci-dessous. Sombre : html[data-theme="sombre"], posé par apparence.js.
   Les variables --s-… n'existent qu'en sombre : ailleurs, var(--s-carte, #fff) garde la couleur d'origine. */
:root {
  --fond: #f6f7f6;
  --surface: #ffffff;
  --texte: #141c1a;
  --texte-2: #5a6662;
  --ligne-nette: #dde3e1;
  --accent: #2f5d63;
  --accent-survol: #24484d;
  --sur-accent: #ffffff;
  --rail: rgba(20, 28, 26, .06);
  --pastille: #ffffff;
  --pastille-ombre: 0 1px 2px rgba(20, 28, 26, .10), 0 1px 1px rgba(20, 28, 26, .06);
  --survol-fond: rgba(47, 93, 99, .08);
  --focus: #1686af;
  --bouton: #2f5d63;
  --bouton-survol: #24484d;

  --paper: var(--fond);
  --white: var(--surface);
  --sage: #aab9ae;
  --sage-soft: #e3e8e6;
  --teal: var(--accent);
  --teal-dark: var(--accent-survol);
  --ink: var(--texte);
  --muted: var(--texte-2);
  --line: rgba(20, 28, 26, .14);
  --danger: #9a433d;
  --ir-fond: var(--fond);
  --ir-surface: var(--surface);
  --ir-encre: var(--texte);
  --ir-secondaire: var(--texte-2);
  --ir-ligne: var(--ligne-nette);
  --ir-eau: var(--accent);
  --ir-eau-clair: #e6eeee;
  --ir-focus: var(--focus);
  color-scheme: light;
}
html[data-theme="sombre"] {
  --fond: #171918;
  --surface: #222624;
  --texte: #eef1ec;
  --texte-2: #a3ada8;
  --ligne-nette: #343b37;
  --accent: #8fb3ad;
  --accent-survol: #a9c7c1;
  --rail: #222624;
  --pastille: #3a413d;
  --pastille-ombre: none;
  --survol-fond: rgba(143, 179, 173, .12);
  --focus: #7fc4de;
  --bouton: #3d7680;
  --bouton-survol: #447e88;

  --sage: #5d6b64;
  --sage-soft: #2c322f;
  --teal: #3d7680;
  --teal-dark: #a9c7c1;
  --line: #343b37;
  --danger: #f0a29b;
  --ir-eau: #8fb3ad;
  --ir-eau-clair: #2c322f;

  --s-carte: #222624;
  --s-carte-2: #2c322f;
  --s-texte: #eef1ec;
  --s-texte-2: #a3ada8;
  --s-ligne: #3a413d;
  --s-txt-bleu: #8fc1d0;
  --s-txt-vert: #8fd1ae;
  --s-txt-rouge: #f0a29b;
  --s-txt-orange: #e8bf7f;
  --s-txt-violet: #c8b2ea;
  --s-fond-bleu: #1d2b30;
  --s-fond-vert: #1f2d26;
  --s-fond-rouge: #35231f;
  --s-fond-orange: #33291c;
  --s-fond-violet: #2a2533;
  --s-bord-bleu: #3f5f68;
  --s-bord-vert: #3f6150;
  --s-bord-rouge: #7a4540;
  --s-bord-orange: #6b5530;
  --s-bord-violet: #54486a;
  color-scheme: dark;
}
/* Boutons pleins : fond sarcelle, texte blanc dans les deux modes (5,1:1 en sombre). */
html[data-theme="sombre"] .primary,
html[data-theme="sombre"] button:not(.secondary):not(.danger):not(.link):not(.site-button):not(.account-button):not(.password-toggle):not([class*="leaflet"]) { --white: #ffffff; --teal: var(--bouton); --teal-dark: var(--bouton-survol); }
html[data-theme="sombre"] .irrineo-wordmark-irri { color: var(--accent); }

html { background: var(--paper); }
body {
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
  letter-spacing: -.012em;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--teal-dark); }
h1, h2, h3 { color: var(--ink); letter-spacing: -.045em; }
h1 { font-weight: 650; }
.wordmark-irri { color: var(--s-txt-bleu, #407c85); }
.wordmark-neo { color: inherit; }
header h1:has(.wordmark-irri) { font-family: "Helvetica Neue", Arial, sans-serif; font-weight: 500; letter-spacing: .065em; }

header {
  padding: 24px max(24px, calc((100% - 1160px) / 2));
  color: var(--ink);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  box-shadow: none;
}
header::after { display: none; }
header h1, header > div { color: var(--ink); }
header h1 { margin: 0 0 12px; }
header:has(.site-button) { padding: 76px max(24px, calc((100% - 1160px) / 2)) 30px; }
header a { color: var(--teal-dark) !important; background: transparent; border: 1px solid var(--teal); }
.header-links { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; }
.header-links a {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  box-sizing:border-box;
  min-height:42px;
  padding:9px 15px;
  font-size:14px;
  line-height:1.2;
  text-decoration:none;
  background:transparent;
  box-shadow:none;
}
@media (hover: hover) { .header-links a:hover { background:var(--sage-soft); color:var(--teal-dark) !important; } }
.header-links a:focus-visible { outline:3px solid rgba(73,107,112,.35); outline-offset:3px; }

main { width: min(980px, calc(100% - 40px)); }
.card, .box {
  color: var(--ink);
  background: var(--s-carte, rgba(255, 255, 255, .72));
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: none;
}
.card:hover { box-shadow: none; }

button, .button, header a, .site-button, .account-button {
  border-radius: 999px;
  font-family: inherit;
  font-weight: 720;
  transition: transform .18s ease, background-color .18s ease, color .18s ease, border-color .18s ease;
}
@media (hover: hover) { button:hover, .button:hover, header a:hover { transform: translateY(-1px); box-shadow: none; } }
button:not(.leaflet-control-zoom-in):not(.leaflet-control-zoom-out):not(.leaflet-popup-close-button), .button {
  box-sizing:border-box;
  min-height:44px;
  padding:10px 16px;
  font-size:14px;
  line-height:1.3;
}
a.button { display:inline-flex;align-items:center;justify-content:center;text-decoration:none; }
@media (hover: hover) { .secondary:hover,.button.secondary:hover { background:var(--sage-soft);color:var(--teal-dark); } }
.button:focus-visible,button:focus-visible { outline:3px solid rgba(73,107,112,.35);outline-offset:3px; }
button:active, .button:active, header a:active { transform: scale(.98); }
.primary, button:not(.secondary):not(.danger):not(.link):not(.site-button):not(.account-button):not(.password-toggle) {
  color: var(--white);
  background: var(--teal);
}
@media (hover: hover) { .primary:hover, button:not(.secondary):not(.danger):not(.link):not(.site-button):not(.account-button):not(.password-toggle):hover {
  background: var(--teal-dark);
} }
.secondary, .button.secondary {
  color: var(--teal-dark);
  background: transparent;
  border: 1px solid var(--teal);
}
.danger { color: var(--danger); background: transparent; border: 1px solid rgba(154, 67, 61, .35); }

input, select, textarea {
  color: var(--ink);
  background: var(--s-carte, rgba(255, 255, 255, .76));
  border: 1px solid var(--line);
  border-radius: 12px;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: 3px solid rgba(73, 107, 112, .16);
  border-color: var(--teal);
  box-shadow: none;
  transform: none;
}

nav {
  background: rgba(170, 185, 174, .34);
  border: 1px solid var(--line);
  box-shadow: none;
}
nav button {
  color: var(--ink);
  background: transparent;
  border: 0;
  box-shadow: none;
}
@media (hover: hover) { nav button:hover { color: var(--white); background: var(--teal); } }

.site-button, .account-button {
  box-sizing: border-box;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 15px;
  color: var(--teal-dark) !important;
  background: transparent !important;
  border: 1px solid var(--teal);
  box-shadow: none;
  font-size: 14px;
  line-height: 1.2;
}
@media (hover: hover) { .site-button:hover, .account-button:hover { color: var(--teal-dark) !important; background: var(--sage-soft) !important; } }
.site-button[hidden] { display: none; }

header:has(.site-button) { padding-top: 68px; padding-bottom: 20px; }

.badge { border-radius: 999px; }
.vert { color: var(--s-txt-vert, #315d49); background: var(--s-carte-2, #dfe9e1); }
.orange { color: var(--s-txt-orange, #705923); background: var(--s-fond-orange, #eee5ca); }
.rouge { color: var(--s-txt-rouge, #a12525); background: var(--s-fond-rouge, #fce8e5); border: 1px solid var(--s-bord-rouge, #e8b4ad); }
.passage-resume { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 8px; }
.passage-resume .badge { margin: 0; }
.passage-defilement { max-width: 100%; overflow-x: auto; margin: 12px 0 18px; padding-bottom: 8px; }
.passage-plan { min-width: 120px; }
.passage-bandes { display: flex; height: 216px; border: 1px solid var(--teal-dark); }
.passage-bande { box-sizing: border-box; position: relative; flex: 0 0 120px; height: 100%; border-right: 1px solid rgba(23,37,34,.2); text-align: center; }
.passage-bande:last-child { border-right: 0; }
.passage-bande.faite { background: var(--s-carte-2, #e1ede3); color: var(--s-txt-vert, #28633f); }
.passage-bande.a-faire { background: var(--s-fond-rouge, #fae9e6); color: var(--s-txt-rouge, #a12525); }
.passage-axe { position: absolute; top: 0; bottom: 0; left: calc(50% - 1px); border-left: 2px dashed currentColor; }
.passage-numero, .passage-statut { position: absolute; z-index: 1; left: 50%; transform: translateX(-50%); padding: 2px 7px; border-radius: 5px; background: var(--s-carte, rgba(255,255,255,.88)); white-space: nowrap; font-size: 12px; font-weight: 700; }
.passage-numero { top: 10px; }
.passage-statut { bottom: 10px; }
.passage-position { position: absolute; z-index: 2; left: 50%; width: 15px; height: 15px; transform: translate(-50%,-50%); border: 3px solid #fff; border-radius: 50%; background: var(--teal-dark); box-shadow: 0 0 0 2px var(--teal-dark); }
.passage-bord { padding-top: 7px; color: var(--muted); font-size: 12px; }
.passage-estimation { padding: 12px 14px; border-radius: 12px; background: var(--sage-soft); }
#carte-plan-passages { height: 440px; min-height: 320px; margin: 14px 0; border: 1px solid var(--line); border-radius: 12px; background: var(--s-carte-2, #d8e2dd); z-index: 0; }
.legende-passages { display: flex; flex-wrap: wrap; gap: 14px; margin: 14px 0 6px; font-size: 14px; }
.legende-passages span { display: inline-flex; align-items: center; gap: 6px; }
.legende-passages i { display: inline-block; width: 18px; height: 11px; border-radius: 3px; }
.legende-rouge { background: #cf3030; }
.legende-vert { background: #238044; }
.legende-axe { border-top: 3px dashed #ed8a28; }
.numero-passage-carte { box-sizing: border-box; border: 2px solid white; border-radius: 50%; background: #243c3e; color: white; text-align: center; font-weight: 800; line-height: 22px; box-shadow: 0 1px 6px #0008; cursor: pointer; }
.details-passage-carte { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--s-carte, #f7faf7); }
.details-passage-carte h3 { margin: 0 0 8px; }
.details-passage-carte p { margin: 6px 0; }
.liste-passages-carte { display: flex; gap: 7px; flex-wrap: wrap; margin: 12px 0; }
.liste-passages-carte button { font-size: 13px; }
.irrigation-recap { margin: 12px 0 18px; }
.apercu-irrigation { display: grid; gap: 10px; width: min(100%, 440px); margin: 12px 0 18px; padding: 14px 16px; text-align: left; color: var(--ink) !important; background: var(--s-carte, #f7f8f4) !important; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; }
@media (hover: hover) { .apercu-irrigation:hover, .apercu-irrigation:focus-visible { border-color: var(--teal); background: var(--s-carte, #edf3ef) !important; } }
.apercu-irrigation-titre { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; font-weight: 750; }
.apercu-irrigation-corps { display: flex; align-items: stretch; gap: 13px; }
.apercu-irrigation-bandes { display: flex; flex: 1; gap: 5px; min-width: 0; overflow-x: auto; padding: 3px 0; }
.mini-passage { display: grid; flex: 1 0 26px; min-width: 26px; max-width: 52px; height: 42px; place-items: center; border-radius: 7px; color: white; background: #cf3030; font-size: 12px; font-weight: 800; }
.mini-passage.fait { background: #238044; }
.mini-passage.actif { background: linear-gradient(to bottom, #238044 var(--avance-passage, 0%), #cf3030 var(--avance-passage, 0%)); outline: 2px solid var(--ink); outline-offset: 1px; }
.jauge-irrigation { position: relative; display: block; flex: 0 0 34px; height: 48px; overflow: hidden; border: 2px solid var(--ink); border-radius: 7px; background: #cf3030; }
.jauge-irrigation-verte { position: absolute; top: 0; left: 0; right: 0; display: block; background: #238044; transition: height .5s ease; }
.part-irriguee, .pourcentage-vert { color: var(--s-txt-vert, #176a39); font-weight: 800; }
.part-restante, .pourcentage-rouge { color: var(--s-txt-rouge, #ae2727); font-weight: 800; }
.mini-passage-vide, .apercu-irrigation-legende { color: var(--muted); font-size: 12px; }
.resume-progression-irrigation { display: flex; flex-wrap: wrap; gap: 14px; font-size: 1.05rem; }
.fenetre-apercu-irrigation { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; padding: 14px; }
.fond-apercu-irrigation { position: absolute; inset: 0; background: rgba(12, 31, 29, .7); }
.panneau-apercu-irrigation { position: relative; box-sizing: border-box; width: min(1100px, 100%); max-height: calc(100dvh - 28px); overflow-y: auto; padding: clamp(18px, 3vw, 34px); border-radius: 20px; background: var(--paper); box-shadow: 0 20px 70px #0006; }
.panneau-apercu-irrigation h2 { margin: 15px 0 10px; }
.retour-apercu-irrigation { min-height: 42px; }
.details-irrigation-apercu { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 22px; margin-top: 18px; }
.details-irrigation-apercu p { margin: 5px 0; }
@media (max-width: 650px) { .fenetre-apercu-irrigation { padding: 0; } .panneau-apercu-irrigation { width: 100%; height: 100dvh; max-height: 100dvh; border-radius: 0; } .details-irrigation-apercu { grid-template-columns: 1fr; } .panneau-apercu-irrigation #carte-plan-passages { height: 48dvh; min-height: 300px; } }
.historique-entree { padding: 18px 0; border-top: 1px solid var(--line); }
.historique-entree h3 { margin: 0; font-size: 1.08rem; }
.historique-entree p { margin: 9px 0 14px; }
.historique-entree .section-actions { margin-bottom: 0; }
.historique-entree .section-actions button { flex: 0 1 auto; }
.cycle-card, details { background: var(--s-carte-2, rgba(223, 229, 223, .5)); border-color: var(--line); }
.cycle-card:has(.badge.rouge) { background: var(--s-carte, #fff7f5); border-color: var(--s-bord-rouge, #e8b4ad); }
.info, .lead, .card p { color: var(--muted); }

.box { padding: 34px; }
.box h1 { margin-bottom: 8px; color: var(--ink); }
.box > p:first-of-type { color: var(--muted); }
.link { color: var(--teal-dark); background: transparent; }
.consent a { color: var(--teal-dark); }
.password-toggle { color: var(--teal-dark); background: transparent; }
.ic-privacy-manage { width: auto !important; }
.box button[onclick="inscription()"] { color: var(--teal-dark); background: transparent; border: 1px solid var(--teal); }

.brand { color: var(--ink); letter-spacing: .08em; text-transform: uppercase; }
.brand:has(.wordmark-irri) { gap: 0; }
.brand img { display: none; }
.hint { color: var(--ink); background: var(--sage-soft); border: 1px solid var(--line); }
.back { color: var(--teal-dark); }

#map { border: 1px solid var(--line); border-radius: 20px; }

@media (max-width: 640px) {
  main { width: min(100% - 24px, 980px); padding-left: 0; padding-right: 0; }
  header { padding-left: 16px; padding-right: 16px; }
  header:has(.site-button) { padding: calc(68px + env(safe-area-inset-top)) 16px 16px; }
  .card, .box { border-radius: 16px; }
  .box { width: min(100% - 28px, 430px); padding: 24px 20px; }
  .site-button, .account-button { font-size: 12px; padding: 7px 9px; }
  .ic-privacy-manage { min-height: 38px; }
}
/* Fond de page uni, même sur les pages dont l'ancien dégradé était écrit en dur. */
html body { background: var(--fond) !important; }

/* Cibles tactiles d'au moins 44 px (champs, listes, déroulants) et marque lisible en clair (≥ 4,5:1). */
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="range"]):not([type="file"]), select, textarea { min-height: 44px; box-sizing: border-box; }
summary { min-height: 44px; }
html body .irrineo-wordmark-irri { color: var(--accent); }
