/* ============================================================
   style-base.css — Trombinoscope · base commune
   Toujours chargé. Sections : variables, reset, accessibilité,
   navigation, boutons, blocs, formulaires, tableaux, connexion,
   responsive, effets visuels, impression, filet de sécurité.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,500..800&family=Instrument+Sans:wght@400;500;600;700&display=swap');

/* ============================================================
   1. Variables
   ============================================================ */
:root {
  --accent-abysse: #061b30;
  --accent:        #0b3c63;
  --accent-hover:  #11558a;
  --accent-ocean:  #0c6aa0;
  --accent-clair:  #3a93c4;

  --accent-doux:   #1c9fb6;
  --accent-aqua:   #3ad4e4;
  --accent-pale:   #e9f5fa;

  --danger:        #e5583a;
  --danger-hover:  #cc472b;
  --succes:        #1f9d8a;

  --bord:          #e1eaf0;
  --bord-fort:     #c9d9e4;
  --fond:          #f4f8fb;
  --fond-blanc:    #ffffff;
  --texte:         #0c1a2b;
  --texte-doux:    #566779;
  --gris:          #8a9bb0;
  --gris-hover:    #5b6b7d;

  --nav-texte:     #ffffff;
  --nav-hover:     rgba(255, 255, 255, 0.12);

  --font-titre: 'Bricolage Grotesque', 'Instrument Sans', system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-texte: 'Instrument Sans', system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --r-sm:  8px;
  --r:     12px;
  --r-lg:  16px;

  --ombre-1: 0 1px 2px rgba(6, 27, 48, 0.06);
  --ombre-2: 0 2px 6px rgba(6, 27, 48, 0.07), 0 1px 2px rgba(6, 27, 48, 0.05);
  --ombre-3: 0 8px 20px rgba(6, 27, 48, 0.09), 0 2px 4px rgba(6, 27, 48, 0.05);
  --ombre-4: 0 18px 44px rgba(6, 27, 48, 0.16), 0 4px 10px rgba(6, 27, 48, 0.06);

  --degrade-abysse:  linear-gradient(180deg, #0a3153 0%, #061b30 100%);
  --degrade-ocean:   #0c6aa0;
  --degrade-aqua:    #3ad4e4;
  --degrade-corail:  #e5583a;

  --focus-ring: 0 0 0 3px rgba(28, 159, 182, 0.28);

  --t: .16s ease;
}

/* ============================================================
   2. Reset et base
   ============================================================ */
html {
  background: var(--fond);
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
  min-height: 100%;
}

* { box-sizing: border-box; }

body {
  font-family: var(--font-texte);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  margin: 0;
  color: var(--texte);
  line-height: 1.55;
  min-height: 100vh;
}

table, .num, .evt-jour, .badge-progression, .note, .nb-pers { font-variant-numeric: tabular-nums; }

main { max-width: 1100px; margin: 0 auto; padding: 24px; position: relative; z-index: 1; }

h1 {
  font-family: var(--font-titre);
  color: var(--accent-abysse);
  font-weight: 700;
  font-size: 1.85rem;
  line-height: 1.15;
  letter-spacing: -0.025em;
  text-wrap: balance;
  position: relative;
  padding-left: 18px;
  margin: 0 0 24px;
}
h1::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.14em;
  bottom: 0.14em;
  width: 4px;
  background: var(--accent-doux);
  border-radius: 2px;
}

h2 { font-family: var(--font-titre); color: var(--accent); font-weight: 600; font-size: 1.25rem; letter-spacing: -0.015em; text-wrap: balance; margin: 28px 0 12px; }
h3 { font-family: var(--font-titre); color: var(--accent); font-weight: 600; font-size: 1.02rem; letter-spacing: -0.01em; margin: 20px 0 10px; }

a { color: var(--accent); text-decoration: none; transition: color var(--t); }
a:hover { color: var(--accent-hover); }

/* ============================================================
   3. Accessibilité
   ============================================================ */
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--r-sm);
}

