/* ---------- RESET ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: "Inter", "Roboto Condensed", sans-serif;
  background: transparent;
  color: #e5e8ec;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ---------- EN-TÊTE ---------- */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 70px;
  background: rgba(25, 30, 45, 0.85);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  z-index: 50;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

header .logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

header .logo img {
  height: 42px;
  width: auto;
}

header .site-title {
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #d0d6e0;
}

/* Admin nav in header (buttons that take available space) */
.admin-nav {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-left: 18px;
  margin-right: 18px;
  /* allow nav to expand between logo and authWrap */
  flex: 1 1 auto;
}
.admin-nav .admin-link-btn {
  flex: 1 1 0;
  background: transparent;
  color: #cfd4df;
  border: 1px solid rgba(255,255,255,0.04);
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background 0.12s, color 0.12s, transform 0.06s;
}
.admin-nav .admin-link-btn:hover {
  background: rgba(0, 100, 255, 0.1);
  color: #6aa3ff;
  box-shadow: 0 4px 15px rgba(75, 141, 255, 0.3);
}
.admin-nav .admin-link-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(75, 141, 255, 0.5);
  background: rgba(0, 100, 255, 0.2);
}

header .connexion-btn {
  background: #3c73f0;
  color: #fff;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  cursor: pointer;
  transition: background 0.2s;
}

header .connexion-btn:hover {
  background: #5b8eff;
}

header:hover {
  background: rgba(25, 30, 45, 0.9);
  box-shadow: 0 2px 20px rgba(0, 100, 255, 0.2);
}

/* User menu in header */
#authWrap { position: relative; }
.user-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.06);
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  gap: 8px;
  align-items: center;
}
.user-dropdown {
  position: absolute;
  right: 0;
  top: 46px;
  background: #222a3a;
  border-radius: 10px;
  padding: 8px 10px;
  min-width: 180px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
  display: none;
  flex-direction: column;
  gap: 6px;
  z-index: 200;
}
.user-dropdown.visible { display: flex; }
.user-dropdown button { background: transparent; border: none; color: #e5e8ec; padding: 8px; text-align: left; cursor: pointer; border-radius:6px }
.user-dropdown button:hover { background: rgba(255,255,255,0.03) }
/* Danger / destructive button in dropdown */
.user-dropdown button.danger { color: #ff5c72; font-weight: 700; }
.user-dropdown button.danger:hover { background: rgba(255,87,114,0.08); }

/* Avatar inside user button */
.user-btn .user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg,#5b8eff,#3c73f0);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: 0 2px 6px rgba(60,115,240,0.18);
  animation: avatarGlow 2s ease-in-out infinite;
}

/* ---------- HEADER ANIMATIONS ---------- */
@keyframes avatarGlow {
  0%, 100% {
    box-shadow: 0 2px 6px rgba(60,115,240,0.18);
  }
  50% {
    box-shadow: 0 4px 12px rgba(60,115,240,0.4);
  }
}

/* ---------- SECTION HERO ---------- */
.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding-top: 70px; /* espace pour header */
  position: relative;
  z-index: 1;
}

.hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 90%;
  max-width: 1100px;
  gap: 50px;
}

.hero-left {
  flex: 1;
}

.eyebrow {
  text-transform: uppercase;
  color: #b0b6c3;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.hero-title {
  font-size: 2.8rem;
  line-height: 1.2;
  font-weight: 700;
  color: #fff;
  margin-bottom: 15px;
}

.hero-desc {
  font-size: 1.05rem;
  line-height: 1.5;
  color: #c7cbd3;
  margin-bottom: 25px;
  max-width: 500px;
}

/* ---------- ANIMATION TEXTE (entrée depuis le bas + fondu) ---------- */
@keyframes text-up-fade {
  from {
    transform: translateY(18px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.anim-text-hidden {
  opacity: 0;
  transform: translateY(12px);
}

.anim-text-animate {
  animation-name: text-up-fade;
  animation-duration: 1.4s; /* between 1 and 2s as requested */
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-fill-mode: both;
}

/* Stagger utilities */
.delay-0 { animation-delay: 0.05s; }
.delay-1 { animation-delay: 0.3s; }
.delay-2 { animation-delay: 0.6s; }
.delay-3 { animation-delay: 0.95s; }

.hero-ctas {
  display: flex;
  gap: 15px;
}

.primary-cta, .secondary-cta {
  border: none;
  border-radius: 10px;
  padding: 12px 22px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
}

.primary-cta {
  background: #4b8dff;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.primary-cta:hover {
  background: #6aa3ff;
}

.secondary-cta {
  background: transparent;
  border: 1.5px solid #5f6d89;
  color: #d4d9e2;
}

.secondary-cta:hover {
  border-color: #8ba3ff;
  color: #fff;
}

.hero-right {
  flex: 1;
  display: flex;
  justify-content: center;
}

.hero-illustration {
  width: 80%;
  max-width: 350px;
  border-radius: 20px;
  background: radial-gradient(circle at 50% 40%, #2e3850, #1f2738);
  padding: 20px;
  box-shadow: 0 15px 40px rgba(0,0,0,0.4);
}

/* ---------- MODAL ---------- */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  animation: modalFadeIn 0.3s ease-out;
}

.modal-backdrop[aria-hidden="false"] {
  display: flex;
}

.modal {
  background: #222a3a;
  border-radius: 16px;
  padding: 30px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  position: relative;
  animation: modalSlideIn 0.4s ease-out;
}

.modal h2 {
  margin-bottom: 20px;
  font-size: 1.4rem;
  color: #fff;
}

.modal label {
  display: block;
  margin-bottom: 15px;
  color: #cfd4df;
  font-size: 0.9rem;
}

.modal input[type="text"],
.modal input[type="password"] {
  width: 100%;
  padding: 10px;
  background: #1c2433;
  border: 1px solid #39435a;
  border-radius: 8px;
  color: #e2e7f0;
}

/* custom checkbox for "Rester connecté" */
.checkbox-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  color: #cfd4df;
}
.checkbox-field input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid #39435a;
  border-radius: 5px;
  background: #1c2433;
  display: inline-block;
  position: relative;
  transition: background 0.18s, border-color 0.18s, transform 0.12s;
}
.checkbox-field input[type="checkbox"]::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 6px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transform-origin: center;
  transition: transform 0.18s cubic-bezier(0.2,0.8,0.2,1);
}
.checkbox-field input[type="checkbox"]:checked {
  background: linear-gradient(180deg,#3c73f0,#2c5ce0);
  border-color: #3c73f0;
}
.checkbox-field input[type="checkbox"]:checked::after {
  transform: rotate(45deg) scale(1);
}

.password-field {
  position: relative;
}

.password-field .pw-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #9aa4b9;
}

