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

html, body {
  height: 100%;
  font-family: "Inter", "Roboto Condensed", sans-serif;
  background: linear-gradient(135deg, #0f1419 0%, #1a2332 100%);
  color: #e5e8ec;
  overflow-x: hidden;
  position: relative;
  letter-spacing: 0.02em;
  transition: background 0.3s ease;
}

body.index-page {
  background: #151d2a;
}

/* Pages avec dégradés personnalisés */
body.bdd-page {
  background: linear-gradient(135deg, #0f1419 0%, #1a2f3f 50%, #0d3a4a 100%);
}

body.joueur-page {
  background: linear-gradient(135deg, #0f1419 0%, #1f3a2f 50%, #1a2a3a 100%);
}

body.main-panel-page {
  background: linear-gradient(135deg, #0f1419 0%, #2a1f3a 50%, #1a1f3a 100%);
}

body.logs-page {
  background: linear-gradient(135deg, #0f1419 0%, #2f1a0f 50%, #3a2a0d 100%);
}

body.securite-page {
  background: linear-gradient(135deg, #0f1419 0%, #3a1f1f 50%, #2a1f1f 100%);
}

body.utilisateurs-page {
  background: linear-gradient(135deg, #0f1419 0%, #1f2f3f 50%, #1a3a4a 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  background: radial-gradient(ellipse at 50% 60%, rgba(0,0,0,0.15) 40%, rgba(0,0,0,0.35) 100%);
  mix-blend-mode: multiply;
  box-shadow: inset 0 0 40px rgba(0,0,0,0.1), inset 0 0 15px rgba(75,141,255,0.05);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1001;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,0.015) 0px, rgba(255,255,255,0.015) 1px, transparent 1px, transparent 3px);
  opacity: 0.15;
  mix-blend-mode: overlay;
}

/* Désactiver les effets sombres sur les pages principales */
main::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  background: none;
}

main body::before {
  background: none !important;
  box-shadow: none !important;
}

/* Effet bruit caméra + HUD */
.camera-noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 1002;
  opacity: 0.06;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="120" height="120" viewBox="0 0 120 120"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.7" numOctaves="3" stitchTiles="stitch"/></filter><rect width="120" height="120" filter="url(%23noise)" opacity="0.4"/></svg>');
  background-size: 340px 340px;
  animation: noiseMove 2.5s steps(1) infinite;
}

/* Modal backdrop: remove page-red tint by using a darker neutral overlay */
.modal, .modal-backdrop, [id^="modal"] {
  background: rgba(0,0,0,0.92) !important;
  backdrop-filter: blur(6px) !important;
  z-index: 2147483646 !important; /* ensure above page overlays */
}

/* When modal is active, visually mute the page decorative gradients to avoid colored bleed */
body.modal-open::before,
body.modal-open::after {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Utility: script can add body.modal-open when opening modals */

@keyframes noiseMove {
  0% { background-position: 0 0; }
  100% { background-position: 120px 120px; }
}

/* Animations du menu profil */
@keyframes dropdownSlideIn {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes dropdownSlideOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-12px) scale(0.92);
  }
}

/* Cadre HUD caméra de surveillance */
.hud-frame::before,
.hud-frame::after {
  content: "";
  position: fixed;
  background: linear-gradient(90deg, rgba(76,175,80,0.15) 0%, transparent 35%, transparent 65%, rgba(76,175,80,0.15) 100%);
  z-index: 999;
  pointer-events: none;
  transition: box-shadow 0.4s ease;
}

.hud-frame::before {
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  box-shadow: 0 0 12px rgba(76,175,80,0.25);
}

.hud-frame::after {
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  box-shadow: 0 0 12px rgba(76,175,80,0.25);
}

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

/* ---------- EN-TÊTE ---------- */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 70px;
  background: linear-gradient(180deg, rgba(15,20,25,0.95) 0%, rgba(10,15,26,0.92) 100%);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  z-index: 50;
  box-shadow: 0 2px 20px rgba(0,0,0,0.7), inset 0 1px 0 rgba(75,141,255,0.2);
  border-bottom: 1px solid rgba(75,141,255,0.25);
  gap: 20px;
}

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

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

header .site-title {
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #4b8dff;
  text-shadow: 0 0 10px rgba(75,141,255,0.5), 0 0 20px rgba(75,141,255,0.3);
  font-family: "Inter", sans-serif;
}

#profileContainer {
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
  cursor: pointer !important;
  position: relative !important;
  z-index: 51 !important;
  margin-left: auto !important;
  background: linear-gradient(135deg, rgba(75, 141, 255, 0.65) 0%, rgba(60, 115, 240, 0.55) 100%) !important;
  padding: 10px 18px !important;
  border-radius: 16px !important;
  border: 1.5px solid rgba(75, 141, 255, 0.6) !important;
  transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
  flex-shrink: 0 !important;
  order: 9999 !important;
  box-shadow: 0 6px 25px rgba(75, 141, 255, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
  font-family: "Inter", "Roboto Condensed", sans-serif !important;
}

#profileContainer:hover {
  background: linear-gradient(135deg, rgba(75, 141, 255, 0.85) 0%, rgba(60, 115, 240, 0.75) 100%) !important;
  border-color: rgba(75, 141, 255, 1) !important;
  box-shadow: 0 10px 35px rgba(75, 141, 255, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
  transform: translateY(-2px) !important;
}

#profileContainer:active {
  transform: translateY(0) !important;
  box-shadow: 0 4px 15px rgba(75, 141, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
}

#authWrap {
  display: flex !important;
  align-items: center !important;
  margin-left: auto !important;
  gap: 12px !important;
}

