/* Livret de progression ULM — charte ACD 2026, comme le sommaire des services. */
@font-face { font-family: Archivo; src: url(/assets/fonts/Archivo-italic-800-900.woff2) format("woff2"); font-style: italic; font-weight: 800 900; font-stretch: 100% 125%; font-display: swap; }
@font-face { font-family: "Roboto Condensed"; src: url(/assets/fonts/RobotoCondensed-normal-300-700.woff2) format("woff2"); font-weight: 300 700; font-display: swap; }

:root {
  --azur: #07548e; --acier: #779cc1; --rose: #bca0b2; --nuit: #043456; --ciel: #eef3f8; --blanc: #fff;
  --encre: #1b2735; --gris: #4a6680; --trait: #d5e1ec; --vert: #2f8a5b; --ambre: #b7791f;
  --titre: Archivo, "Arial Black", sans-serif;
  --texte: "Roboto Condensed", "Arial Narrow", sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--texte); color: var(--encre); background: var(--ciel); line-height: 1.45; min-height: 100vh; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--azur); }

.titre { font-family: var(--titre); font-style: italic; font-weight: 900; font-stretch: 125%; text-transform: uppercase; line-height: .95; letter-spacing: -.01em; }
.titre mark { background: none; color: var(--rose); }
.surtitre { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--acier); }
.tiret { flex: none; width: 24px; height: 7px; background: var(--rose); transform: skewX(-24deg); }

/* ---------- Connexion ---------- */
.accueil { min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(120% 140% at 85% 20%, #0a64a6 0%, var(--azur) 45%, var(--nuit) 100%); color: var(--blanc); }
.accueil-int { width: 100%; max-width: 540px; margin: auto; padding: 48px 20px; text-align: center; }
.accueil .logo { width: min(320px, 72vw); display: block; margin: 0 auto 48px; }
.accueil .surtitre { color: var(--rose); margin-bottom: 16px; justify-content: center; }
/* Le titre tient dans la largeur du formulaire, sur le même axe que le logo. */
.accueil h1 { font-size: clamp(30px, 8.4vw, 50px); margin-bottom: 30px; }
.accueil h1 mark { color: var(--acier); display: block; }
.accueil p.intro { font-weight: 300; font-size: 17px; color: rgba(255,255,255,.88); margin-bottom: 26px; }
.carte-connexion { background: var(--blanc); color: var(--encre); padding: 28px 26px; text-align: left; }
.carte-connexion label { display: block; font-weight: 700; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--gris); margin: 0 0 6px; }
.carte-connexion input { margin-bottom: 16px; }
.mention { font-size: 13px; color: rgba(255,255,255,.75); margin-top: 18px; }
.mention.sombre { color: var(--gris); }

/* ---------- Barre ---------- */
.barre { background: var(--nuit); color: var(--blanc); position: sticky; top: 0; z-index: 10; padding-top: env(safe-area-inset-top); }
.barre-int { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; gap: 14px; padding: 10px 16px; }
.barre img { height: 40px; display: block; }
.barre .nom-app { white-space: nowrap; font-family: var(--titre); font-style: italic; font-weight: 900; font-stretch: 125%; text-transform: uppercase; font-size: 18px; line-height: 1.05; }
.barre .nom-app mark { background: none; color: var(--rose); }
.barre .espace { flex: 1; }
.barre .qui { font-size: 14px; color: rgba(255,255,255,.8); }
.barre button { background: none; border: 1px solid rgba(255,255,255,.35); color: var(--blanc); padding: 5px 10px; font-size: 13px; cursor: pointer; }
.barre a { color: var(--blanc); font-size: 14px; }
@media (max-width: 760px) { .barre .qui { display: none; } }
/* Sur téléphone, le nom tient sur deux lignes. */
.barre .nom-court { display: none; }
/* Sur téléphone : « Livret ULM », sur une ligne. */
@media (max-width: 760px) { .barre .nom-long { display: none; } .barre .nom-court { display: inline; } }
@media (max-width: 560px) { .barre-int { gap: 10px; padding: 10px 12px; } .barre img { height: 30px; } .barre .nom-app { font-size: 15px; } .barre a { font-size: 13px; } }

main { max-width: 1100px; margin: 0 auto; padding: 22px 16px 80px; }
.entete { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.entete h1 { font-size: clamp(28px, 6vw, 42px); color: var(--azur); }
.entete .surtitre { margin-bottom: 10px; }
.retour { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; text-decoration: none; margin-bottom: 14px; }

/* ---------- Champs et boutons ---------- */
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time], input[type=number], select, textarea {
  width: 100%; border: 1px solid var(--trait); background: var(--blanc); padding: 10px 12px; font-size: 16px; border-radius: 0; -webkit-appearance: none; appearance: none;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--azur); outline-offset: -1px; }