.modal-actions {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
}

.connexion-submit {
  background: #4b8dff;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.connexion-submit:hover {
  background: #6aa3ff;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  color: #aaa;
  font-size: 20px;
  cursor: pointer;
}

/* ---------- PARALLAX BACKGROUND (INDEX) ---------- */
.parallax-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  z-index: -1;
  background: #0a0f1a;
}

.parallax-img {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 105%;
  min-height: 105%;
  width: auto;
  height: auto;
  object-fit: cover;
  transform: translate(-50%, -50%) scale(1.04);
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
  will-change: transform, opacity;
}

.parallax-img.active {
  opacity: 1;
}

/* ---------- ANIMATION DU FOND ---------- */
canvas.animated-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  min-width: 100vw;
  min-height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  display: block;
  pointer-events: none;
  z-index: 0;
  background: linear-gradient(120deg, #2c3a55, #4a79c9);
}

/* ---------- SHAKE ANIMATION ---------- */
@keyframes shake {
	0% { transform: translateX(0); }
	20% { transform: translateX(-10px); }
	40% { transform: translateX(10px); }
	60% { transform: translateX(-10px); }
	80% { transform: translateX(10px); }
	100% { transform: translateX(0); }
}

.shake {
	animation: shake 0.5s;
}

/* ---------- MODAL ANIMATIONS ---------- */
@keyframes modalFadeIn {
  from { opacity: 0; backdrop-filter: blur(0px); }
  to { opacity: 1; backdrop-filter: blur(8px); }
}

@keyframes modalSlideIn {
  from { transform: translateY(-20px) scale(0.95); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 800px) {
  .hero-inner {
    flex-direction: column;
    text-align: center;
  }

  .hero-right {
    order: -1;
    margin-bottom: 30px;
  }

  header {
    padding: 0 20px;
  }
}

/* Banner to indicate page is under development */
.dev-banner {
  position: fixed;
  top: 66px; /* a bit above to sit nicely under header (header height = 70px) */
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  max-width: calc(100% - 40px);
  display: flex;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 12px;
  backdrop-filter: blur(6px) saturate(1.05);
  -webkit-backdrop-filter: blur(6px) saturate(1.05);
  background: linear-gradient(90deg, rgba(255,179,71,0.98), rgba(255,204,51,0.98));
  color: #111;
  box-shadow: 0 8px 30px rgba(14,18,28,0.45);
  border: 1px solid rgba(255,255,255,0.12);
  font-weight: 700;
  font-size: 0.95rem;
  align-items: center;
  animation: devBannerIn 360ms cubic-bezier(.2,.9,.3,1);
}

.dev-banner-inner {
  display: inline-flex;
  gap: 10px;
  align-items: center;
}

.dev-icon { flex: 0 0 auto; }
.dev-text { text-align: left; line-height: 1; color: #111; }
.dev-title { font-weight: 800; font-size: 0.98rem; }
.dev-sub { font-weight: 600; font-size: 0.78rem; opacity: 0.86; color: rgba(17,17,17,0.9); }

@keyframes devBannerIn {
  from { transform: translateX(-50%) translateY(-6px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

@media (max-width: 800px) {
  .dev-banner { top: 64px; padding: 6px 8px; }
  .dev-title { font-size: 0.92rem; }
  .dev-sub { display: none; }
}

@media (max-width: 480px) {
  .dev-banner { max-width: calc(100% - 24px); font-size: 0.86rem; }
}

/* ---------- LOADING ANIMATION ---------- */
.loader {
  width: 5em;
  height: 5em;
  background: linear-gradient(-45deg, #5b8eff 0%, #3c73f0 100%);
  animation: spin 3s infinite;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
}

.loader::before {
  content: "";
  z-index: -1;
  position: absolute;
  inset: 0;
  background: linear-gradient(-45deg, #5b8eff 0%, #3c73f0 100%);
  transform: translate3d(0, 0, 0) scale(0.95);
  filter: blur(20px);
}

@keyframes spin {
  0% {
    transform: translate(-50%, -50%) rotate(-45deg);
  }

  50% {
    transform: translate(-50%, -50%) rotate(-360deg);
    border-radius: 50%;
  }

  100% {
    transform: translate(-50%, -50%) rotate(-45deg);
  }
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
}
