/* ============================================================
   STI2000 — Styles CSS complémentaires
   Complémente Tailwind CDN avec variables, animations, customs
   ============================================================ */

/* === VARIABLES CSS === */
:root {
  --color-primary:    #38247c;
  --color-accent:     #f1cc0e;
  --color-dark:       #2a1a5e;
  --color-darker:     #1a0e3d;
  --color-light:      #f8f7ff;
  --color-text-light: #e8e0ff;
  --color-text-dark:  #1a0e3d;
  --color-border:     rgba(241, 204, 14, 0.3);

  --font-family: 'Poppins', sans-serif;

  --radius-card: 1rem;
  --radius-pill: 9999px;

  --transition-base: 0.25s ease;
  --transition-slow: 0.6s ease;

  --shadow-accent: 0 10px 40px rgba(241, 204, 14, 0.25);
  --shadow-primary: 0 10px 40px rgba(56, 36, 124, 0.2);
}

/* === RESET & BASE === */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Désactive outline sur clic souris, garde sur clavier */
:focus:not(:focus-visible) {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* === SCROLLBAR CUSTOM === */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--color-darker);
}
::-webkit-scrollbar-thumb {
  background: var(--color-primary);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-accent);
}

/* === SÉLECTION TEXTE === */
::selection {
  background: var(--color-accent);
  color: var(--color-primary);
}

/* ============================================================
   ANIMATIONS KEYFRAMES
   ============================================================ */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes underlineGrow {
  from { width: 0; }
  to   { width: 60px; }
}

@keyframes pulseSoft {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.04); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  15%       { transform: translateX(-6px); }
  30%       { transform: translateX(6px); }
  45%       { transform: translateX(-6px); }
  60%       { transform: translateX(6px); }
  75%       { transform: translateX(-4px); }
  90%       { transform: translateX(4px); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

/* ============================================================
   ANIMATION AU SCROLL (Intersection Observer)
   ============================================================ */

.animate-on-scroll {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   HEADER
   ============================================================ */

#header {
  background: rgba(56, 36, 124, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(241, 204, 14, 0.1);
}

#header.scrolled {
  background: rgba(26, 14, 61, 0.95);
  border-bottom-color: rgba(241, 204, 14, 0.2);
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.header-inner {
  transition: padding 0.3s ease;
}

/* Nav links underline au hover */
.nav-link {
  position: relative;
  padding-bottom: 2px;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  border-radius: 1px;
  transition: width 0.25s ease;
}
.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* ============================================================
   HAMBURGER MENU
   ============================================================ */

#hamburger .hamburger-line {
  transform-origin: center;
}

#hamburger.is-active .hamburger-line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
#hamburger.is-active .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
#hamburger.is-active .hamburger-line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

#mobile-menu.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* ============================================================
   SECTION TITLES — Soulignement animé
   ============================================================ */

.section-title {
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  display: block;
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 0;
  height: 4px;
  background: var(--color-accent);
  border-radius: 2px;
  transition: width 0.65s ease 0.2s;
}

/* Centré si la section a text-center */
.text-center .section-title::after {
  left: 50%;
  transform: translateX(-50%);
}

.section-title.visible::after {
  width: 60px;
}

/* ============================================================
   CARTES SERVICES
   ============================================================ */

.service-card {
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(241, 204, 14, 0.05) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: inherit;
  pointer-events: none;
}

.service-card:hover::before {
  opacity: 1;
}

/* ============================================================
   CARTES TÉLÉSECRÉTARIAT
   ============================================================ */

.secretariat-card {
  background: rgba(56, 36, 124, 0.4);
}

/* ============================================================
   FORMULAIRE CONTACT
   ============================================================ */

.form-input {
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.form-input:focus {
  border-color: var(--color-accent) !important;
  box-shadow: 0 0 0 3px rgba(241, 204, 14, 0.15);
}

.form-input.has-error {
  border-color: #f87171 !important;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.15);
}

.form-input.shake {
  animation: shake 0.5s ease;
}

/* Select arrow custom */
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23f1cc0e' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

.form-select option {
  background-color: var(--color-primary);
  color: white;
}

/* ============================================================
   HERO
   ============================================================ */

.hero-badge {
  animation: pulseSoft 3s ease-in-out infinite;
}

.hero-h1 {
  animation: fadeInUp 0.6s ease forwards;
  opacity: 0;
}

.hero-tagline {
  animation: fadeInUp 0.6s ease 0.15s both;
  opacity: 0;
}

.hero-ctas {
  animation: fadeInUp 0.6s ease 0.3s both;
  opacity: 0;
}

.hero-stats {
  animation: fadeInUp 0.6s ease 0.5s both;
  opacity: 0;
}

.hero-image-wrap {
  animation: fadeInRight 0.7s ease 0.3s both;
  opacity: 0;
}

/* ============================================================
   CHIPS PROFESSIONS — animation stagger
   ============================================================ */

.profession-chip {
  transition: background-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.profession-chip:hover {
  transform: translateY(-2px);
}

/* ============================================================
   MOCKUP AGENDA — animation float
   ============================================================ */

.hero-image-wrap img,
#agenda .w-full.max-w-md {
  animation: float 4s ease-in-out infinite;
  animation-delay: 1s;
}

/* ============================================================
   FOOTER
   ============================================================ */

footer a {
  transition: color 0.2s ease;
}

/* ============================================================
   UTILITAIRES
   ============================================================ */

/* Masque le logo-text si le SVG fallback est visible */
.logo-fallback + .logo-text {
  display: none;
}

/* Smooth scroll offset pour le header fixe */
[id] {
  scroll-margin-top: 80px;
}

/* Responsive images */
img {
  max-width: 100%;
  height: auto;
}

/* ============================================================
   MEDIA QUERIES COMPLÉMENTAIRES
   ============================================================ */

/* Mobile : désactive float animation (performance) */
@media (max-width: 640px) {
  .hero-image-wrap img,
  #agenda .w-full.max-w-md {
    animation: none;
  }

  .hero-h1 {
    font-size: clamp(2.5rem, 10vw, 4rem);
  }
}

/* Préférence réduction mouvement */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .animate-on-scroll {
    opacity: 1;
    transform: none;
  }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  #header,
  #mobile-menu,
  #hamburger {
    display: none;
  }

  body {
    background: white;
    color: black;
  }
}
