/* ==========================================================================
   AÉROCLUB D'ARGENTAN — Design System
   ========================================================================== */

:root {
  color-scheme: light;
  --color-primary:       #0c1a3a;
  --color-primary-light: #1e3a5f;
  --color-accent:        #2563eb;
  --color-accent-hover:  #1d4ed8;
  --color-accent-warm:   #fbbf24;
  --color-bg-light:      #f8fafc;
  --color-bg-section:    #e0f2fe;
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  color: #1e293b;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, h5, h6 { font-family: 'Montserrat', sans-serif; }

/* ---- SCROLL PROGRESS BAR ---- */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--color-accent) 0%, var(--color-accent-warm) 100%);
  z-index: 9998;
  pointer-events: none;
  transition: width 0.08s linear;
  border-radius: 0 2px 2px 0;
}

/* ---- PAGE TRANSITION OVERLAY ---- */
#page-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-primary);
  z-index: 9999;
  pointer-events: none;
  transition: opacity 0.5s ease;
}
#page-overlay.out { opacity: 0; }

/* ---- NAVBAR ---- */
.navbar { transition: background-color 0.3s ease, box-shadow 0.3s ease; }
.navbar.scrolled {
  background-color: rgba(12, 26, 58, 0.97) !important;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.18);
}
.nav-link {
  position: relative;
  transition: color 0.2s ease;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 50%;
  width: 0; height: 2px;
  background-color: var(--color-accent-warm);
  transition: width 0.3s ease, left 0.3s ease;
}
.nav-link:hover::after,
.nav-link.active::after { width: 100%; left: 0; }
.nav-link.active {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

/* ---- MENU MOBILE ---- */
.mobile-menu { max-height: 0; overflow: hidden; transition: max-height 0.4s ease; }
.mobile-menu.open { max-height: 650px; }
.mobile-nav-active {
  border-left: 3px solid var(--color-accent-warm);
  padding-left: 13px !important;
}

/* ---- BOUTONS ---- */
.btn-primary {
  position: relative;
  overflow: hidden;
  background-color: var(--color-accent);
  transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}
/* Shimmer sweep au hover */
.btn-primary::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
  transition: left 0.55s ease;
}
.btn-primary:hover::after { left: 160%; }
.btn-primary:hover {
  background-color: var(--color-accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}
.btn-outline {
  border: 2px solid white;
  transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}
.btn-outline:hover {
  background-color: white;
  color: var(--color-primary);
  transform: translateY(-1px);
}

/* ---- CARTES ---- */
.card { transition: transform 0.3s ease, box-shadow 0.3s ease; }
.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 -3px 0 var(--color-accent), 0 20px 40px rgba(37, 99, 235, 0.12);
}

/* ---- FOOTER ---- */
.footer-link { transition: color 0.2s ease; }
.footer-link:hover { color: var(--color-accent-warm); }

/* ---- FADE UP (scroll reveal) ---- */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-up.visible { opacity: 1; transform: translateY(0); }
.fade-up.delay-1 { transition-delay: 0.12s; }
.fade-up.delay-2 { transition-delay: 0.24s; }
.fade-up.delay-3 { transition-delay: 0.36s; }
.fade-up.delay-4 { transition-delay: 0.48s; }

