:root {
  --navy: #08264a;
  --navy-2: #0b315e;
  --gold: #c89a2b;
  --ink: #182230;
  --muted: #637083;
  --line: #dfe5ec;
  --soft: #f5f7fa;
  --white: #ffffff;
  --max: 1180px;
  --shadow: 0 14px 38px rgba(8, 38, 74, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--white);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; display: block; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 9999;
  background: var(--navy);
  color: #fff;
  padding: .7rem 1rem;
}
.skip-link:focus { left: 1rem; top: 1rem; }

.institutional-rule { height: 5px; background: var(--navy); }

.institutional-header {
  background: #fff;
  border-bottom: 1px solid #edf0f3;
}
.institutional-header__inner {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  padding: 0;
}
.institutional-header__image {
  width: 100%;
  height: auto;
  display: block;
}

.main-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.main-nav__inner {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}
.brand {
  text-decoration: none;
  display: flex;
  align-items: baseline;
  gap: 10px;
  white-space: nowrap;
}
.brand__mark {
  color: var(--navy);
  font-weight: 800;
  letter-spacing: .06em;
  font-size: 1.08rem;
}
.brand__school {
  color: var(--muted);
  font-size: .82rem;
}
.nav-links {
  display: flex;
  gap: 22px;
  align-items: center;
}
.nav-links a {
  text-decoration: none;
  color: #354355;
  font-size: .9rem;
  font-weight: 600;
}
.nav-links a:hover, .nav-links a:focus { color: var(--navy); }
.nav-toggle {
  display: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .55rem .75rem;
  font-weight: 700;
  color: var(--navy);
}

.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 78% 25%, rgba(200,154,43,.10), transparent 28rem),
    linear-gradient(180deg, #fbfcfe 0%, #ffffff 100%);
}
.hero::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  border: 1px solid rgba(8,38,74,.08);
  border-radius: 50%;
  right: -140px;
  top: 40px;
}
.hero__inner {
  position: relative;
  z-index: 1;
  width: min(980px, calc(100% - 40px));
  margin: 0 auto;
  text-align: center;
  padding: 96px 0 104px;
}
.hero__eyebrow {
  color: var(--gold);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-bottom: 22px;
}
.hero h1 {
  margin: 0;
  color: var(--navy);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 5.5vw, 4.6rem);
  line-height: 1.03;
  font-weight: 600;
  letter-spacing: -.035em;
}
.hero h1 span { display: block; }
.hero__acronym {
  margin-top: 20px;
  color: var(--navy);
  font-size: .98rem;
  font-weight: 800;
  letter-spacing: .28em;
}
.hero__lead {
  width: min(780px, 100%);
  margin: 28px auto 0;
  color: #536174;
  font-size: 1.08rem;
}
.hero__actions {
  margin-top: 34px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 750;
  font-size: .92rem;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 10px 24px rgba(8,38,74,.14);
}
.btn--primary:hover { background: var(--navy-2); }
.btn--secondary {
  color: var(--navy);
  background: #fff;
  border: 1px solid #ccd6e2;
}

