/* KEYZIT Academy — correctifs Hostinger / mobile sans modifier l'application React */
html,
body,
#root,
#app-root {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  background: #f8f9fa;
}

#app-root,
#app-root main,
#app-root nav,
#app-root section,
#app-root article,
#app-root aside,
#app-root div {
  box-sizing: border-box;
}

#app-root main > * {
  min-width: 0;
}

#app-root button,
#app-root input,
#app-root select {
  max-width: 100%;
}

/* Splash / page d'accueil immersive */
#keyzit-splash {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 18%, rgba(99, 102, 241, .42), transparent 30%),
    radial-gradient(circle at 84% 12%, rgba(236, 72, 153, .26), transparent 28%),
    linear-gradient(135deg, #080a1f 0%, #151743 45%, #4f39f6 100%);
  color: #fff;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#keyzit-splash::before,
#keyzit-splash::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  filter: blur(6px);
  opacity: .7;
  pointer-events: none;
}

#keyzit-splash::before {
  width: 420px;
  height: 420px;
  right: -160px;
  top: -130px;
  background: rgba(255,255,255,.10);
  animation: keyzitFloat 4.5s ease-in-out infinite;
}

#keyzit-splash::after {
  width: 280px;
  height: 280px;
  left: -90px;
  bottom: -90px;
  background: rgba(99,102,241,.32);
  animation: keyzitFloat 5.5s ease-in-out infinite reverse;
}

.keyzit-splash-card {
  position: relative;
  width: min(760px, 100%);
  border: 1px solid rgba(255,255,255,.20);
  border-radius: 28px;
  padding: clamp(26px, 5vw, 54px);
  background: rgba(255,255,255,.10);
  box-shadow: 0 30px 90px rgba(0,0,0,.35);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  text-align: center;
}

.keyzit-splash-k {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: #fff;
  color: #4f39f6;
  font-size: 34px;
  font-weight: 950;
  box-shadow: 0 20px 40px rgba(0,0,0,.22);
}

.keyzit-splash-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(255,255,255,.13);
  border: 1px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.78);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.keyzit-splash-title {
  margin: 18px 0 10px;
  font-size: clamp(34px, 8vw, 72px);
  line-height: .95;
  font-weight: 950;
  letter-spacing: -.055em;
  text-transform: uppercase;
}

.keyzit-splash-title span {
  display: block;
  color: #c7d2fe;
}

.keyzit-splash-text {
  width: min(560px, 100%);
  margin: 0 auto 26px;
  color: rgba(255,255,255,.80);
  font-size: clamp(14px, 3.6vw, 18px);
  line-height: 1.55;
  font-weight: 600;
}

.keyzit-splash-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 auto 26px;
  width: min(520px, 100%);
}

.keyzit-splash-stat {
  padding: 12px 8px;
  border-radius: 16px;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.14);
}

.keyzit-splash-stat strong {
  display: block;
  font-size: 18px;
  font-weight: 950;
}

.keyzit-splash-stat span {
  display: block;
  margin-top: 2px;
  color: rgba(255,255,255,.66);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.keyzit-splash-loader {
  height: 6px;
  width: min(420px, 100%);
  margin: 0 auto 18px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,.16);
}

.keyzit-splash-loader span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #fff, #c7d2fe, #f0abfc);
  animation: keyzitLoad 2s cubic-bezier(.22,1,.36,1) forwards;
}

.keyzit-splash-enter {
  appearance: none;
  border: 0;
  padding: 12px 20px;
  border-radius: 999px;
  background: #fff;
  color: #312e81;
  font-weight: 950;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 16px 36px rgba(0,0,0,.22);
}

#keyzit-splash.keyzit-splash-hide {
  pointer-events: none;
  animation: keyzitSplashOut .75s ease forwards;
}

@keyframes keyzitLoad {
  to { width: 100%; }
}

@keyframes keyzitFloat {
  0%, 100% { transform: translate3d(0,0,0) scale(1); }
  50% { transform: translate3d(0,22px,0) scale(1.05); }
}

