/* =========================================================
   TOKENS — cachet & tableau noir : marine, laiton, crème
   Portée volontairement limitée au bandeau d'en-tête pour
   ne pas entrer en conflit avec body-style.css / foot-style.css
   ========================================================= */
:root {
  /* --- Loko avy amin'ny voalohany (Natao mazava ny anarany) --- */
  --navy-deep: #0f1b30;
  --navy-classic: #14213d; /* Novonjena mba tsy hifandona */
  --navy-soft: #1c2c4f;
  --brass: #c9922a;
  --brass-light: #e3b463;
  --paper: #f7f5ee;
  --crimson: #b23a2e;
  --hline: rgba(201, 146, 42, .28);
  --font-crest: 'Fraunces', Georgia, serif;
  --font-nav: 'Manrope', -apple-system, sans-serif;
  --ease-slow: cubic-bezier(.22, .9, .32, 1); /* Navarina ny anarany */

  /* --- Loko avy amin'ny faharoa --- */
  --ink: #161a22;
  --muted: #5c6270;
  --bg: #f6f4ee;
  --surface: #ffffff;
  --navy: #10233f; /* Ity no hery miasa mangina default */
  --navy-2: #193153;
  --gold: #c69a3d;
  --gold-soft: #e9d6a4;
  --green: #2f6d4f;
  --red: #b23b3b;
  --radius: 18px;
  --shadow: 0 20px 45px -25px rgba(16, 35, 63, .35);
  --ease: cubic-bezier(.22, 1, .36, 1);
}

header.site-header{
  position:sticky;
  top:0;
  z-index:9999; /* Mba tsy hisy hanenjika azy */
  background:linear-gradient(180deg, var(--navy), var(--navy-soft));
  border-bottom:1px solid var(--hline);
  box-shadow:0 2px 0 rgba(0,0,0,.08);
  transition:padding .35s var(--ease), box-shadow .35s var(--ease);
}
header.site-header.scrolled{
  box-shadow:0 16px 32px -20px rgba(0,0,0,.55);
}

header.site-header .container{
  max-width:1180px;
  margin:0 auto;
  padding:16px 24px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
}
header.site-header.scrolled .container{ padding:10px 24px; }

/* ---------- Blason / branding ---------- */
#branding{
  display:flex;
  align-items:center;
  gap:14px;
  opacity:0;
  transform:translateY(-10px);
  animation:dropIn .6s var(--ease) .1s forwards;
}

#branding .crest{
  width:42px; height:42px;
  border-radius:50%;
  flex:none;
  display:flex; align-items:center; justify-content:center;
  background:radial-gradient(circle at 32% 28%, var(--brass-light), var(--brass) 60%, #9c711d 100%);
  color:var(--navy-deep);
  font-family:var(--font-crest);
  font-weight:700;
  font-size:1.05rem;
  box-shadow:inset 0 1px 2px rgba(255,255,255,.5), 0 4px 10px rgba(0,0,0,.35);
  transform:scale(0) rotate(-30deg);
  animation:seal .6s var(--ease) .35s forwards;
}
@keyframes seal{ to{ transform:scale(1) rotate(0deg); } }
@keyframes dropIn{ to{ opacity:1; transform:translateY(0); } }

#branding h1{
  margin:0;
  font-family:var(--font-crest);
  font-weight:600;
  font-size:1.4rem;
  color:var(--paper);
  letter-spacing:.01em;
  white-space:nowrap;
}
#branding .highlight{
  position:relative;
  color:var(--brass-light);
  font-style:italic;
}
#branding .highlight::after{
  content:"";
  position:absolute; left:0; bottom:-2px;
  width:100%; height:2px;
  background:var(--brass);
  transform:scaleX(0);
  transform-origin:left;
  animation:underline .5s var(--ease) .8s forwards;
}
@keyframes underline{ to{ transform:scaleX(1); } }

/* ---------- Navigation ---------- */
nav{ position:relative; }
.nav-shell{
  display:flex;
  align-items:center;
  gap:4px;
}

nav ul{
  position:relative;
  list-style:none;
  display:flex;
  align-items:center;
  gap:2px;
  margin:0; padding:0;
}

