/* ═══════════════════════════════════════════════════════════════════════════
   Ecrin du Monde — feuille de style du site client
   Couleurs reprises de l'app Android.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --navy:        #1A237E;
  --navy-hover:  #121a63;
  --navy-soft:   #E8EAF6;
  --green:       #1B5E20;
  --plum:        #6A1B4D;
  --gold:        #E8B86D;

  --bg:          #F5F5F7;
  --surface:     #FFFFFF;
  --text:        #1A1A1A;
  --text-2:      #555B66;
  --muted:       #888888;
  --line:        #ECECEC;

  --ok-bg:   #E8F5E9;  --ok-fg:   #2E7D32;
  --warn-bg: #FFF8E1;  --warn-fg: #B26A00;
  --err-bg:  #FFEBEE;  --err-fg:  #C62828;
  --neutral-bg: #F1F1F3; --neutral-fg: #6B6B6B;

  --radius-lg: 24px;
  --radius:    16px;
  --radius-sm: 10px;
  --shadow:    0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);

  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-titre: "Fraunces", Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

img { max-width: 100%; display: block; }
a { color: var(--navy); }
button { font: inherit; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--navy) 45%, transparent);
  outline-offset: 2px;
  border-radius: 6px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ─── Bandeau démo ────────────────────────────────────────────────────────── */
.bandeau-demo {
  background: var(--gold);
  color: #3b2a07;
  text-align: center;
  font-size: 13px;
  padding: 6px 16px;
}
.bandeau-demo a { color: inherit; font-weight: 600; }

/* ─── Barre du haut ───────────────────────────────────────────────────────── */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.topbar--public .topbar__inner { justify-content: center; gap: 10px; }
.topbar__tagline { font-size: 14px; color: var(--text-2); }
.logo { height: 38px; width: auto; }
.logo-lien { display: inline-flex; }

.utilisateur {
  display: flex;
  align-items: center;
  gap: 12px;
}
.utilisateur__nom { font-size: 14px; color: var(--text-2); }
@media (max-width: 560px) { .utilisateur__nom { display: none; } }

/* ─── Pages publiques (fond voyage + carte centrée) ───────────────────────── */
.page-publique {
  background:
    linear-gradient(160deg, rgba(10, 16, 60, .55), rgba(10, 16, 60, .25) 55%, rgba(0, 0, 0, .45)),
    url("../assets/fond-voyage.jpg") center / cover no-repeat fixed,
    linear-gradient(135deg, #1A237E 0%, #3949AB 45%, #E8B86D 100%);
}
.page-publique main {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 40px 16px 56px;
}

.carte-auth {
  width: 100%;
  max-width: 440px;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
  padding: 32px 28px;
}
.carte-auth--large { max-width: 760px; }
.carte-auth h1 {
  font-family: var(--font-titre);
  font-weight: 600;
  font-size: 26px;
  line-height: 1.2;
  margin: 0 0 6px;
  text-align: center;
}
.carte-auth .intro {
  text-align: center;
  color: var(--text-2);
  font-size: 14px;
  margin: 0 0 24px;
}

/* ─── Formulaires ─────────────────────────────────────────────────────────── */
.champ { margin-bottom: 16px; }
.champ label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}
.champ__saisie { position: relative; }
.champ input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1.5px solid #D9DCE3;
  border-radius: 12px;
  background: #fff;
  font: inherit;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.champ input:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 4px var(--navy-soft);
}
.champ input[aria-invalid="true"] { border-color: var(--err-fg); }
.champ__saisie input { padding-right: 92px; }
.toggle-mdp {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--navy);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.toggle-mdp:hover { background: var(--navy-soft); }

.message-erreur {
  background: var(--err-bg);
  color: var(--err-fg);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13.5px;
  margin: 4px 0 16px;
}
.message-info {
  background: var(--navy-soft);
  color: var(--navy);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13.5px;
  margin: 0 0 16px;
}

/* Règles du mot de passe */
.regles {
  list-style: none;
  padding: 0;
  margin: -4px 0 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
  font-size: 12.5px;
  color: var(--muted);
}
.regles li::before { content: "○ "; }
.regles li.ok { color: var(--ok-fg); }
.regles li.ok::before { content: "✓ "; font-weight: 700; }
@media (max-width: 420px) { .regles { grid-template-columns: 1fr; } }

