/* ==================================================
   THÈME & VARIABLES CSS (couleurs, typo)
   ================================================== */
:root {
  --dark-blue: #1f61aa;   /* Bleu principal FGCE */
  --light-blue: #5b8fd0;  /* Variante claire du bleu (hover/bordures) */
  --yellow: #FFD700;
  --white: #FFFFFF;
  --text-color: #333333;
  --light-gray: #f4f4f4;
}

/* ==================================================
   BASE (reset léger + styles généraux)
   ================================================== */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--white);
  color: var(--text-color);
  line-height: 1.6;
}
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
h1, h2 { color: var(--dark-blue); }
a { color: inherit; }

/* ==================================================
   ACCESSIBILITÉ – Lien d'évitement (skip link)
   ================================================== */
.skip-link {
  position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden;
}
.skip-link:focus { position: static; width: auto; height: auto; padding: 8px 12px; background: var(--yellow); color: var(--dark-blue); }

/* ==================================================
   EN-TÊTE (HEADER) – bandeau supérieur
   ================================================== */
.main-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 20px; background: var(--white);
  box-shadow: 0 2px 5px rgba(0,0,0,0.08);
  position: sticky; top: 0; z-index: 1100;
}
.logo-container img { max-height: 98px; height: auto; } /* Hauteur du logo */

/* ==================================================
   BURGER (menu mobile)
   ================================================== */
.nav-toggle { display: block; cursor: pointer; background: none; border: none; padding: 10px; z-index: 1001; }
.hamburger { 
  display: block; position: relative; width: 26px; height: 3px; margin: 0; padding: 0;
  background: var(--dark-blue); transition: background-color .3s ease;
}
.hamburger::before, .hamburger::after { 
  content: ""; position: absolute; left: 0; width: 26px; height: 3px; 
  background: var(--dark-blue); transition: transform .3s ease, opacity .3s ease; 
}
.hamburger::before { top: -8px; } 
.hamburger::after  { top:  8px; }
.nav-toggle.is-active .hamburger { background-color: transparent; }
.nav-toggle.is-active .hamburger::before { transform: translateY(8px) rotate(45deg); }
.nav-toggle.is-active .hamburger::after  { transform: translateY(-8px) rotate(-45deg); }

/* ==================================================
   NAVIGATION PRINCIPALE
   ================================================== */
.main-nav {
  display: none; position: fixed; top: 0; right: 0; width: 65%; max-width: 320px; height: 100vh;
  background: var(--dark-blue); color: var(--white);
  flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 40px 20px;
}
.main-nav.is-open { display: flex; }
.main-nav a { color: var(--white); text-decoration: none; font-size: 1.0rem; margin: 6px 0; padding: 6px 14px; border-radius: 8px; transition: background-color .25s ease; }
.main-nav a:hover, .main-nav a:focus { background-color: var(--light-blue); }
.nav-close { position: absolute; top: 12px; right: 12px; background: transparent; color: var(--white); border: 2px solid rgba(255,255,255,.6); border-radius: 999px; font-size: 1.1rem; line-height: 1; padding: 6px 10px; cursor: pointer; }
.nav-close:hover { background: rgba(255,255,255,.12); }

/* ==================================================
   CONTENU – section principale (main)
   ================================================== */
main { padding: 40px 0; }
.intro { text-align: center; margin-bottom: 40px; }
.intro h1 { font-size: 2rem; margin-bottom: 10px; }

/* ==================================================
   PORTAILS – cartes d'accès (images responsives + coins arrondis)
   ================================================== */
.portals-container { display: flex; flex-direction: column; gap: 24px; }
.portals-container-accueil { display: flex; flex-direction: column; gap: 10px; }

/* Carte : le border-radius et overflow clip l'image */
.portal-box {
  background: var(--light-gray);
  border-left: 5px solid var(--light-blue);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,.05);
  transition: transform .3s ease, box-shadow .3s ease;
  display: flex;
  flex-direction: column;
}
.portal-box:hover { transform: translateY(-4px); box-shadow: 0 6px 16px rgba(0,0,0,.10); }

/* Zone image : ratio stable et responsive */
.portal-media {
  width: 100%;
  aspect-ratio: 16 / 9;   /* Ajuste ici si tu veux un autre ratio */
  position: relative;
  flex-shrink: 0;
}

/* Image : remplit et se recadre proprement (homothésie) */
.portal-media img.portal-thumb {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

/* Contenu sous l'image */
.portal-content {
  padding: 20px;
  text-align: center;
}

/* Bouton dans une carte */
.portal-box .btn {
  display: inline-block; background: var(--yellow); color: var(--dark-blue);
  padding: 12px 26px; text-decoration: none; font-weight: 700; border-radius: 999px;
  transition: background-color .25s ease;
}
.portal-box .btn:hover, .portal-box .btn:focus { background: #ffc700; }

/* ==================================================
   PIED DE PAGE (FOOTER)
   ================================================== */
.main-footer {
  background: var(--dark-blue);
  color: var(--white);
  padding: 16px 16px;
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.45;
}
.footer-info p { margin: 2px 0; }
.footer-logos { margin-top: 14px; gap: 16px; }
.footer-logos img { max-height: 36px; }

/* ==================================================
   FORMULAIRES – styles génériques
   ================================================== */
.form-select,
.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d9dee8;
  border-radius: 8px;
  background: #fff;
}

/* Cartes/formulaires de la page de présentation */
.form-card-accueil {
  background: var(--light-gray);
  border-left: 5px solid var(--light-blue);
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,.05);
}