@keyframes keyzitSplashOut {
  to { opacity: 0; transform: scale(1.025); visibility: hidden; }
}

/* Mobile : suppression du débordement horizontal et header adapté */
@media (max-width: 767px) {
  html,
  body {
    position: relative;
    width: 100%;
    overflow-x: hidden !important;
  }

  #app-root {
    overflow-x: clip !important;
  }

  #navbar {
    height: auto !important;
    min-height: 96px !important;
    width: 100% !important;
    max-width: 100vw !important;
    padding: 10px 14px !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 8px !important;
  }

  #navbar > div:first-child {
    width: 100% !important;
    min-width: 0 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 8px !important;
    padding-right: 0 !important;
  }

  #navbar > div:first-child > div:first-child {
    min-width: 0 !important;
    width: 100% !important;
    gap: 8px !important;
    padding-right: 118px !important;
  }

  #navbar > div:first-child > div:first-child > div {
    width: 36px !important;
    height: 36px !important;
    flex: 0 0 36px !important;
    border-radius: 12px !important;
  }

  #navbar > div:first-child > div:first-child span:last-child {
    display: block !important;
    min-width: 0 !important;
    max-width: calc(100vw - 190px) !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    font-size: 18px !important;
    line-height: 1.05 !important;
    letter-spacing: -.045em !important;
  }

  #navbar > div:first-child > div:nth-child(2) {
    display: none !important;
  }

  #navbar > div:first-child > div:nth-child(3) {
    order: 5 !important;
    width: calc(100vw - 28px) !important;
    max-width: calc(100vw - 28px) !important;
    margin-top: 6px !important;
    margin-left: 0 !important;
    padding: 2px 0 4px !important;
    display: flex !important;
    gap: 6px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
  }

  #navbar > div:first-child > div:nth-child(3)::-webkit-scrollbar {
    display: none;
  }

  #navbar > div:first-child > div:nth-child(3) button {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
    font-size: 11px !important;
    line-height: 1.1 !important;
    padding: 10px 12px !important;
    border-radius: 13px !important;
  }

  #navbar > div:last-child {
    position: absolute !important;
    top: 10px !important;
    right: 14px !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    max-width: 116px !important;
  }

  #navbar > div:last-child > div:first-child {
    transform: scale(.94) !important;
    transform-origin: right center !important;
  }

  #navbar > div:last-child > div:last-child {
    width: 34px !important;
    height: 34px !important;
    flex: 0 0 34px !important;
    font-size: 11px !important;
  }

  #app-root main {
    width: 100% !important;
    max-width: 100vw !important;
    padding: 16px !important;
    gap: 16px !important;
    overflow-x: hidden !important;
  }

  #app-root main > div,
  #app-root main > div > div,
  #app-root main .w-full,
  #app-root main .flex-grow {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  #app-root .rounded-2xl,
  #app-root .rounded-xl {
    max-width: 100% !important;
  }

  #app-root .grid {
    min-width: 0 !important;
  }

  #app-root input[type="text"],
  #app-root input[type="search"] {
    width: 100% !important;
  }

  .keyzit-splash-card {
    border-radius: 24px;
    padding: 28px 20px;
  }

  .keyzit-splash-stats {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .keyzit-splash-stat {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 14px;
    text-align: left;
  }

  .keyzit-splash-stat span {
    text-align: right;
  }
}

@media (max-width: 380px) {
  #navbar > div:first-child > div:first-child {
    padding-right: 104px !important;
  }

  #navbar > div:first-child > div:first-child span:last-child {
    font-size: 16px !important;
    max-width: calc(100vw - 176px) !important;
  }

  #navbar > div:last-child {
    right: 10px !important;
    max-width: 104px !important;
    gap: 4px !important;
  }

  #navbar > div:last-child > div:first-child button {
    padding-left: 6px !important;
    padding-right: 6px !important;
  }
}