::selection {
  background: rgba(58, 212, 228, 0.35);
  color: var(--accent-abysse);
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--bord-fort) transparent;
}
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--bord-fort);
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--gris);
  background-clip: padding-box;
}

input[type=checkbox],
input[type=radio] {
  accent-color: var(--accent-doux);
  width: 18px;
  height: 18px;
  cursor: pointer;
  vertical-align: -3px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   4. Navigation
   ============================================================ */
.barre-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 10px 20px 14px;
  background: var(--degrade-abysse);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 6px 20px rgba(6, 27, 48, 0.22);
  margin: 0;
}
.barre-nav::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 4px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 6' preserveAspectRatio='none'><path d='M0,3 Q12.5,0 25,3 T50,3 T75,3 T100,3' fill='none' stroke='%233ad4e4' stroke-width='1.8'/></svg>");
  background-size: 100% 4px;
  background-repeat: no-repeat;
  opacity: .75;
}

.nav-burger {
  display: none;
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 8px;
  cursor: pointer;
  border-radius: var(--r-sm);
  align-items: center;
  justify-content: center;
  transition: background var(--t);
}
.nav-burger:hover { background: var(--nav-hover); }

.nav-menu {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  flex: 1 1 auto;
}

.nav-lien,
.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--r-sm);
  font: inherit;
  font-size: .88rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
  color: var(--nav-texte);
  background: transparent;
  transition: background var(--t);
}
.nav-lien:hover,
.nav-toggle:hover,
.nav-item.ouvert > .nav-toggle,
.nav-item.actif-parent > .nav-toggle {
  background: var(--nav-hover);
}
.nav-lien.actif {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border-color: transparent;
  box-shadow: inset 0 -2px 0 var(--accent-aqua), 0 0 10px rgba(58, 212, 228, 0.25);
}

.nav-item { position: relative; }

.nav-chevron {
  font-size: 10px;
  opacity: .8;
  margin-left: 2px;
  transition: transform var(--t);
  display: inline-block;
}
.nav-item.ouvert > .nav-toggle .nav-chevron,
.nav-item:hover > .nav-toggle .nav-chevron { transform: rotate(180deg); }

.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 250px;
  margin-top: 0;
  padding: 6px;
  padding-top: 12px;
  background: transparent;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-4px);
  transform-origin: top left;
  transition: opacity .15s ease, transform .15s ease, visibility 0s linear .15s;
  z-index: 100;
  max-height: 80vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.nav-dropdown::before {
  content: '';
  position: absolute;
  top: 6px; left: 0; right: 0; bottom: 0;
  background: #fff;
  border-radius: var(--r);
  box-shadow: var(--ombre-4), 0 0 0 1px var(--bord);
  z-index: -1;
  pointer-events: none;
}
.nav-dropdown > * { position: relative; z-index: 1; }

.nav-item:hover > .nav-dropdown,
.nav-item:focus-within > .nav-dropdown,
.nav-item.ouvert > .nav-dropdown {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0s;
}

.nav-dropdown a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  color: var(--texte);
  font-size: .88rem;
  text-decoration: none;
  transition: background var(--t), color var(--t), transform var(--t);
}
.nav-dropdown a:hover {
  background: var(--accent-pale);
  color: var(--accent-abysse);
  transform: translateX(3px);
}
.nav-dropdown a.actif {
  background: var(--accent-pale);
  color: var(--accent);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--accent-doux);
}

.nav-section-titre {
  padding: 10px 12px 4px;
  font-size: .76rem;
  font-weight: 600;
  color: var(--texte-doux);
  border-top: 1px solid var(--bord);
  margin-top: 4px;
}
.nav-section-titre:first-child { border-top: 0; margin-top: 0; }