#profileContainer img {
  width: 40px !important;
  height: 40px !important;
  border-radius: 12px !important;
  object-fit: cover !important;
  border: 2px solid rgba(255, 255, 255, 0.2) !important;
  flex-shrink: 0;
  transition: all 0.35s ease !important;
}

#profileContainer:hover img {
  border-color: rgba(255, 255, 255, 0.4) !important;
  transform: scale(1.05) !important;
}

#profileContainer span {
  color: #ffffff !important;
  font-weight: 600 !important;
  font-size: 0.95rem !important;
  white-space: nowrap;
  font-family: "Inter", "Roboto Condensed", sans-serif !important;
  letter-spacing: 0.015em !important;
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 10px) !important;
  right: 0 !important;
  background: linear-gradient(135deg, #1a2332 0%, #222a3a 100%) !important;
  border-radius: 14px !important;
  min-width: 210px;
  border: 1px solid rgba(75, 141, 255, 0.3) !important;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(75, 141, 255, 0.2) !important;
  z-index: 200;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-10px) scale(0.95);
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.profile-dropdown.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.profile-dropdown a {
  display: block;
  padding: 12px 16px;
  color: #e5e8ec;
  text-decoration: none;
  font-family: "Inter", "Roboto Condensed", sans-serif;
  font-size: 0.95rem;
  transition: all 0.22s ease;
  border-left: 3px solid transparent;
  letter-spacing: 0.01em;
}

.profile-dropdown a:hover {
  background: rgba(75, 141, 255, 0.15) !important;
  color: #ffffff;
  border-left-color: rgba(75, 141, 255, 0.8);
  padding-left: 18px;
}

.profile-dropdown hr {
  margin: 8px 0 !important;
  border: none !important;
  border-top: 1px solid rgba(75, 141, 255, 0.2) !important;
}

.profile-dropdown #logoutBtn {
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: none;
  border-top: 1px solid rgba(75, 141, 255, 0.15);
  color: #ff6b6b;
  cursor: pointer;
  text-align: left;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: "Inter", "Roboto Condensed", sans-serif;
  transition: all 0.22s ease;
  letter-spacing: 0.01em;
}

.profile-dropdown #logoutBtn:hover {
  background: rgba(255, 107, 107, 0.1);
  color: #ff8080;
}

header .connexion-btn {
  margin-left: auto;
  background: linear-gradient(135deg, #4b8dff 0%, #3c73f0 100%);
  border: 1.5px solid rgba(75, 141, 255, 0.8);
  color: white;
  padding: 8px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(75, 141, 255, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

header .connexion-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}

header .connexion-btn:hover {
  background: linear-gradient(135deg, #6aa3ff 0%, #5a93ff 100%);
  box-shadow: 0 8px 25px rgba(75,141,255,0.6);
  border-color: rgba(75, 141, 255, 1);
  transform: translateY(-2px);
}

header .connexion-btn:hover::before {
  transform: translateX(100%);
}

header .connexion-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(75,141,255,0.4);
}

#authWrap {
  display: flex !important;
  align-items: center !important;
  margin-left: auto !important;
  gap: 12px !important;
  order: 9999 !important;
}

#authWrap #profileContainer {
  margin-left: 0 !important;
}

header .admin-menu {
  margin: 0 auto !important;
  flex: 1 !important;
  justify-content: center !important;
  display: flex !important;
  align-items: center !important;
  gap: 20px !important;
}


/* ---------- 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: 92%;
  max-width: 1350px;
  gap: 70px;
}

.hero-left {
  flex: 1;
}

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

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

.hero-desc {
  font-size: 1.15rem;
  line-height: 1.6;
  color: #c7cbd3;
  margin-bottom: 30px;
  max-width: 550px;
}

/* ---------- ANIMATION TEXTE (entrée depuis le bas + fondu) ---------- */
@keyframes text-up-fade {
  0% {
    transform: translateY(22px);
    opacity: 0;
    filter: blur(4px);
  }
  60% {
    opacity: 1;
    filter: blur(0.5px);
  }
  100% {
    transform: translateY(0);
    opacity: 1;
    filter: blur(0);
  }
}

@keyframes modalAppear {
  0% {
    transform: scale(0.8) translateY(50px);
    opacity: 0;
    filter: blur(6px);
  }
  70% {
    filter: blur(0.5px);
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
    filter: blur(0);
  }
}

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

.anim-text-animate {
  animation-name: text-up-fade;
  animation-duration: 2.1s;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
  animation-fill-mode: both;
  will-change: opacity, transform, filter;
}