/* ---- GRADIENT TEXT ---- */
.text-gradient {
  background: linear-gradient(135deg, #fbbf24 0%, #fde68a 55%, #fff7ed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---- HERO ---- */
.hero-overlay {
  background: linear-gradient(
    to bottom,
    rgba(12, 26, 58, 0.65) 0%,
    rgba(12, 26, 58, 0.40) 50%,
    rgba(12, 26, 58, 0.75) 100%
  );
}

/* Ken Burns sur l'image hero */
@keyframes kenBurns {
  0%   { transform: scale(1.0) translate(0, 0); }
  100% { transform: scale(1.08) translate(-1.5%, -1%); }
}
.hero-img {
  animation: kenBurns 22s ease-in-out infinite alternate;
  transform-origin: center;
  will-change: transform;
}

/* Avion décoratif qui traverse le hero */
@keyframes flyAcross {
  0%   { transform: translateX(0)     translateY(0);                   opacity: 0;    }
  8%   {                                                                opacity: 0.22; }
  92%  {                                                                opacity: 0.22; }
  100% { transform: translateX(200vw) translateY(var(--fly-dy, 0px)); opacity: 0;    }
}
.hero-plane {
  position: absolute;
  top: var(--fly-top, 28%);  /* hauteur aléatoire à chaque passage */
  left: -110px;
  z-index: 8;
  pointer-events: none;
  animation: flyAcross 18s linear 0s infinite;
  animation-fill-mode: backwards;
}
.hero-plane img {
  display: block;
  transition: transform 0.6s ease; /* inclinaison nez douce entre deux passages */
}

/* ---- FLOATING CTA ---- */
.fab-cta {
  position: fixed;
  bottom: 28px;
  right: 24px;
  z-index: 900;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--color-accent);
  color: white !important;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 0.8125rem;
  padding: 13px 22px;
  border-radius: 50px;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4), 0 1px 4px rgba(0,0,0,0.15);
  transform: translateY(80px);
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.35s ease,
              background-color 0.2s ease,
              box-shadow 0.2s ease;
}
.fab-cta.visible  { transform: translateY(0); opacity: 1; }
.fab-cta:hover    {
  background: var(--color-accent-hover);
  box-shadow: 0 8px 28px rgba(37, 99, 235, 0.5);
  transform: translateY(-3px) !important;
}

/* ---- BACK TO TOP ---- */
#back-to-top {
  position: fixed;
  bottom: 28px;
  left: 24px;
  z-index: 900;
  width: 46px;
  height: 46px;
  background: rgba(12, 26, 58, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: white;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.2s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}
#back-to-top.visible  { opacity: 1; transform: translateY(0); }
#back-to-top:hover    { background: rgba(37, 99, 235, 0.9); }

/* ---- FOCUS VISIBLE (accessibilité clavier) ---- */
:focus-visible {
  outline: 2px solid var(--color-accent-warm);
  outline-offset: 3px;
  border-radius: 4px;
}
a:focus-visible, button:focus-visible { border-radius: 8px; }

/* ---- RIPPLE EFFET (injection JS) ---- */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transform: scale(0);
  animation: rippleAnim 0.55s linear;
  pointer-events: none;
}
@keyframes rippleAnim {
  to { transform: scale(4); opacity: 0; }
}

/* ---- FORMULAIRE : focus inputs ---- */
input:focus, textarea:focus, select:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
  border-color: var(--color-accent) !important;
}

/* ---- TOAST NOTIFICATION ---- */
#toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #0f172a;
  color: white;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  padding: 12px 22px;
  border-radius: 50px;
  border-left: 4px solid var(--color-accent-warm);
  opacity: 0;
  pointer-events: none;
  z-index: 9997;
  transition: opacity 0.3s ease, transform 0.3s ease;
  white-space: nowrap;
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- PRINT STYLES ---- */
@media print {
  #navbar, #back-to-top, .fab-cta, #scroll-progress, .hero-plane { display: none !important; }
  body { background: white; color: #000; }
  h1, h2, h3 { color: #000; }
  a { color: #000; text-decoration: underline; }
  section { break-inside: avoid; }
  .hero-overlay { display: none; }
  .hero-img { animation: none !important; }
}

/* ---- REDUCED MOTION (accessibilité) ---- */
@media (prefers-reduced-motion: reduce) {
  .hero-img         { animation: none !important; }
  .hero-plane       { animation: none !important; display: none; }
  .fade-up          { opacity: 1 !important; transform: none !important; transition: none !important; }
  .btn-primary::after { display: none; }
  #page-overlay     { transition: none !important; opacity: 0; }
  .fab-cta          { transition: none !important; }
  #back-to-top      { transition: none !important; }
  .ripple           { display: none; }
}
