/* ==========================================================================
   AE Services Financiers — feuille de styles
   Couleurs de la marque
     Marine      #0D3E6B   (fonds foncés, titres)
     Bleu AE     #186BB7   (boutons, liens, accents)
     Bleu clair  #82BDDB   (accents sur fond marine)
     Encre       #0B2238   (texte principal)
     Ardoise     #4A5D70   (texte secondaire)
     Brume       #F4F8FB   (fonds clairs alternés)
   La mise en page de chaque section est écrite directement dans index.html
   (attributs style) ; ce fichier contient les polices, les états
   (survol, focus), le menu mobile et les formulaires.
   ========================================================================== */

/* ---------- Polices (hébergées sur le site, licence SIL OFL) ---------- */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('../fonts/manrope-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('../fonts/newsreader-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Newsreader';
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url('../fonts/newsreader-latin-italic.woff2') format('woff2');
}

/* ---------- Base ---------- */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: #0B2238;
  background: #FFFFFF;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
[hidden] { display: none !important; }
section[id], main[id] { scroll-margin-top: 96px; }
a { color: #186BB7; }
a:hover { color: #0D3E6B; }
::selection { background: #82BDDB; color: #0D3E6B; }

/* Lien d'évitement (clavier et lecteurs d'écran) */
.ae-skip {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 12px 18px;
  border-radius: 10px;
  background: #0D3E6B;
  color: #FFFFFF;
  font-weight: 700;
  text-decoration: none;
}
.ae-skip:focus { top: 16px; color: #FFFFFF; }

/* ---------- Focus visible ---------- */
a:focus-visible,
button:focus-visible { outline: 3px solid #82BDDB; outline-offset: 3px; }
input:focus,
select:focus,
textarea:focus { outline: 2px solid #186BB7; outline-offset: 1px; border-color: #186BB7 !important; }

/* ---------- Boutons ---------- */
.ae-btn { transition: background .2s ease, transform .2s ease, color .2s ease, border-color .2s ease; }
.ae-btn:hover { transform: translateY(-1px); }
.ae-btn-primary:hover { background: #0D3E6B !important; color: #FFFFFF !important; }
.ae-btn-ghost:hover { border-color: #186BB7 !important; color: #186BB7 !important; }
.ae-btn-light:hover { background: #FFFFFF !important; color: #0D3E6B !important; }
button[disabled] { opacity: .7; cursor: progress !important; transform: none !important; }

/* ---------- Cartes de services ---------- */
.ae-card { transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
@media (hover: hover) {
  .ae-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 28px 50px -30px rgba(13, 62, 107, .45);
    border-color: #82BDDB !important;
  }
}

/* ---------- Navigation ---------- */
.ae-nav a:hover { color: #186BB7 !important; }
.ae-nav .ae-btn:hover { color: #FFFFFF !important; }

.ae-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-left: auto;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
}
.ae-menu-btn .ae-menu-close { display: none; }
.ae-menu-btn[aria-expanded="true"] .ae-menu-open { display: none; }
.ae-menu-btn[aria-expanded="true"] .ae-menu-close { display: inline; }

@media (max-width: 900px) {
  .ae-menu-btn { display: inline-flex; }
  .ae-nav {
    display: none !important;
    width: 100%;
    flex-direction: column;
    align-items: stretch !important;
    gap: 0 !important;
    padding: 8px 0 4px;
    border-top: 1px solid #E3EBF2;
  }
  .ae-nav.is-open { display: flex !important; }
  .ae-nav > a { padding: 14px 4px; font-size: 17px; }
  .ae-nav > a.ae-btn { margin-top: 10px; justify-content: center; padding: 0 20px; }
}

/* ---------- Formulaires ---------- */
.ae-form input,
.ae-form select,
.ae-form textarea { width: 100%; box-sizing: border-box; }
.ae-form select { appearance: auto; }
.ae-form input[type="checkbox"] { width: 20px; min-height: 0; padding: 0; }
.ae-consent input:user-invalid { outline: 2px solid #C0392B; outline-offset: 2px; }
.ae-form-error {
  margin: 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: #FDF1F0;
  color: #8A1F14;
  font-size: 14.5px;
  line-height: 1.5;
}
.ae-form-error a { color: #8A1F14; font-weight: 700; }
.ae-form-success:focus { outline: none; }

/* ---------- Petits écrans ---------- */
@media (max-width: 600px) {
  main section > div { padding-top: 72px !important; padding-bottom: 72px !important; }
  #contact > div > div:last-child { padding: 26px !important; }
}

/* ---------- Mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ae-btn, .ae-card { transition: none; }
  .ae-btn:hover, .ae-card:hover { transform: none; }
}


/* ==========================================================================
   Améliorations UX — en-tête fixe, menu actif, appel rapide, barre mobile
   ========================================================================== */

/* En-tête qui reste visible au défilement */
.ae-header { position: sticky; top: 0; z-index: 50; transition: box-shadow .25s ease; }
.ae-header.is-scrolled { box-shadow: 0 10px 30px -18px rgba(13, 62, 107, .45); }

/* Menu : soulignement au survol et section en cours */
.ae-nav a:not(.ae-btn) { position: relative; }
.ae-nav a.is-active { color: #186BB7 !important; }
@media (min-width: 901px) {
  .ae-nav a:not(.ae-btn)::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -6px;
    height: 2px;
    border-radius: 2px;
    background: #186BB7;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .25s ease;
  }
  .ae-nav a:not(.ae-btn):hover::after,
  .ae-nav a.is-active::after { transform: scaleX(1); }
}

/* Bouton d'appel (mobile seulement) */
.ae-call { display: none; }

/* Barre d'action mobile */
.ae-mobile-cta { display: none; }

/* Formulaire : erreurs visibles après une tentative d'envoi */
.ae-form.was-validated input:invalid,
.ae-form.was-validated select:invalid,
.ae-form.was-validated textarea:invalid { border-color: #C0392B !important; }
.ae-form.was-validated input[type="checkbox"]:invalid { outline: 2px solid #C0392B; outline-offset: 2px; }

@media (max-width: 900px) {
  section[id], main[id] { scroll-margin-top: 80px; }
  .ae-call {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    margin-left: auto;
    border-radius: 12px;
    background: #EEF5FA;
    color: #186BB7;
  }
  .ae-call + .ae-menu-btn { margin-left: 6px; }
  .ae-header > div { column-gap: 8px !important; flex-wrap: wrap; }
  .ae-header > div > a:first-child { flex: 0 1 auto; min-width: 0; }
  .ae-nav.is-open { max-height: calc(100vh - 90px); max-height: calc(100svh - 90px); overflow-y: auto; }

  .ae-mobile-cta {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 60;
    display: flex;
    gap: 10px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .97);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-top: 1px solid #E3EBF2;
    box-shadow: 0 -10px 30px -20px rgba(13, 62, 107, .5);
    transition: transform .3s ease;
  }
  .ae-mobile-cta.is-hidden { transform: translateY(115%); }
  .ae-mobile-cta a {
    flex: 1;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
  }
  .ae-mobile-cta .call { border: 1.5px solid #C9D8E5; color: #0D3E6B; background: #FFFFFF; }
  .ae-mobile-cta .book { flex: 1; background: #186BB7; color: #FFFFFF; }
  body { background: #082A4A; padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
}

@media (max-width: 600px) {
  .ae-topbar { display: none; }
  .ae-header > div { padding-top: 12px !important; padding-bottom: 12px !important; }
  .ae-hero-lead { font-size: 17px !important; line-height: 1.6 !important; margin-top: 20px !important; }
  .ae-hero-actions { margin-top: 28px !important; }
  .ae-hero-actions > a { width: 100%; justify-content: center; }
  main > section:first-child > div { padding-top: 48px !important; padding-bottom: 72px !important; gap: 48px !important; }
}

@media (prefers-reduced-motion: reduce) {
  .ae-mobile-cta, .ae-header, .ae-nav a::after { transition: none; }
}

/* ==========================================================================
   Motion design — sobre et professionnel
   Tout est désactivé si l'utilisateur préfère réduire les animations,
   et rien n'est masqué si le JavaScript ne s'exécute pas (classe .js).
   ========================================================================== */
:root {
  --ae-ease: cubic-bezier(.22, .61, .36, 1);
  --ae-ease-out: cubic-bezier(.16, 1, .3, 1);
}

@media (prefers-reduced-motion: no-preference) {

  /* ---------- Apparition au défilement ---------- */
  .js [data-reveal] {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity .8s var(--ae-ease-out), transform .8s var(--ae-ease-out);
    transition-delay: var(--ae-delay, 0ms);
    will-change: opacity, transform;
  }
  .js [data-reveal="left"] { transform: translateX(-18px); }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
  /* Les cartes gardent leur propre transition de survol une fois apparues */
  .js .ae-card[data-reveal].is-in { transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease, opacity .8s var(--ae-ease-out); }

  /* ---------- Accueil : entrée en scène au chargement ---------- */
  @keyframes ae-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
  @keyframes ae-slide-in { from { opacity: 0; transform: translateX(28px) scale(.98); } to { opacity: 1; transform: none; } }
  @keyframes ae-pop { 0% { opacity: 0; transform: translateY(10px) scale(.94); } 100% { opacity: 1; transform: none; } }
  @keyframes ae-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.035); } }

  .js .ae-hero-copy > * { animation: ae-rise .9s var(--ae-ease-out) both; }
  .js .ae-hero-copy > :nth-child(1) { animation-delay: .05s; }
  .js .ae-hero-copy > :nth-child(2) { animation-delay: .15s; }
  .js .ae-hero-copy > :nth-child(3) { animation-delay: .28s; }
  .js .ae-hero-copy > :nth-child(4) { animation-delay: .4s; }

  .js .ae-hero-visual > div { animation: ae-slide-in 1s var(--ae-ease-out) .3s both; }
  .js .ae-hero-visual > div > div:first-child > div:last-child > div { animation: ae-rise .7s var(--ae-ease-out) both; }
  .js .ae-hero-visual > div > div:first-child > div:last-child > div:nth-child(1) { animation-delay: .65s; }
  .js .ae-hero-visual > div > div:first-child > div:last-child > div:nth-child(2) { animation-delay: .75s; }
  .js .ae-hero-visual > div > div:first-child > div:last-child > div:nth-child(3) { animation-delay: .85s; }
  .js .ae-hero-visual > div > div:first-child > div:last-child > div:nth-child(4) { animation-delay: .95s; }
  .js .ae-hero-badge { animation: ae-pop .7s var(--ae-ease-out) 1.15s both; }

  .ae-hero-rings { transform-origin: 50% 50%; animation: ae-breathe 14s ease-in-out infinite; }

  /* ---------- Notre approche : la ligne se trace, les étapes s'allument ---------- */
  .js .ae-step .ae-step-line { transform: scaleX(0); transform-origin: left center; transition: transform 1s var(--ae-ease) calc(var(--ae-delay, 0ms) + 250ms); }
  .js .ae-step.is-in .ae-step-line { transform: scaleX(1); }
  .js .ae-step > div:first-child > span:first-child { transform: scale(.6); opacity: 0; transition: transform .6s var(--ae-ease-out) calc(var(--ae-delay, 0ms) + 100ms), opacity .4s ease calc(var(--ae-delay, 0ms) + 100ms); }
  .js .ae-step.is-in > div:first-child > span:first-child { transform: none; opacity: 1; }

  /* ---------- Micro-interactions ---------- */
  .ae-btn svg { transition: transform .25s var(--ae-ease); }
  .ae-btn:hover svg { transform: translateX(4px); }
  .ae-card > span:first-child { transition: transform .35s var(--ae-ease), background-color .35s ease; }
  @media (hover: hover) {
    .ae-card:hover > span:first-child { transform: translateY(-3px); background-color: #E1EEF7 !important; }
  }
  .ae-form-success:not([hidden]) { animation: ae-pop .6s var(--ae-ease-out) both; }
  .ae-form-error:not([hidden]) { animation: ae-rise .4s var(--ae-ease-out) both; }
}

/* Sélecteur de langue FR / EN */
.ae-nav a.ae-lang {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 34px;
  padding: 0 10px;
  border: 1.5px solid #C9D8E5;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
  color: #0D3E6B !important;
  text-decoration: none;
}
.ae-nav a.ae-lang::after { display: none; }
.ae-nav a.ae-lang:hover { border-color: #186BB7; color: #186BB7 !important; }
@media (max-width: 900px) {
  .ae-nav > a.ae-lang { align-self: flex-start; margin: 8px 4px 0; padding: 0 14px; min-height: 40px; }
}