.nav-droite {
  margin-left: auto;
  display: flex;
  gap: 6px;
  align-items: center;
}
.nav-droite a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--r-sm);
  font-size: .88rem;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--t);
}
.nav-droite .principal {
  background: var(--accent-aqua);
  color: var(--accent-abysse);
  font-weight: 700;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25) inset;
}
.nav-droite .principal:hover {
  background: #6fe2ee;
  box-shadow: 0 6px 22px rgba(58, 212, 228, 0.55);
  transform: translateY(-1px);
}
.nav-droite .danger {
  background: var(--danger);
  color: #fff;
}
.nav-droite .danger:hover {
  background: var(--danger-hover);
}

/* ============================================================
   5. Boutons
   ============================================================ */
button, .btn {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--accent-ocean) 0%, var(--accent-clair) 100%);
  color: #fff;
  border: 0;
  border-radius: var(--r-sm);
  padding: 10px 18px;
  font: inherit;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  white-space: nowrap;
  transition: background var(--t), box-shadow .25s ease, transform .2s ease;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 2px 6px rgba(6, 27, 48, 0.22),
    0 8px 18px -6px rgba(12, 106, 160, 0.55);
}
button:hover, .btn:hover {
  background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent-doux) 100%);
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 4px 10px rgba(6, 27, 48, 0.25),
    0 14px 26px -6px rgba(28, 159, 182, 0.65);
}
button:active, .btn:active {
  transform: scale(0.98);
  box-shadow: none;
}
button:disabled { opacity: .55; cursor: wait; transform: none !important; }

button::before, .btn::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 30%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.42), transparent);
  transform: translateX(-130%) skewX(-20deg);
  pointer-events: none;
}
button:hover::before, .btn:hover::before { animation: eclat .7s ease; }