nav ul li{
  opacity:0;
  transform:translateY(-8px);
  animation:dropIn .5s var(--ease) forwards;
}
nav ul li:nth-child(1){ animation-delay:.20s; }
nav ul li:nth-child(2){ animation-delay:.28s; }
nav ul li:nth-child(3){ animation-delay:.36s; }
nav ul li:nth-child(4){ animation-delay:.44s; }
nav ul li:nth-child(5){ animation-delay:.52s; }
nav ul li:nth-child(6){ animation-delay:.60s; }

nav ul li a{
  display:block;
  padding:10px 16px;
  font-family:var(--font-nav);
  font-weight:600;
  font-size:.92rem;
  color:rgba(247,245,238,.78);
  text-decoration:none;
  border-radius:8px;
  transition:color .25s var(--ease), background .25s var(--ease);
  white-space:nowrap;
}
nav ul li a:hover{
  color:var(--paper);
  background:rgba(247,245,238,.06);
}
nav ul li.current a{
  color:var(--brass-light);
}

/* indicateur doré glissant sous l'onglet actif */
.nav-indicator{
  position:absolute;
  bottom:-1px; left:0;
  height:2px;
  background:var(--brass);
  border-radius:2px;
  opacity:0;
  transition:left .35s var(--ease), width .35s var(--ease), opacity .3s ease;
}

/* bouton de déconnexion / dernier élément, style bouton discret */
nav ul li a[href*="deconn"],
nav ul li a[href*="logout"]{
  color:var(--crimson);
  border:1px solid rgba(178,58,46,.4);
  margin-left:6px;
}
nav ul li a[href*="deconn"]:hover,
nav ul li a[href*="logout"]:hover{
  background:rgba(178,58,46,.12);
  color:#ff8f80;
}

/* ---------- Bouton menu mobile ---------- */
.nav-toggle{
  display:none;
  flex-direction:column;
  justify-content:center;
  gap:5px;
  width:130px; height:38px;
  background:none;
  border:1px solid var(--hline);
  border-radius:8px;
  cursor:pointer;
}
.nav-toggle span{
  display:block;
  height:2px;
  margin:0 8px;
  background:var(--paper);
  border-radius:2px;
  transition:transform .3s var(--ease), opacity .3s var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1){ transform:translateY(7px) rotate(10deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2){ opacity:0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3){ transform:translateY(-7px) rotate(-10deg); }

.hide { display:none; } 

@media (max-width: 820px){
  .nav-toggle{ display:flex; }
  .nav-shell{
    position:absolute;
    top:calc(100% + 1px);
    left:0; right:0;
    background:var(--navy-deep);
    border-bottom:1px solid var(--hline);
    overflow:hidden;
    max-height:0;
    transition:max-height .4s var(--ease);
  }
  .nav-shell.open{ max-height:400px; }
  nav ul{
    flex-direction:column;
    align-items:stretch;
    padding:8px 16px 16px;
    gap:2px;
  }
  nav ul li a{ padding:12px 10px; }
  .nav-indicator{ display:none; }
}

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

/** ========================================================================================================== */
/* Container lehibe mifandray amin'ny header */
.active-year-container {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Tekst ANNÉE SCOLAIRE */
.active-year-container .label-text {
    color: #475569;
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 0.8px;
}

/* Cadre Maitso sy Vaventy tsara ho an'ny taona (ex: 2025 - 2026) */
.active-year-container .year-card {
    background-color: #059669; /* Maitso mivoaka tsara (Emerald green) */
    color: #ffffff;
    font-weight: 800;
    font-size: 18px; /* Vaventy tsara */
    padding: 6px 16px;
    border-radius: 8px;
    border: 2px solid #10b981;
    box-shadow: 0 4px 10px rgba(5, 150, 105, 0.25);
    letter-spacing: 1px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.active-year-container .year-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(5, 150, 105, 0.35);
}

/* Teptina maitso mitsilopilopy (Live indicator) */
.status-pulse {
    width: 10px;
    height: 10px;
    background-color: #10b981;
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}