/* ==========================================================
   6AM — feuille de style unique
   Charte issue du logo : nuit, acier bleute, argent.
   ========================================================== */

:root {
  --ink:        #05080d;
  --ink-2:      #080d15;
  --panel:      #0c131d;
  --panel-2:    #111b28;
  --line:       #1b2836;
  --line-soft:  #16202c;
  --steel:      #4a6a8f;
  --steel-lt:   #8fb0d4;
  --silver:     #c9d6e3;
  --text:       #dae3ed;
  --muted:      #8494a6;
  --good:       #3fa77a;
  --warn:       #c9923f;
  --bad:        #b6564a;
  --radius:     14px;
  --radius-sm:  9px;
  --shadow:     0 18px 50px rgba(0,0,0,.55);
  --maxw:       1180px;
  --serif:      Georgia, "Times New Roman", "Iowan Old Style", serif;
  --sans:       "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 700px at 50% -10%, #101d2c 0%, transparent 60%),
    linear-gradient(180deg, var(--ink) 0%, var(--ink-2) 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--steel-lt); text-decoration: none; }
a:hover { color: var(--silver); }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: .012em;
  line-height: 1.2;
  margin: 0 0 .5em;
  color: #eaf1f8;
}
h1 { font-size: clamp(2rem, 4.4vw, 3.1rem); }
h2 { font-size: clamp(1.45rem, 2.6vw, 2rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

.eyebrow {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: .28em;
  font-size: .68rem;
  color: var(--steel);
  margin-bottom: .9rem;
}

.muted { color: var(--muted); }
.center { text-align: center; }

/* ---------------- En-tete ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(14px);
  background: rgba(5, 8, 13, .78);
  border-bottom: 1px solid var(--line-soft);
}
.site-header .wrap {
  display: flex; align-items: center; gap: 26px;
  height: 68px;
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand img { width: 36px; height: 36px; display: block; }
.brand-text { font-family: var(--serif); font-size: 1.22rem; letter-spacing: .16em; color: #eaf1f8; }

.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.nav a {
  padding: 8px 13px; border-radius: 8px;
  color: var(--muted); font-size: .9rem; letter-spacing: .03em;
  transition: color .18s, background .18s;
}
.nav a:hover { color: var(--text); background: rgba(74,106,143,.13); }
.nav a.is-active { color: var(--silver); background: rgba(74,106,143,.18); }

.nav-toggle {
  display: none; margin-left: auto;
  background: none; border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: 7px 11px; cursor: pointer; font-size: 1rem;
}

/* ---------------- Boutons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 10px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #16222f, #0d151f);
  color: var(--text); font-size: .92rem; font-weight: 500; letter-spacing: .03em;
  cursor: pointer; transition: transform .15s, border-color .18s, box-shadow .18s;
  font-family: var(--sans);
}
.btn:hover { border-color: var(--steel); color: #fff; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(180deg, #4d70963d, #2a3e57);
  border-color: #4a6a8f;
  color: #eef4fa;
  box-shadow: 0 8px 26px rgba(74,106,143,.22);
}
.btn-primary:hover { box-shadow: 0 12px 34px rgba(74,106,143,.34); }
.btn-ghost { background: transparent; }
.btn-danger { border-color: #4a2726; color: #e6b3ad; }
.btn-danger:hover { border-color: var(--bad); color: #fff; }
.btn-sm { padding: 7px 13px; font-size: .82rem; border-radius: 8px; }
.btn-block { width: 100%; }

/* ---------------- Hero 3D ---------------- */
.hero { position: relative; min-height: min(96vh, 900px); display: grid; place-items: center; overflow: hidden; }
#hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(60% 55% at 50% 45%, transparent 40%, rgba(5,8,13,.75) 100%);
}
.hero-inner { position: relative; z-index: 3; text-align: center; padding: 54px 22px 74px; }
.hero-emblem {
  width: clamp(170px, 26vh, 290px); aspect-ratio: 1;
  margin: 0 auto 26px; pointer-events: none;
}
.no-webgl .hero-emblem { display: none; }
.hero-fallback {
  width: min(340px, 62vw); margin: 0 auto 26px; display: none;
  filter: drop-shadow(0 24px 60px rgba(74,106,143,.35));
}
.no-webgl .hero-fallback { display: block; }
.hero h1 {
  font-size: clamp(2.4rem, 6.6vw, 4.4rem);
  letter-spacing: .06em;
  margin-bottom: .2em;
  background: linear-gradient(180deg, #f2f7fc 10%, #93aec9 65%, #4a6a8f 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.hero-sub { font-size: clamp(1rem, 2vw, 1.2rem); color: #a8bacd; max-width: 620px; margin: 0 auto 2rem; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-scroll {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  z-index: 3; color: var(--muted); font-size: .72rem; letter-spacing: .3em; text-transform: uppercase;
  animation: floaty 2.8s ease-in-out infinite;
}
@keyframes floaty { 0%,100% { transform: translate(-50%, 0); opacity: .7 } 50% { transform: translate(-50%, 7px); opacity: 1 } }

/* ---------------- Sections ---------------- */
.section { padding: 72px 0; }
.section-head { max-width: 680px; margin-bottom: 38px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

.divider {
  height: 1px; border: 0;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
  margin: 0;
}

/* ---------------- Cartes / grilles ---------------- */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.card h3 { color: var(--silver); }
.card-hover { transition: border-color .2s, transform .2s; }
.card-hover:hover { border-color: var(--steel); transform: translateY(-2px); }

.stat { text-align: center; padding: 26px 18px; }
.stat-value {
  font-family: var(--serif); font-size: 2.5rem; line-height: 1;
  color: #eaf1f8; margin-bottom: 6px;
}
.stat-label { text-transform: uppercase; letter-spacing: .18em; font-size: .68rem; color: var(--muted); }

/* ---------------- Tableaux ---------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 560px; }
thead th {
  text-align: left; padding: 13px 16px;
  background: #0b121b; color: var(--muted);
  font-weight: 500; text-transform: uppercase; letter-spacing: .12em; font-size: .68rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
tbody td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(74,106,143,.06); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------------- Badges ---------------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-size: .74rem; letter-spacing: .06em;
  border: 1px solid currentColor; opacity: .95;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-active { color: var(--good); }
.badge-leave { color: var(--warn); }
.badge-fired, .badge-resigned { color: var(--bad); }

/* ---------------- Formulaires ---------------- */
.field { margin-bottom: 16px; }
.field label {
  display: block; margin-bottom: 6px;
  font-size: .76rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted);
}
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=color], select, textarea {
  width: 100%; padding: 11px 13px;
  background: #0a1017; color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-family: var(--sans); font-size: .93rem;
  transition: border-color .18s, box-shadow .18s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--steel);
  box-shadow: 0 0 0 3px rgba(74,106,143,.16);
}
textarea { min-height: 110px; resize: vertical; line-height: 1.6; }
input[type=color] { padding: 4px; height: 42px; }
.check { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: .88rem; }
.check input { width: auto; }
.form-row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.help { font-size: .78rem; color: var(--muted); margin-top: 5px; }