.bouton { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--azur); color: var(--blanc); border: none; padding: 12px 22px; font-weight: 700; font-size: 15px; letter-spacing: .04em; text-transform: uppercase; cursor: pointer; text-decoration: none; border-radius: 24px; }
.bouton:disabled { opacity: .5; cursor: default; }
.bouton.plein { width: 100%; }
.bouton.second { background: var(--blanc); color: var(--azur); box-shadow: inset 0 0 0 2px var(--azur); }
.bouton.discret { background: none; color: var(--gris); box-shadow: inset 0 0 0 1px var(--trait); }
.bouton.vert { background: var(--vert); }
.bouton.petit { padding: 7px 14px; font-size: 13px; }
.erreur { background: #fbeaea; color: #8a1f1f; padding: 10px 12px; margin-bottom: 14px; font-size: 15px; }
.info { background: var(--blanc); border-left: 4px solid var(--acier); padding: 12px 14px; margin-bottom: 16px; font-size: 15px; }
.info.attention { border-left-color: var(--ambre); }
.info.ok { border-left-color: var(--vert); }

/* ---------- Cartes élèves ---------- */
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.carte { background: var(--blanc); padding: 18px 18px 16px; display: block; color: inherit; text-decoration: none; transition: box-shadow .2s, transform .2s; }
a.carte:hover { box-shadow: 0 12px 30px rgba(4,52,86,.14); transform: translateY(-2px); }
.carte h2 { font-size: 22px; color: var(--azur); margin-bottom: 4px; }
.carte .sous { color: var(--gris); font-size: 14px; }
.chiffres { display: flex; gap: 18px; margin-top: 12px; flex-wrap: wrap; }
.chiffre b { display: block; font-size: 20px; color: var(--nuit); font-variant-numeric: tabular-nums; }
.chiffre span { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--gris); }
.jauge { height: 8px; background: var(--ciel); margin-top: 12px; position: relative; overflow: hidden; }
.jauge i { position: absolute; inset: 0 auto 0 0; background: var(--azur); }
.jauge-legende { display: flex; justify-content: space-between; font-size: 13px; color: var(--gris); margin-top: 5px; }
.pastille { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 3px 9px; border-radius: 20px; background: var(--ciel); color: var(--azur); white-space: nowrap; }
.pastille.attente { background: #fdf3e1; color: var(--ambre); }
.pastille.signee { background: #e6f4ec; color: var(--vert); }
.pastille.close { background: var(--nuit); color: var(--blanc); }
.pastille.solo { background: #f3ecf1; color: #7d5470; }

/* ---------- Livret ---------- */
.tete-livret { background: var(--blanc); padding: 20px; margin-bottom: 18px; display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .tete-livret { grid-template-columns: 1.2fr 1fr; align-items: center; } }
.tete-livret .grande-jauge b { font-family: var(--titre); font-style: italic; font-weight: 900; font-size: 44px; color: var(--azur); line-height: 1; }
.onglets { display: flex; gap: 4px; border-bottom: 2px solid var(--trait); margin-bottom: 16px; overflow-x: auto; }
.onglets button { background: none; border: none; padding: 10px 14px; font-weight: 700; font-size: 14px; letter-spacing: .06em; text-transform: uppercase; color: var(--gris); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.onglets button.actif { color: var(--azur); border-bottom-color: var(--azur); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

.liste-seances { display: flex; flex-direction: column; gap: 10px; }
.ligne-seance { background: var(--blanc); padding: 14px 16px; display: grid; grid-template-columns: 52px 1fr auto; gap: 4px 14px; align-items: center; color: inherit; text-decoration: none; }
.ligne-seance:hover { box-shadow: 0 6px 18px rgba(4,52,86,.1); }
.ligne-seance .num { grid-row: span 2; font-family: var(--titre); font-style: italic; font-weight: 900; font-size: 26px; color: var(--acier); text-align: center; }
.ligne-seance .quoi { font-weight: 700; color: var(--nuit); }
.ligne-seance .detail { font-size: 14px; color: var(--gris); grid-column: 2 / 4; }
@media (max-width: 520px) { .ligne-seance { grid-template-columns: 40px 1fr; } .ligne-seance .pastille { grid-column: 2; justify-self: start; } .ligne-seance .detail { grid-column: 2; } .ligne-seance .num { grid-row: span 3; font-size: 22px; } }

/* ---------- Matrice ---------- */
.matrice-cadre { background: var(--blanc); overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.matrice { border-collapse: collapse; font-size: 13px; min-width: 100%; }
.matrice th, .matrice td { border: 1px solid var(--trait); padding: 0; }
.matrice thead th { background: var(--nuit); color: var(--blanc); font-weight: 700; padding: 6px 4px; min-width: 26px; text-align: center; position: sticky; top: 0; }
.matrice th.item { position: sticky; left: 0; background: var(--blanc); text-align: left; font-weight: 400; padding: 5px 10px; min-width: 210px; max-width: 280px; z-index: 1; }
.matrice thead th.item { background: var(--nuit); z-index: 2; }
.matrice tr.section th { background: var(--ciel); color: var(--azur); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: 12px; padding: 7px 10px; text-align: left; }
.matrice tr.section th.item { background: var(--ciel); }
.matrice td.fait { background: var(--azur); }
.matrice td.compte { text-align: center; font-weight: 700; color: var(--nuit); padding: 0 8px; }
.matrice td.compte.zero { color: var(--trait); }
.matrice td { height: 26px; }
.matrice .code { color: var(--acier); font-variant-numeric: tabular-nums; margin-right: 6px; }

/* ---------- Programme (cases à cocher) ---------- */
.section-prog { background: var(--blanc); margin-bottom: 8px; }
.section-prog summary { list-style: none; cursor: pointer; padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 700; color: var(--azur); text-transform: uppercase; letter-spacing: .04em; font-size: 14px; }
.section-prog summary::-webkit-details-marker { display: none; }
.section-prog summary::after { content: "+"; font-size: 20px; color: var(--acier); }
.section-prog summary .bouton { text-transform: none; letter-spacing: 0; flex: none; }
.section-prog[open] summary::after { content: "–"; }
.section-prog .compte-section { margin-left: auto; font-size: 12px; color: var(--gris); font-weight: 400; text-transform: none; letter-spacing: 0; }
.item-prog { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--ciel); cursor: pointer; }
.item-prog input { width: 22px; height: 22px; flex: none; accent-color: var(--azur); }
.item-prog .code { color: var(--acier); font-variant-numeric: tabular-nums; min-width: 34px; }
.item-prog .vu { margin-left: auto; font-size: 12px; color: var(--gris); white-space: nowrap; }
.item-prog.coche { background: #f2f7fc; }

/* ---------- Formulaire séance ---------- */
.bloc { background: var(--blanc); padding: 18px; margin-bottom: 14px; }
.bloc > h2 { font-size: 20px; color: var(--azur); margin-bottom: 4px; }
.bloc > p.aide { color: var(--gris); font-size: 14px; margin-bottom: 14px; }
.champs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 12px; }
.champ label { display: block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gris); margin-bottom: 5px; }
.champ.large { grid-column: 1 / -1; }
.choix { display: flex; gap: 0; }
.choix button { flex: 1; padding: 10px; border: 1px solid var(--trait); background: var(--blanc); cursor: pointer; font-weight: 700; }
.choix button + button { border-left: none; }
.choix button.actif { background: var(--azur); color: var(--blanc); border-color: var(--azur); }
.vols { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.vol { display: flex; align-items: center; gap: 12px; border: 1px solid var(--trait); padding: 10px 12px; cursor: pointer; background: var(--blanc); text-align: left; width: 100%; }
.vol.actif { border-color: var(--azur); box-shadow: inset 0 0 0 1px var(--azur); background: #f2f7fc; }
.vol .v-date { font-weight: 700; color: var(--nuit); min-width: 92px; }
.vol .v-det { font-size: 14px; color: var(--gris); }
.barre-envoi { position: sticky; bottom: 0; background: rgba(238,243,248,.96); padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); display: flex; gap: 10px; justify-content: flex-end; border-top: 1px solid var(--trait); }

/* ---------- Fiche séance ---------- */
.fiche dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 12px 18px; }
.fiche dt { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gris); }
.fiche dd { font-size: 17px; color: var(--nuit); font-variant-numeric: tabular-nums; }
.texte-libre { white-space: pre-wrap; font-size: 16px; }
.etiquettes { display: flex; flex-wrap: wrap; gap: 6px; }
.etiquette-ex { background: var(--ciel); color: var(--nuit); padding: 4px 10px; font-size: 14px; }
.etiquette-ex b { color: var(--acier); margin-right: 4px; }
.signatures { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.signature { border: 1px dashed var(--acier); padding: 14px; }
.signature.faite { border-style: solid; border-color: var(--vert); }
.signature h3 { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--gris); margin-bottom: 6px; }
.signature .qui { font-weight: 700; font-size: 17px; color: var(--nuit); }
.empreinte { font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: var(--gris); word-break: break-all; margin-top: 10px; }
.historique li { list-style: none; padding: 8px 0; border-top: 1px solid var(--ciel); font-size: 14px; }
.historique time { color: var(--gris); margin-right: 8px; font-variant-numeric: tabular-nums; }

.vide { text-align: center; color: var(--gris); padding: 40px 16px; background: var(--blanc); }
.chargement { text-align: center; color: var(--gris); padding: 60px 0; }

/* ---------- Fenêtre ---------- */
.voile { position: fixed; inset: 0; background: rgba(4,52,86,.55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.fenetre { background: var(--blanc); width: 100%; max-width: 480px; padding: 22px; max-height: 90vh; overflow: auto; }
.fenetre h2 { color: var(--azur); font-size: 22px; margin-bottom: 12px; }
.fenetre .actions { justify-content: flex-end; margin-top: 16px; }

/* ---------- Impression ---------- */
.impression { display: none; }
@media print {
  @page { size: A4; margin: 14mm 12mm; }
  body { background: #fff; font-size: 11pt; }
  .barre, .ecran, .barre-envoi { display: none !important; }
  main { max-width: none; padding: 0; }
  .impression { display: block; }
  .impression h1 { font-size: 22pt; color: var(--azur); }
  .impression .page-seance { break-inside: avoid; border: 1px solid #999; padding: 8pt 10pt; margin-bottom: 8pt; }
  .impression table.matrice { font-size: 7pt; }
  .impression .matrice th.item { min-width: 0; max-width: none; position: static; }
  .impression .matrice thead th { position: static; }
  .impression .saut { break-before: page; }
  .matrice td.fait { background: #333 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .impression .pied { font-size: 8pt; color: #555; margin-top: 10pt; }
}
@media (max-width: 380px) { .barre-int { gap: 8px; } .barre img { height: 26px; } .barre .nom-app { font-size: 13px; } .barre button { padding: 4px 8px; } }
/* Listes déroulantes : une flèche, pour qu'on voie qu'elles s'ouvrent. */
select { padding-right: 38px; background: var(--blanc) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%2307548e' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 14px center; cursor: pointer; }
/* ---------- Carte des vols ---------- */
.carte-vols { height: min(62vh, 560px); background: var(--ciel); border: 1px solid var(--trait); z-index: 0; }
/* Plan IGN en gris : seul le tracé porte de la couleur. */
.carte-vols .leaflet-tile-pane { filter: grayscale(1); }
.carte-vols.leaflet-container { background: var(--ciel); }
.carte-vols.petite { height: 300px; margin-top: 8px; }
.legende-vols { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.vol-legende { display: flex; align-items: center; gap: 10px; text-align: left; background: var(--blanc); border: 1px solid var(--trait); padding: 9px 12px; cursor: pointer; font-size: 15px; }
.vol-legende i { width: 22px; height: 5px; border-radius: 3px; flex: none; }
.vol-legende.actif { border-color: var(--azur); box-shadow: inset 0 0 0 1px var(--azur); }
/* ---------- Archives ---------- */
.ligne-archive { background: var(--blanc); padding: 12px 16px; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; color: inherit; text-decoration: none; }
.ligne-archive:hover { box-shadow: 0 6px 18px rgba(4,52,86,.1); }
.ligne-archive .a-nom { font-size: 17px; color: var(--nuit); }
.ligne-archive .a-det { grid-column: 1 / -1; font-size: 14px; color: var(--gris); }
.ligne-archive .a-cons { grid-column: 1 / -1; font-size: 12px; color: var(--acier); }