/* ─── Boutons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 20px;
  border-radius: 14px;
  border: 0;
  background: var(--navy);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, transform .05s;
}
.btn:hover { background: var(--navy-hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn--bloc { width: 100%; }
.btn--fantome {
  background: transparent;
  color: var(--text-2);
  height: 38px;
  padding: 0 12px;
  font-weight: 500;
  font-size: 14px;
}
.btn--fantome:hover { background: var(--bg); }

.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: tourner .7s linear infinite;
}
.spinner--sombre { border-color: var(--navy-soft); border-top-color: var(--navy); width: 28px; height: 28px; border-width: 3px; }
@keyframes tourner { to { transform: rotate(360deg); } }

/* ─── CGU ─────────────────────────────────────────────────────────────────── */
.cgu-texte {
  max-height: 52vh;
  overflow-y: auto;
  padding: 4px 8px 4px 2px;
  margin: 0 -4px 20px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.cgu-texte article { padding: 14px 0 4px; }
.cgu-texte h2 {
  font-size: 15px;
  color: var(--navy);
  margin: 0 0 6px;
}
.cgu-texte p, .cgu-texte li { font-size: 14px; color: #333; margin: 0 0 8px; }
.cgu-texte ul { padding-left: 18px; margin: 0 0 8px; }
.a-completer { background: #FFF3CD; border-radius: 4px; padding: 0 3px; }
.cgu-date { text-align: center; font-size: 12px; color: var(--muted); margin: -16px 0 18px; }

.case {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 14px;
  margin-bottom: 18px;
  cursor: pointer;
}
.case input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--navy); flex-shrink: 0; }

/* ─── Pages connectées ────────────────────────────────────────────────────── */
.page-privee main { flex: 1; }
.conteneur {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--gold);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.avatar--grand { width: 64px; height: 64px; font-size: 22px; }

/* Héros d'accueil */
.hero {
  position: relative;
  color: #fff;
  background:
    linear-gradient(100deg, rgba(10, 16, 60, .85), rgba(10, 16, 60, .45)),
    url("../assets/fond-voyage.jpg") center / cover no-repeat,
    linear-gradient(135deg, #1A237E 0%, #3949AB 55%, #E8B86D 100%);
  padding: 44px 0 72px;
}
.hero__inner { display: flex; align-items: center; gap: 20px; }
.hero h1 {
  font-family: var(--font-titre);
  font-weight: 600;
  font-size: clamp(26px, 4vw, 36px);
  margin: 0;
  line-height: 1.15;
}
.hero p { margin: 4px 0 0; color: rgba(255, 255, 255, .82); }

.contenu-accueil { margin-top: -40px; padding-bottom: 48px; position: relative; }

/* Alertes */
.alertes {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 20px;
  margin-bottom: 24px;
  border-left: 4px solid var(--warn-fg);
}
.alertes h2 { font-size: 15px; margin: 0 0 8px; }
.alertes ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.alertes li { font-size: 14px; color: var(--text-2); }
.alertes a { font-weight: 600; }

/* Sections et grille de rubriques */
.grille-sections {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 860px) { .grille-sections { grid-template-columns: 1fr; } }

.section {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.section + .section { margin-top: 24px; }
.grille-sections > div > .section + .section { margin-top: 24px; }
.section__entete { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin-bottom: 14px; }
.section h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.section h2::before {
  content: "";
  width: 10px; height: 10px;
  border-radius: 3px;
  background: var(--couleur, var(--navy));
}
.section__sous-titre { font-size: 13px; color: var(--muted); margin: 0; }

.rubriques {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(205px, 1fr));
  gap: 12px;
}
.rubrique {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--text);
  background: #fff;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.rubrique:hover {
  border-color: color-mix(in srgb, var(--couleur, var(--navy)) 40%, white);
  box-shadow: 0 6px 18px rgba(16, 24, 40, .08);
  transform: translateY(-1px);
}
.rubrique__emoji {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 20px;
  background: color-mix(in srgb, var(--couleur, var(--navy)) 9%, white);
  flex-shrink: 0;
}
.rubrique__texte { flex: 1; min-width: 0; }
.rubrique__label { font-weight: 600; font-size: 14.5px; line-height: 1.3; display: block; overflow-wrap: anywhere; hyphens: auto; }
.rubrique__meta { font-size: 12.5px; color: var(--muted); }
.rubrique__fleche { color: #B5B5B5; font-size: 20px; flex-shrink: 0; }

/* Liens utiles */
.liens { list-style: none; margin: 0; padding: 0; }
.liens li + li { border-top: 1px solid var(--line); }
.lien-utile {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 4px;
  text-decoration: none;
  color: var(--text);
  border-radius: 10px;
}
.lien-utile:hover { background: var(--bg); }
.lien-utile__emoji { font-size: 20px; line-height: 1.3; }
.lien-utile__texte { flex: 1; min-width: 0; }
.lien-utile strong { display: block; font-size: 14.5px; font-weight: 600; color: var(--text); }
.lien-utile__desc { display: block; font-size: 12.5px; color: var(--muted); }
.lien-utile__fleche { margin-left: auto; color: #B5B5B5; }

/* ─── Page documents ──────────────────────────────────────────────────────── */
.layout-documents {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 28px;
  padding: 28px 20px 56px;
  max-width: 1120px;
  margin: 0 auto;
  width: 100%;
}
@media (max-width: 860px) {
  .layout-documents { grid-template-columns: 1fr; gap: 16px; padding-top: 16px; }
}

.nav-rubriques { position: sticky; top: 84px; align-self: start; }
.nav-rubriques__groupe + .nav-rubriques__groupe { margin-top: 20px; }
.nav-rubriques h2 {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin: 0 0 6px 10px;
}
.nav-rubriques ul { list-style: none; margin: 0; padding: 0; }
.nav-rubriques a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-2);
  font-size: 14px;
}
.nav-rubriques a:hover { background: #ECEDF2; color: var(--text); }
.nav-rubriques a[aria-current="page"] { background: var(--navy-soft); color: var(--navy); font-weight: 600; }
.retour-accueil {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; text-decoration: none; color: var(--text-2);
  margin: 0 0 18px 10px;
}
.retour-accueil:hover { color: var(--navy); }

@media (max-width: 860px) {
  .nav-rubriques { position: static; }
  .nav-rubriques__groupe { display: none; }
  .nav-rubriques .retour-accueil { margin: 0; }
}

.entete-rubrique { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.entete-rubrique .rubrique__emoji { width: 52px; height: 52px; font-size: 26px; border-radius: 14px; }
.entete-rubrique h1 { font-family: var(--font-titre); font-weight: 600; font-size: 28px; margin: 0; line-height: 1.2; }
.entete-rubrique p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }

.carte {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.carte + .carte, .carte + .liste-titre { margin-top: 20px; }

/* Zone de dépôt */
.depot h2 { font-size: 16px; margin: 0 0 2px; }
.depot > p { margin: 0 0 14px; color: var(--muted); font-size: 13.5px; }
.zone-depot {
  display: block;
  border: 2px dashed #CBD0E0;
  border-radius: 14px;
  padding: 28px 16px;
  text-align: center;
  background: #FAFAFD;
  transition: border-color .15s, background .15s;
  cursor: pointer;
}
.zone-depot:hover, .zone-depot.survol { border-color: var(--navy); background: var(--navy-soft); }
.zone-depot__icone { font-size: 28px; }
.zone-depot strong { display: block; margin: 6px 0 2px; }
.zone-depot span { font-size: 13px; color: var(--muted); }
.zone-depot[aria-disabled="true"] { pointer-events: none; opacity: .6; }

.progression { margin-top: 14px; }
.progression__barre { height: 8px; border-radius: 99px; background: var(--navy-soft); overflow: hidden; }
.progression__barre div { height: 100%; width: 0; background: var(--navy); transition: width .15s; }
.progression__texte { font-size: 13px; color: var(--text-2); margin-top: 6px; display: flex; justify-content: space-between; gap: 8px; }
.progression__texte span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.retour {
  margin-top: 14px;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13.5px;
  font-weight: 500;
}
.retour--ok { background: var(--ok-bg); color: var(--ok-fg); }
.retour--err { background: var(--err-bg); color: var(--err-fg); }

/* Liste */
.liste-titre { font-size: 15px; margin: 28px 0 12px 2px; }
.liste-documents { display: grid; gap: 10px; }

.doc {
  background: var(--surface);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 14px 16px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 4px 14px;
  align-items: center;
}
.doc__icone {
  grid-row: span 2;
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--bg);
  display: grid; place-items: center;
  font-size: 18px;
}
.doc__nom { font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.doc__meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 12.5px; color: var(--muted); grid-column: 2 / 4; }
.doc .pastille { grid-row: 1; grid-column: 3; }
@media (max-width: 520px) {
  .doc { grid-template-columns: auto 1fr; }
  .doc .pastille { grid-column: 2; grid-row: auto; justify-self: start; }
  .doc__meta { grid-column: 2; }
}

.pastille {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
  white-space: nowrap;
}
.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 6px;
}
.ton-ok      { background: var(--ok-bg);      color: var(--ok-fg); }
.ton-warn    { background: var(--warn-bg);    color: var(--warn-fg); }
.ton-err     { background: var(--err-bg);     color: var(--err-fg); }
.ton-neutre  { background: var(--neutral-bg); color: var(--neutral-fg); }

.vide {
  text-align: center;
  padding: 40px 20px;
}
.vide__emoji { font-size: 40px; }
.vide strong { display: block; margin: 10px 0 4px; }
.vide p { margin: 0; color: var(--muted); font-size: 14px; }

.chargement { display: grid; place-items: center; padding: 40px; }

/* ─── Pied de page ────────────────────────────────────────────────────────── */
footer#pied { font-size: 13px; }
.page-publique footer#pied { color: rgba(255, 255, 255, .85); }
.page-publique footer#pied a { color: #fff; }
.page-privee footer#pied { color: var(--muted); border-top: 1px solid var(--line); background: var(--surface); }
.pied__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation-duration: 0s !important; }
}