/* ---------------- Alertes ---------------- */
.alert {
  padding: 12px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); margin-bottom: 20px; font-size: .9rem;
}
.alert-success { border-color: #23503f; background: rgba(63,167,122,.09); color: #9fdcbf; }
.alert-error   { border-color: #4d2a27; background: rgba(182,86,74,.09);  color: #e7b0a8; }
.alert-info    { border-color: #29415a; background: rgba(74,106,143,.1);  color: #b3c8de; }

/* ---------------- Espace membres ---------------- */
.app-shell { display: grid; grid-template-columns: 232px 1fr; gap: 30px; align-items: start; padding: 30px 0 80px; }
.side-nav { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 3px; }
.side-nav .group-label {
  text-transform: uppercase; letter-spacing: .18em; font-size: .64rem;
  color: #566677; margin: 18px 0 6px 12px;
}
.side-nav a {
  padding: 9px 13px; border-radius: 9px; color: var(--muted); font-size: .9rem;
  border-left: 2px solid transparent;
}
.side-nav a:hover { background: rgba(74,106,143,.1); color: var(--text); }
.side-nav a.is-active { background: rgba(74,106,143,.16); color: var(--silver); border-left-color: var(--steel); }

.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.page-head h1 { font-size: 1.9rem; margin: 0; }
.page-head .spacer { margin-left: auto; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  padding: 6px 13px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--muted); font-size: .82rem;
}
.chip.is-active { border-color: var(--steel); color: var(--silver); background: rgba(74,106,143,.14); }

/* ---------------- Graphiques CSS ---------------- */
.chart { display: flex; align-items: flex-end; gap: 3px; height: 190px; padding-top: 10px; }
.chart-bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; position: relative; }
.chart-bar span {
  display: block; width: 100%; min-height: 2px; border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, var(--steel-lt), var(--steel));
  transition: filter .15s;
}
.chart-bar:hover span { filter: brightness(1.35); }
.chart-bar::after {
  content: attr(data-label);
  position: absolute; bottom: 100%; left: 50%; transform: translate(-50%, -6px);
  background: #0a121c; border: 1px solid var(--line); border-radius: 6px;
  padding: 4px 8px; font-size: .72rem; white-space: nowrap; color: var(--text);
  opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 5;
}
.chart-bar:hover::after { opacity: 1; }
.chart-axis { display: flex; justify-content: space-between; font-size: .7rem; color: var(--muted); margin-top: 8px; }