.section { padding: 86px 0; }
.section--soft { background: var(--soft); }
.section--dark { background: var(--navy); color: #fff; }
.section--contact { border-top: 1px solid var(--line); }

.section__inner {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}
.section__inner--split {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 80px;
  align-items: start;
}
.section__inner--dark h2 { color: #fff; }
.section-heading {
  max-width: 760px;
  margin-bottom: 42px;
}
.section-heading p { color: var(--muted); margin-bottom: 0; }
.section-kicker {
  color: var(--gold);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.section-kicker--gold { color: #e0b34d; }
h2 {
  margin: 0;
  color: var(--navy);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.55rem, 2.7vw, 2.25rem);
  line-height: 1.12;
  font-weight: 600;
  letter-spacing: -.025em;
}
h3 { color: var(--navy); }
.prose p { margin-top: 0; color: #455365; font-size: 1.02rem; }
.prose--light p { color: #d7e0eb; }
.muted-light { opacity: .78; font-size: .94rem !important; }

.pillar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.pillar {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px 24px;
  box-shadow: 0 6px 18px rgba(8,38,74,.035);
}
.pillar__index {
  color: var(--gold);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .12em;
}
.pillar h3 { margin: 18px 0 10px; font-size: 1.1rem; }
.pillar p { margin: 0; color: var(--muted); font-size: .94rem; }

.timeline {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 40px;
}
.timeline-card {
  position: relative;
  border-top: 3px solid var(--gold);
  background: #fff;
  border-radius: 0 0 12px 12px;
  padding: 28px 26px;
  box-shadow: var(--shadow);
}
.timeline-card__year {
  color: var(--gold);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .78rem;
}
.timeline-card h3 { margin: 12px 0 10px; font-size: 1.12rem; }
.timeline-card p { color: var(--muted); margin: 0; font-size: .95rem; }
.note {
  margin-top: 28px;
  border-left: 4px solid var(--gold);
  background: #f8fafc;
  padding: 18px 20px;
  color: #536174;
  font-size: .93rem;
}

.sector-list {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.sector-list span {
  border: 1px solid #d8e0e9;
  background: #fff;
  color: #344357;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 650;
  font-size: .9rem;
}

.admission {
  display: grid;
  grid-template-columns: 1fr .8fr;
  gap: 70px;
  align-items: center;
}
.admission > div:first-child p { color: var(--muted); max-width: 660px; }
.admission__panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px;
  background: #fff;
  box-shadow: var(--shadow);
}
.admission__panel h3 { margin-top: 0; }
.admission__panel p { color: var(--muted); }
.admission__panel .btn[aria-disabled="true"] {
  pointer-events: none;
  opacity: .75;
}
.microcopy { font-size: .78rem !important; margin-bottom: 0; }

.contact-grid {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: 60px;
  align-items: start;
}
.contact-lead { color: var(--muted); }
.contact-card {
  border-left: 4px solid var(--gold);
  background: #f8fafc;
  padding: 26px 28px;
}
.contact-card__label {
  color: var(--muted);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 700;
}
.contact-card__name {
  color: var(--navy);
  font-size: 1.15rem;
  font-weight: 800;
  margin: 8px 0 14px;
}
.contact-card__meta { color: #536174; margin-top: 6px; }
.placeholder { font-style: italic; color: #8a5f00; }

.footer {
  background: #061c36;
  color: #d9e2ec;
  font-size: .86rem;
}
.footer__inner {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  padding: 30px 0;
  display: flex;
  justify-content: space-between;
  gap: 30px;
}
.footer__right { text-align: right; }

@media (max-width: 980px) {
  .institutional-header__inner {
    min-height: 0;
    gap: 0;
  }
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 66px;
    left: 20px;
    right: 20px;
    flex-direction: column;
    align-items: stretch;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
    box-shadow: var(--shadow);
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { padding: 8px 10px; }
  .pillar-grid { grid-template-columns: repeat(2, 1fr); }
  .timeline { grid-template-columns: 1fr; }
  .section__inner--split,
  .admission,
  .contact-grid { grid-template-columns: 1fr; gap: 36px; }
}

@media (max-width: 640px) {
  .institutional-header__inner {
    width: calc(100% - 28px);
    padding: 0;
  }
  .main-nav__inner, .section__inner, .hero__inner, .footer__inner {
    width: calc(100% - 28px);
  }
  .brand__school { display: none; }
  .hero__inner { padding: 72px 0 78px; }
  .hero__eyebrow { font-size: .68rem; }
  .hero__lead { font-size: 1rem; }
  .section { padding: 64px 0; }
  .pillar-grid { grid-template-columns: 1fr; }
  .footer__inner { flex-direction: column; }
  .footer__right { text-align: left; }
}


/* ===== Version 2 — définition AGRAF + actuariat + architecture simplifiée ===== */

.hero__title span {
  display: block;
}

.actuarial-figure {
  margin: 8px 0 32px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.actuarial-figure img {
  width: 100%;
  height: auto;
  display: block;
}

.actuarial-figure figcaption {
  margin: 0;
  padding: 13px 18px 15px;
  color: var(--muted);
  font-size: .82rem;
  text-align: center;
  border-top: 1px solid var(--line);
}

.actuarial-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.actuarial-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px 22px 20px;
}

.actuarial-card__label {
  color: var(--navy);
  font-weight: 800;
  font-size: 1.02rem;
  margin-bottom: 8px;
}

.actuarial-card p {
  margin: 0;
  color: var(--muted);
  font-size: .92rem;
}

.timeline--simple .timeline-card {
  min-height: 225px;
}

@media (max-width: 980px) {
  .actuarial-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .hero__title {
    font-size: clamp(1.72rem, 8.2vw, 2.35rem);
  }
}


/* ===== Version 3 — logo AGRAF dans le hero + titre strictement en 2 lignes ===== */

.hero__inner--with-logo {
  width: min(var(--max), calc(100% - 40px));
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(250px, .75fr);
  gap: 56px;
  align-items: center;
  text-align: left;
  padding: 82px 0 90px;
}

.hero__content {
  min-width: 0;
}

.hero__inner--with-logo .hero__eyebrow,
.hero__inner--with-logo .hero__lead {
  margin-left: 0;
  margin-right: 0;
}

.hero__inner--with-logo .hero__actions {
  justify-content: flex-start;
}

.hero__title {
  font-size: clamp(2.15rem, 4.2vw, 4.45rem);
}

.hero__title span {
  display: block;
  white-space: nowrap;
}

.hero__logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
}

.hero__logo-wrap img {
  width: min(330px, 100%);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 18px 28px rgba(8, 38, 74, .12));
}

@media (max-width: 980px) {
  .hero__inner--with-logo {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 34px;
  }

  .hero__inner--with-logo .hero__eyebrow,
  .hero__inner--with-logo .hero__lead {
    margin-left: auto;
    margin-right: auto;
  }

  .hero__inner--with-logo .hero__actions {
    justify-content: center;
  }

  .hero__logo-wrap {
    order: 2;
  }

  .hero__logo-wrap img {
    width: min(250px, 68vw);
  }
}

@media (max-width: 640px) {
  .hero__title {
    font-size: clamp(1.12rem, 5.35vw, 1.75rem);
    letter-spacing: -.02em;
  }

  .hero__title span {
    white-space: nowrap;
  }
}


/* =========================================================
   AGRAF — HERO V4 (VERSION DE RÉFÉRENCE)
   ========================================================= */

.hero {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(
            circle at 86% 42%,
            rgba(200, 154, 43, 0.08),
            transparent 24rem
        ),
        linear-gradient(
            180deg,
            #fbfcfe 0%,
            #ffffff 100%
        );
}

.hero-v4 {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;

    display: grid;
    grid-template-columns: minmax(0, 1fr) 245px;
    gap: 52px;

    align-items: center;

    padding: 72px 0 78px;
}

.hero-v4__content {
    min-width: 0;
}

.hero-v4__eyebrow {
    margin-bottom: 22px;

    color: #c08b17;

    font-size: 0.76rem;
    font-weight: 800;

    letter-spacing: 0.14em;
    line-height: 1.5;

    text-transform: uppercase;
}

.hero-v4__title {
    margin: 0;

    color: #741f2b;

    font-family: Georgia, "Times New Roman", serif;

    font-size: clamp(1.55rem, 2.7vw, 2.25rem);

    font-weight: 600;

    line-height: 1.05;

    letter-spacing: -0.035em;
}

.hero-v4__title span {
    display: block;
    white-space: nowrap;
}

.hero-v4__lead {
    max-width: 720px;

    margin: 28px 0 0;

    color: #59687b;

    font-size: 1.05rem;
    line-height: 1.7;
}

.hero-v4__actions {
    display: flex;
    flex-wrap: wrap;

    gap: 12px;

    margin-top: 32px;
}

.hero-v4__btn {
    min-height: 46px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0 20px;

    border-radius: 8px;

    text-decoration: none;

    font-size: 0.92rem;
    font-weight: 750;

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        background 0.15s ease;
}

.hero-v4__btn:hover {
    transform: translateY(-1px);
}

.hero-v4__btn--primary {
    background: #082b55;
    color: #ffffff;

    box-shadow:
        0 10px 24px rgba(8, 43, 85, 0.13);
}

.hero-v4__btn--primary:hover {
    background: #0b376a;
}

.hero-v4__btn--secondary {
    background: #d4a017;
    color: #082b55;
    border: 1px solid #b8870d;
    box-shadow: 0 10px 24px rgba(184, 135, 13, 0.18);
}

.hero-v4__btn--secondary:hover {
    background: #be8f13;
}

.hero-v4__btn--dates {
    background: #fffaf0;
    color: #8a620b;
    border: 1px solid #d8b15a;
}

.hero-v4__btn--dates:hover {
    background: #fff4d9;
}

.hero-v4__visual {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Le fichier du logo reste intact : seul l'affichage est recadré en disque. */
.hero-v4__logo-disc {
    width: 220px;
    height: 220px;

    position: relative;

    border-radius: 50%;
    overflow: hidden;

    background: transparent;

    filter:
        drop-shadow(
            0 14px 22px rgba(8, 43, 85, 0.13)
        );
}

.hero-v4__logo-disc img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;

    border-radius: 50%;

    transform: scale(1.035);
}

@media (max-width: 1050px) {

    .hero-v4 {
        grid-template-columns: minmax(0, 1fr) 190px;
        gap: 32px;
    }

    .hero-v4__logo-disc {
        width: 180px;
        height: 180px;
    }

    .hero-v4__title {
        font-size: clamp(
            1.45rem,
            2.55vw,
            2rem
        );
    }
}

@media (max-width: 760px) {

    .hero-v4 {
        grid-template-columns: 1fr;

        gap: 28px;

        padding: 54px 0 60px;
    }

    .hero-v4__content {
        text-align: center;
    }

    .hero-v4__eyebrow {
        max-width: 520px;

        margin-left: auto;
        margin-right: auto;
    }

    .hero-v4__title {
        font-size: clamp(
            1rem,
            4.15vw,
            1.5rem
        );
    }

    .hero-v4__title span {
        white-space: nowrap;
    }

    .hero-v4__lead {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-v4__actions {
        justify-content: center;
    }

    .hero-v4__visual {
        order: -1;
    }

    .hero-v4__logo-disc {
        width: 145px;
        height: 145px;
    }
}

/* Sélecteur bilingue FR / EN — ajout discret, sans modifier le design V4.1. */
.language-switch {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 14px;
    color: #9a6b08;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.language-switch__btn {
    appearance: none;
    border: 0;
    background: transparent;
    color: #66758a;
    cursor: pointer;
    font: inherit;
    padding: 5px 3px;
}

.language-switch__btn:hover,
.language-switch__btn:focus-visible,
.language-switch__btn.is-active {
    color: #082b55;
}

.language-switch__btn.is-active {
    text-decoration: underline;
    text-decoration-color: #c89319;
    text-underline-offset: 4px;
}

@media (max-width: 760px) {
    .language-switch {
        margin-left: auto;
    }
}


/* =========================================================
   AGRAF — HERO V4.1
   Ajustement demandé : logo abaissé au niveau des boutons
   ========================================================= */

.hero-v4__visual {
    /* On descend le logo pour libérer totalement la zone du titre. */
    transform: translateY(96px);
}

.hero-v4__logo-disc {
    width: 195px;
    height: 195px;
}

/* Calendrier dynamique du concours */
.competition-calendar-section {
    background: #f5f7fa;
}

.competition-calendar {
    max-width: 760px;
    margin: 0 auto;
    padding: 26px;
    border: 1px solid #e0e6ed;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 16px 42px rgba(8, 43, 85, 0.08);
}

.competition-calendar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 18px;
}

.calendar-kicker { margin-bottom: 5px; }
.calendar-title { font-size: clamp(1.45rem, 2.4vw, 2rem); }

.competition-calendar__controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.calendar-nav {
    width: 38px;
    height: 38px;
    border: 1px solid #d7e0e9;
    border-radius: 9px;
    background: #fff;
    color: #082b55;
    cursor: pointer;
    font-size: 1.45rem;
    line-height: 1;
}

.calendar-month {
    min-width: 170px;
    padding: 11px 18px;
    border-radius: 9px;
    background: #082b55;
    color: #fff;
    text-align: center;
    font-size: .86rem;
    font-weight: 800;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
}

.calendar-weekday {
    padding: 10px 4px;
    background: #eef5f7;
    color: #53677a;
    font-size: .72rem;
    font-weight: 800;
}

.calendar-day {
    min-height: 50px;
    display: grid;
    place-items: center;
    border: 0;
    border-bottom: 1px solid #edf0f4;
    background: transparent;
    color: #16314f;
    font: inherit;
    font-size: .82rem;
    font-weight: 750;
}

button.calendar-day { cursor: pointer; }
.calendar-day.is-muted { color: #a8b0ba; }
.calendar-day span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; }
.calendar-day.has-event--gold span { background: #efb638; color: #082b55; }
.calendar-day.has-event--blue span { background: #d9e8f8; color: #082b55; }
.calendar-day.is-selected span { outline: 2px solid #fff; box-shadow: 0 0 0 3px #a9bfd6; }

.calendar-event {
    min-height: 64px;
    margin-top: 14px;
    padding: 13px 15px;
    border: 1px solid #e3e8ee;
    border-radius: 10px;
    background: #f9fafc;
    color: #44566a;
    font-size: .86rem;
    line-height: 1.45;
}

.calendar-event strong { display: block; color: #082b55; }

@media (max-width: 680px) {
    .competition-calendar { padding: 18px 12px; }
    .competition-calendar__header { align-items: flex-start; flex-direction: column; }
    .competition-calendar__controls { width: 100%; }
    .calendar-month { flex: 1; min-width: 0; }
    .calendar-day { min-height: 43px; }
    .calendar-day span { width: 30px; height: 30px; }
}


@media (max-width: 1050px) {
    .hero-v4__visual {
        transform: translateY(64px);
    }

    .hero-v4__logo-disc {
        width: 165px;
        height: 165px;
    }
}

@media (max-width: 760px) {
    .hero-v4__visual {
        transform: none;
    }

    .hero-v4__logo-disc {
        width: 145px;
        height: 145px;
    }
}