button.secondaire, .btn.secondaire { background: var(--gris-hover); }
button.secondaire:hover, .btn.secondaire:hover { background: #46566a; }

button.danger, .btn.danger { background: var(--danger); color: #fff; }
button.danger:hover, .btn.danger:hover {
  background: var(--danger-hover);
  color: #fff;
  box-shadow: 0 2px 8px rgba(229, 88, 58, 0.30);
}

button.mini, .btn.mini { padding: 5px 10px; font-size: .82rem; }
button.neutre, .btn.neutre {
  background: #fff;
  color: var(--accent);
  border: 1px solid var(--bord-fort);
  box-shadow: none;
}
button.neutre:hover, .btn.neutre:hover {
  background: var(--accent-pale);
  border-color: var(--accent-doux);
  color: var(--accent-abysse);
  box-shadow: none;
}

button.ia {
  background: linear-gradient(135deg, #1c9fb6 0%, #6d4fe0 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: none;
}
button.ia:hover {
  background: linear-gradient(135deg, #27b2c8 0%, #7f63ec 100%);
  box-shadow: none;
}
button.ia:disabled { opacity: .7; }
button.ia svg.ico { vertical-align: 0; }

.btn-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: var(--r-sm);
  border: 0;
  cursor: pointer;
  text-decoration: none;
  background: var(--accent-pale);
  color: var(--accent);
  box-shadow: none;
  transition: background var(--t), color var(--t), transform .12s ease;
  vertical-align: middle;
}
.btn-ico:hover {
  background: var(--accent-ocean);
  color: #fff;
  box-shadow: none;
  transform: none;
}
.btn-ico:active { transform: scale(0.95); }
.btn-ico.principal { background: var(--accent-ocean); color: #fff; }
.btn-ico.principal:hover { background: var(--accent-hover); }
.btn-ico.danger { background: var(--danger); color: #fff; }
.btn-ico.danger:hover { background: var(--danger-hover); }
.btn-ico svg.ico { vertical-align: 0; }

.actions-ico {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  justify-content: flex-end;
  white-space: nowrap;
}

/* ============================================================
   6. Blocs et messages
   ============================================================ */
.bloc {
  background: var(--fond-blanc);
  border: 1px solid var(--bord);
  border-radius: var(--r-lg);
  padding: 22px 24px;
  margin-bottom: 20px;
  box-shadow: var(--ombre-1);
  position: relative;
  transition: box-shadow .3s ease, border-color .3s ease;
  animation: montee .55s cubic-bezier(.2, .7, .2, 1) backwards;
}
.bloc:nth-child(2) { animation-delay: .07s; }
.bloc:nth-child(3) { animation-delay: .14s; }
.bloc:nth-child(4) { animation-delay: .21s; }
.bloc:nth-child(n+5) { animation-delay: .28s; }

.msg {
  padding: 14px 18px;
  border-radius: var(--r);
  margin-bottom: 16px;
  font-size: .92rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  border-left-width: 3px;
  border-left-style: solid;
}
.msg.ok   { background: #d7f0eb; color: #146b5e; border-left-color: #059669; }
.msg.err  { background: #fde7e0; color: #9b2c15; border-left-color: var(--danger); }
.msg.warn { background: #fdf6e0; color: #7a5a1a; border-left-color: #d97706; }

/* ============================================================
   7. Formulaires
   ============================================================ */
label { font-size: .88rem; font-weight: 500; }
.champ label { display: block; font-weight: 600; font-size: .84rem; margin-bottom: 6px; color: var(--texte); }

input[type=text],
input[type=password],
input[type=time],
input[type=date],
input[type=datetime-local],
input[type=file],
input[type=email],
input[type=tel],
input[type=number],
input[type=color],
input[type=search],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--bord-fort);
  border-radius: var(--r-sm);
  font: inherit;
  font-size: .92rem;
  box-sizing: border-box;
  background: #fff;
  color: var(--texte);
  transition: border-color var(--t), box-shadow var(--t);
}
input[type=color] { width: 48px; height: 36px; padding: 0; cursor: pointer; }
input[type=search] { -webkit-appearance: none; appearance: none; }

input:hover, select:hover, textarea:hover { border-color: var(--gris); }
input:focus, select:focus, textarea:focus {
  outline: none;
  background: #fff;
  border-color: var(--accent-doux);
  box-shadow: var(--focus-ring);
}
textarea { resize: vertical; }

input[type=file]::file-selector-button {
  border: 0;
  background: var(--accent-pale);
  color: var(--accent);
  padding: 6px 12px;
  border-radius: var(--r-sm);
  margin-right: 10px;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--t);
}
input[type=file]::file-selector-button:hover { background: #cfe9f2; }

.grille2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grille3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

.couleur-ligne { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.couleur-ligne input[type=text] {
  width: 100px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  text-transform: lowercase;
}

fieldset {
  border: 1px solid var(--bord);
  border-radius: var(--r);
  margin: 0 0 16px;
  padding: 12px 16px 16px;
  background: #fbfdfe;
}
legend {
  font-weight: 700;
  padding: 0 8px;
  color: var(--accent);
  font-size: .92rem;
  letter-spacing: -0.01em;
}

.form-edit {
  background: var(--accent-pale);
  border-left: 3px solid var(--accent);
  padding: 14px 16px;
  margin: 10px 0 14px;
  border-radius: 0 var(--r) var(--r) 0;
}

/* ============================================================
   8. Tableaux
   ============================================================ */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: .9rem;
  box-shadow: 0 0 0 1px var(--bord-fort), var(--ombre-2);
  border-radius: var(--r-sm);
}

.page-fiche table.table-suivi,
.page-gestion table.sous-competences,
.page-gestion table.exercices,
table.pal-table {
  box-shadow: none;
  border-radius: 0;
}

th {
  background: var(--degrade-abysse);
  color: #fff;
  font-weight: 700;
  text-align: left;
  padding: 12px 14px;
  font-size: .8rem;
  letter-spacing: .03em;
  border: 0;
  border-bottom: 2px solid var(--accent-aqua);
}
th:first-child { border-radius: var(--r-sm) 0 0 0; }
th:last-child  { border-radius: 0 var(--r-sm) 0 0; }

td {
  text-align: left;
  padding: 12px 14px;
  color: var(--texte);
  border-bottom: 1px solid var(--bord-fort);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background var(--t); }
tbody tr:nth-child(even) { background: #eaf3f9; }
tbody tr:nth-child(odd)  { background: #ffffff; }
tbody tr:hover { background: #d3e8f4; }
tbody tr:hover td:first-child { box-shadow: inset 4px 0 0 var(--accent-doux); }

.page-fiche table.table-suivi th,
.page-gestion table.sous-competences th,
.page-gestion table.exercices th,
table.pal-table th {
  background: #c9e0ee;
  color: var(--accent-abysse);
  font-weight: 700;
  border-bottom: 2px solid var(--accent-doux);
}
.page-gestion table.exercices td.cell-consignes {
  max-width: 460px;
  font-size: .84rem;
  line-height: 1.5;
}
.page-gestion table.exercices td.cell-consignes .txt {
  white-space: pre-line;
}
.page-gestion table.exercices details.consignes-details > summary {
  cursor: pointer;
  color: var(--accent);
  font-size: .84rem;
  list-style: none;
}
.page-gestion table.exercices details.consignes-details > summary::-webkit-details-marker { display: none; }
.page-gestion table.exercices details.consignes-details > summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 4px;
  transition: transform var(--t);
}
.page-gestion table.exercices details.consignes-details[open] > summary::before {
  transform: rotate(90deg);
}
.page-gestion table.exercices details.consignes-details[open] > div.txt {
  margin-top: 6px;
  padding: 8px 10px;
  background: #fbfdfe;
  border-left: 2px solid var(--accent-pale);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

/* ============================================================
   9. Divers / utilitaires
   ============================================================ */
.muted { color: var(--texte-doux); font-size: .85rem; }
.inline { display: inline; }

.pastille {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: -1px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.4) inset;
}

.poignee {
  cursor: grab;
  user-select: none;
  color: var(--gris);
  font-size: 16px;
  padding: 0 4px;
  transition: color var(--t);
}
.poignee:hover { color: var(--texte-doux); }
.poignee:active { cursor: grabbing; }
.drag-ghost  { opacity: .4; }
.drag-chosen { outline: 2px solid var(--accent-doux); }

details > summary { cursor: pointer; user-select: none; }
details > summary:hover { color: var(--accent); }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 600;
}
.badge.actif {
  background: #dcf3ec;
  color: #0f6b58;
}
.badge.actif::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  margin-right: 6px;
  vertical-align: 1px;
  border-radius: 50%;
  background: var(--succes);
  animation: pouls 2s ease-out infinite;
}
.badge.archive {
  background: #e8eef3;
  color: #3d4c5c;
}
.badge.warn {
  background: #fdf1d3;
  color: #7a5410;
}

svg.ico {
  vertical-align: -3px;
  flex: 0 0 auto;
  pointer-events: none;
}

.page-gestion .onglets-gestion button,
.page-fiche .onglets-fiche button,
.page-index .onglets button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.page-gestion .onglets-gestion button svg.ico,
.page-fiche .onglets-fiche button svg.ico,
.page-index .onglets button svg.ico {
  vertical-align: 0;
}

.vide-global,
.vide {
  text-align: center;
  padding: 48px 24px;
  color: var(--accent-ocean);
  font-style: italic;
  background: #ffffff;
  border: 1px dashed var(--bord-fort);
  border-radius: var(--r);
}

/* ============================================================
   10. Connexion
   ============================================================ */
.carte-connexion {
  max-width: 380px;
  width: 100%;
  background: var(--fond-blanc);
  border: 1px solid var(--bord);
  border-radius: var(--r-lg);
  padding: 32px 28px;
  margin: 80px auto 0;
  box-shadow: var(--ombre-4), 0 0 0 1px rgba(28, 159, 182, 0.22), 0 0 70px -12px rgba(58, 212, 228, 0.5);
  animation: montee .7s cubic-bezier(.2, .7, .2, 1) backwards;
}
.carte-connexion h1 {
  font-size: 1.25rem;
  margin: 0 0 20px;
  text-align: center;
  padding-left: 0;
  color: var(--accent-abysse);
}
.carte-connexion h1::before { display: none; }
.carte-connexion button { width: 100%; margin-top: 20px; padding: 12px; }
.carte-connexion a {
  display: block;
  margin-top: 14px;
  text-align: center;
  color: var(--accent);
  text-decoration: none;
  font-size: .9rem;
}
.carte-connexion a:hover { color: var(--accent-hover); }

/* ============================================================
   21. Responsive (base uniquement)
   ============================================================ */
@media (max-width: 768px) {
  .barre-nav { flex-wrap: wrap; padding: 8px 12px; }
  .nav-burger { display: inline-flex; }
  .nav-menu {
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    order: 3;
    background: var(--degrade-abysse);
    padding: 8px 0;
    gap: 2px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    margin-top: 8px;
  }
  .nav-menu.ouvert { display: flex; }
  .nav-item { width: 100%; }
  .nav-lien,
  .nav-toggle {
    width: 100%;
    justify-content: flex-start;
    text-align: left;
    padding: 10px 12px;
  }
  .nav-chevron { margin-left: auto; }

  .nav-dropdown {
    position: static;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--r-sm);
    margin: 4px 8px;
    padding: 4px;
    max-height: none;
    visibility: visible;
    opacity: 1;
    transform: none;
    display: none;
    transition: none;
    overflow: visible;
  }
  .nav-dropdown::before { display: none; }
  .nav-item:hover > .nav-dropdown,
  .nav-item:focus-within > .nav-dropdown { display: none; }
  .nav-item.ouvert > .nav-dropdown { display: flex; }
  .nav-dropdown a { color: #fff; padding: 8px 12px; }
  .nav-dropdown a:hover { background: rgba(255, 255, 255, 0.15); color: #fff; padding-left: 12px; transform: none; }
  .nav-dropdown a.actif { background: #fff; color: var(--accent-abysse); }
  .nav-section-titre { color: rgba(255, 255, 255, 0.6); border-top-color: rgba(255, 255, 255, 0.1); }

  .nav-droite { order: 2; }
  .nav-droite a { padding: 6px 10px; font-size: .82rem; }
  .nav-droite a span { display: none; }

  /* Performance mobile : désactiver les animations de boucle */
  body::before,
  h1::before,
  .comp-progression-remplie::after,
  .badge.actif::before { animation: none !important; }
}

@media (max-width: 640px) {
  .grille2, .grille3 { grid-template-columns: 1fr; }
  main { padding: 16px; }
  h1 { font-size: 1.4rem; }
}

/* ============================================================
   22. Effets visuels (halos, animations)
   ============================================================ */
@keyframes vague-defile  { to { background-position-x: 120px; } }
@keyframes bulles-montent {
  from { background-position: 20px 0,   90px 30px, 200px 10px; }
  to   { background-position: 20px -70px, 90px -45px, 200px -80px; }
}
@keyframes lumiere-derive { from { background-position: 0% 0%; } to { background-position: 100% 100%; } }
@keyframes montee     { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes apparition { from { opacity: 0; transform: scale(.92); }       to { opacity: 1; transform: none; } }
@keyframes eau-coule  { to { background-position-y: 60px; } }
@keyframes eclat      { from { transform: translateX(-130%) skewX(-20deg); } to { transform: translateX(380%) skewX(-20deg); } }
@keyframes brillance  { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes pouls {
  0%   { box-shadow: 0 0 0 0 rgba(31, 157, 138, 0.55); }
  70%  { box-shadow: 0 0 0 6px rgba(31, 157, 138, 0); }
  100% { box-shadow: 0 0 0 0 rgba(31, 157, 138, 0); }
}

body::before,
.barre-nav::before,
.barre-nav::after,
h1::before,
.comp-progression-remplie::after {
  will-change: transform, background-position;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 40% at 15% 10%, rgba(58, 212, 228, 0.16), transparent 70%),
    radial-gradient(ellipse 50% 45% at 90% 85%, rgba(12, 106, 160, 0.13), transparent 70%),
    radial-gradient(ellipse 40% 30% at 60% 40%, rgba(58, 212, 228, 0.08), transparent 70%);
  background-size: 140% 140%;
  animation: lumiere-derive 24s ease-in-out infinite alternate;
}

/* ============================================================
   22bis. Océan animé dans la barre de navigation
   ============================================================ */

/* Permet à .nav-mer (plus grand que le parent) de déborder */
.barre-nav { overflow: visible; }

/* Wrapper animé : le roulis du bateau */
.nav-mer {
  position: absolute;
  inset: -8px;              /* plus grand que le parent → la rotation reste couverte */
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
  animation: nav-roulis 9s ease-in-out infinite;
  will-change: transform;
}

.nav-mer-couche {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Tout le contenu du nav passe AU-DESSUS de l'océan */
.barre-nav > :not(.nav-mer) {
  position: relative;
  z-index: 1;
}

/* Couche 1 — écume qui respire dans le fond */
.nav-mer-fond {
  background:
    radial-gradient(ellipse 60% 120% at 20% 120%, rgba(58, 212, 228, 0.30), transparent 65%),
    radial-gradient(ellipse 55% 100% at 80% -20%, rgba(28, 159, 182, 0.35), transparent 60%),
    radial-gradient(ellipse 40%  80% at 50% 100%, rgba(58, 212, 228, 0.15), transparent 70%);
  animation: nav-fond-brille 12s ease-in-out infinite alternate;
}

/* Couche 2 — vague arrière, glisse lentement vers la gauche */
.nav-mer-vague-arriere {
  top: auto;
  bottom: 8px;              /* compense l'inset:-8px → colle au bas du nav */
  height: 20px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 20' preserveAspectRatio='none'><path d='M0,10 Q30,3 60,10 T120,10 T180,10 T240,10 L240,20 L0,20 Z' fill='%230c6aa0' opacity='0.55'/></svg>");
  background-size: 240px 20px;
  background-repeat: repeat-x;
  animation: vague-glisse-gauche 18s linear infinite;
}

/* Couche 3 — bulles qui remontent (plus rapide qu'avant) */
.nav-mer-bulles {
  opacity: .85;
  background-image:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.50) 0 2px, transparent 3px),
    radial-gradient(circle at 50% 50%, rgba(58, 212, 228, 0.75) 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.35) 0 3px, transparent 4px);
  background-size: 173px 70px, 241px 45px, 317px 80px;
  background-repeat: repeat;
  background-position: 20px 0, 90px 30px, 200px 10px;
  animation: bulles-remontent 8s linear infinite;
  will-change: background-position;
}

/* Couche 4 — vague avant, turquoise, glisse vers la droite */
.nav-mer-vague-avant {
  top: auto;
  bottom: 8px;
  height: 6px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 6' preserveAspectRatio='none'><path d='M0,3 Q25,0 50,3 T100,3 T150,3 T200,3 L200,6 L0,6 Z' fill='%233ad4e4' opacity='0.9'/></svg>");
  background-size: 200px 6px;
  background-repeat: repeat-x;
  animation: vague-glisse-droite 11s linear infinite;
  filter: drop-shadow(0 0 6px rgba(58, 212, 228, 0.85));
}

/* Couche 5 — écume qui balaye en diagonale */
.nav-mer-lueur {
  background: linear-gradient(105deg,
    transparent 20%,
    rgba(255, 255, 255, 0.10) 40%,
    rgba(58, 212, 228, 0.22) 50%,
    rgba(255, 255, 255, 0.10) 60%,
    transparent 80%);
  background-size: 300% 100%;
  background-position: -100% 0;
  animation: lueur-nav 7s ease-in-out infinite;
  mix-blend-mode: screen;
  opacity: .9;
}

/* --- Keyframes --- */
@keyframes nav-roulis {
  0%, 100% { transform: rotate(-0.5deg) translate(-2px, 0); }
  25%      { transform: rotate(0deg)    translate(0,   -2px); }
  50%      { transform: rotate(0.5deg)  translate(2px,  0); }
  75%      { transform: rotate(0deg)    translate(0,   -2px); }
}

@keyframes nav-fond-brille {
  from { opacity: .65; }
  to   { opacity: 1; }
}

@keyframes bulles-remontent {
  from { background-position: 20px 0,      90px 30px,   200px 10px; }
  to   { background-position: 20px -140px, 90px -90px,  200px -160px; }
}

@keyframes vague-glisse-gauche {
  from { background-position-x: 0; }
  to   { background-position-x: -240px; }
}

@keyframes vague-glisse-droite {
  from { background-position-x: 0; }
  to   { background-position-x: 200px; }
}

@keyframes lueur-nav {
  0%   { background-position: -100% 0; }
  60%  { background-position:  200% 0; }
  100% { background-position:  200% 0; }
}

/* Neutralise les anciens pseudo-éléments (au cas où ils traînent) */
.barre-nav::before,
.barre-nav::after {
  display: none !important;
}

/* Respecte la préférence système « réduire les animations » */
@media (prefers-reduced-motion: reduce) {
  .nav-mer,
  .nav-mer-couche {
    animation: none !important;
  }
}
.nav-lien:hover, .nav-toggle:hover, .nav-burger:hover { transform: none; box-shadow: none; }

h1::before {
  background-image: linear-gradient(180deg, var(--accent-aqua), var(--accent-ocean), var(--accent-aqua));
  background-size: 100% 60px;
  background-repeat: repeat-y;
  box-shadow: 0 0 10px rgba(58, 212, 228, 0.55);
  animation: eau-coule 3s linear infinite;
}
.page-index .section h1::before {
  animation: none;
  background-image: none;
  background: var(--accent-doux);
  box-shadow: none;
}

.bloc::before {
  content: '';
  position: absolute;
  left: 24px; right: 24px; top: -1px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, var(--accent-doux), var(--accent-aqua));
  box-shadow: 0 0 12px rgba(58, 212, 228, 0.7);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .45s ease;
  pointer-events: none;
}
.bloc:hover {
  box-shadow: var(--ombre-3), 0 0 0 1px rgba(28, 159, 182, 0.28);
  border-color: rgba(28, 159, 182, 0.45);
}
.bloc:hover::before { transform: scaleX(1); }

/* ============================================================
   23. Impression
   ============================================================ */
@media print {
  @page { size: A4 landscape; margin: 8mm; }

  html, body {
    background: #fff !important;
    font-size: 11px;
  }

  *, *::before, *::after { animation: none !important; transition: none !important; }
  body::before,
  .barre-nav::before,
  .bloc::before,
  button::before,
  .btn::before { display: none !important; }

  .barre-nav,
  .nav-date,
  .croix,
  .msg,
  .reserve,
  .reserve-globale,
  .secours,
  .no-print { display: none !important; }

  .bloc,
  .carte,
  .comp-panneau,
  .pal-groupe-section,
  .pal-emplacement-section,
  .modal-ia-boite {
    background: #fff !important;
    background-image: none !important;
    box-shadow: none !important;
    border: 1px solid var(--bord) !important;
  }
  .barre-nav {
    background: var(--accent) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  th {
    background: var(--accent) !important;
    color: #fff !important;
    text-shadow: none !important;
  }
  h1 {
    color: var(--accent) !important;
    -webkit-text-fill-color: var(--accent) !important;
  }
  h1::before { background: var(--accent-doux) !important; box-shadow: none !important; }

  .apercu-page { padding: 0; overflow: visible; }
  #trombi {
    width: 1100px; max-width: none;
    padding: 0; border: 0; box-shadow: none;
  }
  .carte { width: 110px; height: 170px; box-shadow: 0 1px 2px rgba(0,0,0,0.15); }
  .carte .photo { width: 90px; height: 98px; }
  .etiquettes { border-style: solid; background: #fff; }

  .pal-emplacement-section,
  .pal-groupe-section,
  table.pal-table {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

/* ============================================================
   24. Filet de sécurité
   ============================================================ */
[style*="background-color"] {
  background-image: none !important;
}