/* Carte formulaire générique si utilisée ailleurs */
.form-card {
  background: var(--light-gray);
  border-left: 5px solid var(--light-blue);
  padding: 24px;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0,0,0,.05);
}

.form-grid{ display:grid; grid-template-columns:260px 1fr; gap:10px 16px; align-items:center; }
.form-grid .row{ display:contents; }
.form-grid label{ font-weight:600; }
.form-grid input[type="text"],
.form-grid input[type="email"],
.form-grid select{
  width:100%; padding:10px 12px; border:1px solid #d9dee8; border-radius:8px; background:#fff;
}

/* ==================================================
   TABLEAUX – harmonisés au bleu agence
   ================================================== */
.doc-table-wrap{ margin-top:18px; border:1px solid #e6e9ef; border-radius:10px; overflow:hidden; background:#fff; }
.doc-table-scroll{ overflow-x:auto; -webkit-overflow-scrolling:touch; }
table.doc-table{ width:100%; border-collapse:collapse; min-width:620px; }
.doc-table th, .doc-table td{ padding:10px 12px; border-bottom:1px solid #e6e9ef; vertical-align:middle; }
.doc-table thead th{ background:var(--dark-blue); color:#fff; font-weight:700; text-align:left; }
.doc-table td:first-child{ width:48px; text-align:center; }
.doc-table td:nth-child(3), .doc-table td:nth-child(4){ text-align:center; white-space:nowrap; }
.doc-section{ background:var(--dark-blue); color:#fff; font-weight:700; }
.doc-section td{ padding:8px 12px; }

/* ==================================================
   ZONE ACCORD + CTA + MESSAGES
   ================================================== */
.confirm-grid{ display:grid; grid-template-columns:260px 1fr; gap:10px 16px; align-items:center; margin-top:18px; }
.confirm-grid .inline{ display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.agree-line{ display:flex; align-items:center; gap:8px; margin:12px 0 6px; }
.form-actions{ text-align:center; margin-top:16px; }
.accord-error{ display:none; color:#c1121f; font-weight:600; margin:6px 0 0 0; }

/* Bouton jaune homogène (générique) */
.btn{
  display:inline-block; background:var(--yellow); color:var(--dark-blue);
  padding:12px 26px; text-decoration:none; font-weight:700; border-radius:999px;
  transition:background-color .25s ease; border:0; cursor:pointer;
}
.btn:hover, .btn:focus{ background:#ffc700; }

/* ==================================================
   MEDIA QUERIES – adaptations responsive
   ================================================== */
@media (max-width: 800px){
  .form-grid, .confirm-grid{ grid-template-columns:1fr; }
  .form-grid label, .confirm-grid label{ margin-top:6px; }
}

@media (min-width: 768px) {
  .intro h1 { font-size: 2.4rem; }
  .portals-container { flex-direction: row; justify-content: space-around; }
  .portals-container-accueil { flex-direction: row; justify-content: space-around; }
  .portal-box { width: 45%; }
}

@media (min-width: 1100px) {
  .nav-toggle { display: none; } /* On cache le bouton hamburger */
  .main-nav {
    display: flex !important;
    position: static;
    height: auto;
    width: auto;
    background: transparent;
    color: var(--dark-blue);
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 6px; /* corrige la typo 6Spx */
    padding: 0;
  }
  .main-nav a {
    color: var(--dark-blue);
    font-size: 1rem;
    margin: 0;
    padding: 8px 12px;
    border-radius: 6px;
  }
  .main-nav a:hover, .main-nav a:focus { background: rgba(31, 97, 170, 0.12); }
  .nav-close { display: none; }
}
/* Conteneur présentation : full-bleed image + coins arrondis */
.form-card-accueil {
  background: var(--light-gray);
  border-left: 5px solid var(--light-blue);
  border-radius: 12px;
  overflow: hidden;        /* indispensable pour que l'image respecte les coins */
  box-shadow: 0 4px 10px rgba(0,0,0,.05);
  padding: 0;              /* pas de padding ici, sinon l'image ne colle pas aux bords */
  display: flex;
  flex-direction: column;
}

/* Padding du contenu texte, séparé de l'image */
.form-card-content {
  padding: 24px;
}

/* Zone image responsive, ratio stable (comme les portails) */
.portal-media {
  width: 100%;
  aspect-ratio: 16 / 9;
  position: relative;
  flex-shrink: 0;
}

/* L'image remplit toute la largeur et est recadrée proprement */
.portal-media img.portal-thumb {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