.bar-row { display: grid; grid-template-columns: 150px 1fr 90px; gap: 12px; align-items: center; margin-bottom: 9px; font-size: .88rem; }
.bar-track { background: #0a1017; border-radius: 999px; height: 9px; overflow: hidden; border: 1px solid var(--line-soft); }
.bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--steel), var(--steel-lt)); }

/* ---------------- Timeline ---------------- */
.timeline { list-style: none; margin: 0; padding: 0 0 0 22px; border-left: 1px solid var(--line); }
.timeline li { position: relative; padding: 0 0 22px 20px; }
.timeline li::before {
  content: ""; position: absolute; left: -27px; top: 7px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--steel); box-shadow: 0 0 0 3px var(--ink);
}
.timeline .t-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.timeline .t-type { color: var(--silver); font-weight: 500; }
.timeline .t-date { font-size: .78rem; color: var(--muted); }
.timeline .t-body { color: var(--muted); font-size: .9rem; }

/* ---------------- Effectifs publics ---------------- */
.roster-group { margin-bottom: 34px; }
.roster-title { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.roster-title .line { flex: 1; height: 1px; background: var(--line); }
.roster-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.roster-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px 16px; display: flex; align-items: center; gap: 11px;
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 34px;
  display: grid; place-items: center;
  background: linear-gradient(160deg, #1a2634, #0d141d);
  border: 1px solid var(--line); color: var(--steel-lt);
  font-family: var(--serif); font-size: .9rem;
}

/* ---------------- Page connexion ---------------- */
.auth-wrap { min-height: calc(100vh - 68px); display: grid; place-items: center; padding: 40px 22px; }
.auth-card { width: 100%; max-width: 410px; }
.auth-card .brand-mark { width: 76px; margin: 0 auto 18px; display: block; }

/* ---------------- Pied de page ---------------- */
.site-footer {
  border-top: 1px solid var(--line-soft);
  padding: 40px 0 34px; margin-top: 40px;
  color: var(--muted); font-size: .85rem;
}
.site-footer .wrap { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; }
.site-footer .spacer { margin-left: auto; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--steel-lt); }

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .side-nav { position: static; flex-direction: row; overflow-x: auto; padding-bottom: 8px; }
  .side-nav .group-label { display: none; }
  .side-nav a { white-space: nowrap; border-left: 0; border-bottom: 2px solid transparent; }
  .side-nav a.is-active { border-bottom-color: var(--steel); }
}
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav {
    display: none; position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: #070c13; border-bottom: 1px solid var(--line); padding: 10px 16px 18px;
  }
  .nav.is-open { display: flex; }
  .bar-row { grid-template-columns: 110px 1fr 74px; font-size: .8rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* Annuaire de la famille : grille souple, pour ne pas laisser de colonnes
   vides quand un grade ne compte qu'une personne. */
.vitrine .v-values.v-roster { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 40px 45px; }
.vitrine .v-values.v-roster h3 { margin-top: 14px; }

/* ==========================================================
   Vitrine en page unique : nav a ancres, apparitions, flotte
   ========================================================== */

/* En-tete : transparent en haut de page, plein des qu'on defile */
.page-home .site-header { background: linear-gradient(180deg, rgba(5,8,13,.92), rgba(5,8,13,0)); border-bottom-color: transparent; }
.page-home .site-header.is-scrolled { background: rgba(5,8,13,.9); border-bottom-color: var(--line-soft); }

.nav a[data-anchor] { position: relative; }
.nav a[data-anchor]::after {
  content: ""; position: absolute; left: 13px; right: 13px; bottom: 3px; height: 1px;
  background: var(--steel-lt); transform: scaleX(0); transform-origin: left; transition: transform .3s;
}
.nav a[data-anchor]:hover::after, .nav a[data-anchor].is-active::after { transform: scaleX(1); }
.nav a[data-anchor].is-active { color: var(--silver); background: none; }

.nav-cta {
  border: 1px solid var(--steel);
  color: var(--steel-lt) !important;
  padding: 7px 16px !important;
  border-radius: 8px;
}
.nav-cta:hover { background: var(--steel); color: #06101a !important; }

/* Le defilement vers une ancre ne doit pas passer sous l'en-tete */
html { scroll-behavior: smooth; }
:target, [id] { scroll-margin-top: 90px; }

/* Apparition au defilement */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s ease, transform .8s ease; }
.reveal.is-in { opacity: 1; transform: none; }

/* Flotte */
.v-fleet { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.v-fleet li { border-top: 1px solid #385069; padding-top: 14px; }
.v-fleet strong { display: block; font-family: var(--serif); font-size: 1.9rem; font-weight: 400; color: #dfeaf4; line-height: 1; }
.v-fleet span { display: block; margin-top: 5px; font-size: .78rem; letter-spacing: .1em; color: #8ba1b6; }

/* Alterner le sens des sections illustrees */
.v-place--reverse > div { order: -1; }
@media (max-width: 900px) { .v-place--reverse > div { order: 0; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
