/* ─── RESET & BASE ─────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --gov-blue: #0a3d6b;
  --gov-blue-mid: #1565a8;
  --gov-blue-light: #1e88e5;
  --gov-green: #1b6e3c;
  --gov-green-mid: #2e7d52;
  --gold: #c8960c;
  --gold-light: #f0b429;
  --white: #ffffff;
  --off-white: #f0f4f8;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "Outfit", sans-serif;
}

/* ─── FOND ANIMÉ ────────────────────────────────────────── */
body {
  background: linear-gradient(
    135deg,
    var(--gov-blue) 0%,
    #0d2d52 40%,
    var(--gov-green) 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Particules géométriques de fond */
.bg-shapes {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.06;
  animation: floatShape linear infinite;
}
.shape:nth-child(1) {
  width: 380px;
  height: 380px;
  background: var(--gov-blue-light);
  top: -80px;
  left: -100px;
  animation-duration: 18s;
}
.shape:nth-child(2) {
  width: 250px;
  height: 250px;
  background: var(--gold);
  bottom: 10%;
  right: -60px;
  animation-duration: 22s;
  animation-delay: -6s;
}
.shape:nth-child(3) {
  width: 160px;
  height: 160px;
  background: var(--gov-green-mid);
  top: 60%;
  left: 15%;
  animation-duration: 14s;
  animation-delay: -3s;
}
.shape:nth-child(4) {
  width: 100px;
  height: 100px;
  background: var(--white);
  top: 20%;
  right: 25%;
  animation-duration: 20s;
  animation-delay: -10s;
}

/* Grille de points */
.dot-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.08) 1px,
    transparent 1px
  );
  background-size: 36px 36px;
  pointer-events: none;
}

@keyframes floatShape {
  0% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-30px) rotate(180deg);
  }
  100% {
    transform: translateY(0px) rotate(360deg);
  }
}

/* ─── CONTENEUR SPLASH ──────────────────────────────────── */
.splash {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  text-align: center;
  padding: 0 24px;
}

/* ─── LOGO WRAPPER ──────────────────────────────────────── */
.logo-wrapper {
  position: relative;
  width: 160px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Halo pulsant derrière le logo */
.logo-halo {
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.15) 0%,
    transparent 70%
  );
  animation: halo 2.8s ease-in-out infinite;
}
@keyframes halo {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.15);
    opacity: 1;
  }
}

/* Anneau tournant */
.logo-ring {
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--gold-light);
  border-right-color: rgba(240, 180, 41, 0.3);
  animation: spin 2.2s linear infinite;
}
.logo-ring-2 {
  position: absolute;
  inset: -22px;
  border-radius: 50%;
  border: 1px solid transparent;
  border-bottom-color: rgba(255, 255, 255, 0.25);
  border-left-color: rgba(255, 255, 255, 0.1);
  animation: spin 3.5s linear infinite reverse;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Fond cercle du logo */
.logo-circle {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  animation: logoReveal 1s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes logoReveal {
  from {
    transform: scale(0.4) rotate(-15deg);
    opacity: 0;
  }
  to {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

.logo-img {
  width: 88px;
  height: 88px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
  animation: logoBounce 3s ease-in-out 1s infinite;
}
@keyframes logoBounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

/* ─── TEXTE ─────────────────────────────────────────────── */
.app-name {
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.02em;
  line-height: 1;
  animation: fadeUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.5s both;
}
.app-name span {
  color: var(--gold-light);
}

.app-subtitle {
  font-size: 0.95rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.65);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  animation: fadeUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.7s both;
}

.app-org {
  font-family: "Smooch Sans", sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.5);
  animation: fadeUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.9s both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── BARRE DE CHARGEMENT ───────────────────────────────── */
.loader-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 220px;
  animation: fadeUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) 1.1s both;
}
.loader-label {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
}
.loader-track {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 99px;
  overflow: hidden;
}
.loader-bar {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  box-shadow: 0 0 12px rgba(240, 180, 41, 0.6);
  animation: loadProgress 2.8s cubic-bezier(0.4, 0, 0.2, 1) 1.2s forwards;
}
@keyframes loadProgress {
  0% {
    width: 0%;
  }
  60% {
    width: 75%;
  }
  85% {
    width: 90%;
  }
  100% {
    width: 100%;
  }
}

/* ─── SÉPARATEUR DÉCORATIF ──────────────────────────────── */
.deco-line {
  display: flex;
  align-items: center;
  gap: 12px;
  animation: fadeUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.8s both;
}
.deco-line::before,
.deco-line::after {
  content: "";
  flex: 1;
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25));
}
.deco-line::after {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.25), transparent);
}
.deco-diamond {
  width: 6px;
  height: 6px;
  background: var(--gold-light);
  transform: rotate(45deg);
  opacity: 0.8;
}

/* ─── TRANSITION DE SORTIE ──────────────────────────────── */
.page-transition {
  position: fixed;
  inset: 0;
  background: var(--gov-blue);
  z-index: 9999;
  transform: scaleY(0);
  transform-origin: bottom;
  pointer-events: none;
}
.page-transition.exit {
  animation: curtainUp 0.6s cubic-bezier(0.76, 0, 0.24, 1) forwards;
}
@keyframes curtainUp {
  0% {
    transform: scaleY(0);
    transform-origin: bottom;
  }
  50% {
    transform: scaleY(1);
    transform-origin: bottom;
  }
  51% {
    transform-origin: top;
  }
  100% {
    transform: scaleY(0);
    transform-origin: top;
  }
}

/* ─── BADGE VERSION ─────────────────────────────────────── */
.version-badge {
  position: fixed;
  bottom: 20px;
  right: 20px;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.25);
  letter-spacing: 0.08em;
  animation: fadeUp 1s ease 2s both;
}