/* 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;
  flex-wrap: wrap;
  align-items: center;
}

.primary-cta, .secondary-cta, .discord-cta {
  border: none;
  border-radius: 10px;
  padding: 14px 26px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
  font-size: 1.05rem;
  text-decoration: none;
  min-width: 0;
}

.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;
}

.discord-cta {
  background: #5865F2;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 0px;
  width: auto;
  min-width: 410px;
}

.discord-cta:hover {
  background: #4752C4;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(88, 101, 242, 0.4);
}

.discord-logo {
  height: 20px;
  width: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

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

.hero-illustration {
  width: 90%;
  max-width: 420px;
  border-radius: 20px;
  background: radial-gradient(circle at 50% 40%, #2e3850, #1f2738);
  padding: 25px;
  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);
  z-index: 100;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  backdrop-filter: blur(0px);
}

.modal-backdrop[aria-hidden="false"] {
  display: flex;
  opacity: 1;
  backdrop-filter: blur(8px);
}

.modal {
  background: linear-gradient(135deg, #222a3a 0%, #2a3145 100%);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7), 0 0 40px rgba(75,141,255,0.15);
  position: relative;
  border: 1px solid rgba(75,141,255,0.2);
  transform: scale(0.8) translateY(50px);
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 85vh;
  overflow-y: auto;
  font-family: "Inter", sans-serif;
}

.modal form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.modal-backdrop[aria-hidden="false"] .modal {
  transform: scale(1) translateY(0);
  opacity: 1;
  animation: modalAppear 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal h2 {
  margin-bottom: 30px;
  font-size: 1.5rem;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(135deg, #4b8dff, #6aa3ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.02em;
  font-family: "Inter", sans-serif;
}

.modal label {
  display: block;
  margin-bottom: 10px;
  color: #d4d9e2;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: color 0.2s ease;
  font-family: "Inter", sans-serif;
  text-align: left;
}

.modal label:hover {
  color: #e5e8ec;
}

#twoFactorLabel {
  margin-bottom: 10px !important;
}

.modal label.stay-logged {
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: none;
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.modal label.stay-logged input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #4b8dff;
}

.modal input[type="text"],
.modal input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  background: rgba(28, 36, 51, 0.8);
  border: 1.5px solid rgba(75,141,255,0.3);
  border-radius: 10px;
  color: #e2e7f0;
  font-size: 1rem;
  transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  margin-bottom: 12px;
  font-family: "Inter", sans-serif;
}

#login2FA {
  margin-bottom: 12px !important;
  letter-spacing: 0.15em;
  text-align: center;
  font-weight: 700;
  font-size: 1.05rem;
  font-family: "Courier New", monospace;
}

.modal input[type="text"]:focus,
.modal input[type="password"]:focus {
  outline: none;
  background: rgba(28, 36, 51, 1);
  border-color: rgba(75,141,255,0.7);
  box-shadow: 0 0 0 3px rgba(75,141,255,0.1);
}

.modal input[type="text"]::placeholder,
.modal input[type="password"]::placeholder {
  color: #7a8499;
}

.password-field {
  position: relative;
  margin-bottom: 12px;
}

.password-field .pw-toggle {
  position: absolute;
  top: 37%;
  right: 12px;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #7a8499;
  transition: all 0.2s ease;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.password-field .pw-toggle:hover {
  color: #4b8dff;
  transform: translateY(-50%) scale(1.1);
}

.modal-actions {
  margin-top: 20px;
  display: flex;
  gap: 12px;
}

.connexion-submit {
  flex: 1;
  background: linear-gradient(135deg, #4b8dff 0%, #3c73f0 100%);
  border: 1.5px solid rgba(75,141,255,0.8);
  border-radius: 10px;
  padding: 12px 20px;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(75, 141, 255, 0.3);
  font-family: "Inter", sans-serif;
}

.connexion-submit::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}

.connexion-submit:hover {
  background: linear-gradient(135deg, #6aa3ff 0%, #5a93ff 100%);
  box-shadow: 0 8px 25px rgba(75,141,255,0.6);
  border-color: rgba(75,141,255,1);
  transform: translateY(-2px);
}

.connexion-submit:hover::before {
  transform: translateX(100%);
}

.connexion-submit:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(75,141,255,0.4);
}

.connexion-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(75,141,255,0.1);
  border: none;
  color: #8ba3ff;
  font-size: 24px;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 0;
  line-height: 1;
}

.modal-close:hover {
  background: rgba(75,141,255,0.2);
  color: #4b8dff;
  transform: rotate(90deg);
}

/* ---------- 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, #0d1117, #141b25);
  filter: blur(0.5px) brightness(0.8) contrast(1.1) saturate(0.7);
  opacity: 0.7;
  transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), filter 0.8s ease;
  will-change: opacity;
}

/* Masquer le fond animé sur securite.html */
body.securite-page canvas.animated-bg {
  display: none;
}

/* ---------- 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;
}

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

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

  header {
    padding: 0 20px;
  }
}
