body {
  background: #0d0d0d;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  margin: 0;
  padding: 0;
}

.glitch-input-wrapper {
  --bg-color: #0d0d0d;
  --primary-color: #007df2;
  --secondary-color: #a855f7;
  --text-color: #e5e5e5;
  --font-family: "Fira Code", Consolas, "Courier New", Courier, monospace;
  --glitch-anim-duration: 0.4s;

  display: flex;
  justify-content: center;
  align-items: center;
  font-family: var(--font-family);
  font-size: 16px;
  padding: 3rem;
}

/* --- Container  --- */
.input-container {
  position: relative;
  width: 19rem;
}

/* --- Input --- */
.holo-input {
  width: 100%;
  height: 3.5rem;
  background: rgba(13, 13, 13, 0.7);
  border: none;
  border-bottom: 2px solid #333;
  outline: none;
  padding: 0 1rem;
  color: var(--primary-color);
  font-family: inherit;
  font-size: 1.1rem;
  caret-color: var(--primary-color);
  z-index: 10;
  transition:
    background 0.3s ease,
    border-color 0.3s ease;
}

/* --- Floating Label --- */
.input-label {
  position: absolute;
  top: 1rem;
  left: 1rem;
  color: var(--text-color);
  opacity: 0.6;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 11;
}

.holo-input:focus+.input-label,
.holo-input:not(:placeholder-shown)+.input-label {
  top: -1.5rem;
  left: 0;
  font-size: 0.8rem;
  opacity: 1;
  color: var(--primary-color);
}

.holo-input:focus+.input-label::before,
.holo-input:focus+.input-label::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #212121;
}

.holo-input:focus+.input-label::before {
  color: var(--secondary-color);
  animation: glitch-label var(--glitch-anim-duration) cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.holo-input:focus+.input-label::after {
  color: var(--primary-color);
  animation: glitch-label var(--glitch-anim-duration) cubic-bezier(0.25, 0.46, 0.45, 0.94) reverse both;
}

/* --- Decorative Layers --- */
.input-border,
.input-scanline,
.input-glow,
.input-corners {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.input-border {
  border: 1px solid rgba(0, 85, 242, 0.2);
  opacity: 0.5;
  transition: all 0.3s ease;
}

.corner {
  position: absolute;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--primary-color);
  transition: all 0.3s ease;
  opacity: 0.5;
}

.corner-tl {
  top: -0.3rem;
  left: -0.3rem;
  border-right: none;
  border-bottom: none;
}

.corner-tr {
  top: -0.3rem;
  right: -0.3rem;
  border-left: none;
  border-bottom: none;
}

.corner-bl {
  bottom: -0.3rem;
  left: -0.3rem;
  border-right: none;
  border-top: none;
}

.corner-br {
  bottom: -0.3rem;
  right: -0.3rem;
  border-left: none;
  border-top: none;
}

.input-glow {
  background: radial-gradient(ellipse at center,
      rgba(0, 105, 242, 0.2) 0%,
      transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.input-scanline {
  height: 100%;
  background: linear-gradient(to bottom,
      transparent 0%,
      rgba(0, 85, 242, 0.1) 48%,
      rgba(0, 77, 242, 0.3) 50%,
      rgba(0, 97, 242, 0.1) 52%,
      transparent 100%);
  opacity: 0;
}

/* --- Data Visualization --- */
.input-data-stream {
  position: absolute;
  bottom: 2px;
  left: 0;
  width: 100%;
  height: 0.3rem;
  display: flex;
  opacity: 0;
  transition: opacity 0.3s ease 0.1s;
}

.stream-bar {
  flex-grow: 1;
  background-color: var(--primary-color);
  transition:
    transform 0.2s,
    opacity 0.2s;
  transform: scaleY(0);
  transform-origin: bottom;
}

.holo-input:focus {
  border-color: transparent;
}

.holo-input:focus~.input-border {
  opacity: 1;
  border-color: rgba(0, 113, 242, 0.5);
}

.holo-input:focus~.input-corners .corner {
  width: 1.25rem;
  height: 1.25rem;
  border-width: 3px;
  opacity: 1;
}

.holo-input:focus~.input-glow {
  opacity: 1;
}

.holo-input:focus~.input-scanline {
  animation: scan-vertical 4s linear infinite;
}

.holo-input:focus~.input-data-stream {
  opacity: 1;
}

.holo-input:focus~.input-data-stream .stream-bar {
  animation: data-pulse 2s infinite;
  animation-delay: calc(var(--i) * 0.1s);
}

/* --- Keyframes --- */
@keyframes glitch-label {
  0% {
    transform: translate(0);
    clip-path: inset(0 0 0 0);
  }

  20% {
    transform: translate(-0.2rem, 0.1rem);
    clip-path: inset(50% 0 20% 0);
  }

  40% {
    transform: translate(0.1rem, -0.1rem);
    clip-path: inset(20% 0 60% 0);
  }

  60% {
    transform: translate(-0.15rem, 0.1rem);
    clip-path: inset(80% 0 5% 0);
  }

  80% {
    transform: translate(0.15rem, -0.15rem);
    clip-path: inset(30% 0 45% 0);
  }

  100% {
    transform: translate(0);
    clip-path: inset(0 0 0 0);
  }
}

@keyframes scan-vertical {
  0% {
    opacity: 0;
    transform: translateY(-100%);
  }

  25% {
    opacity: 0.5;
  }

  75% {
    opacity: 0.5;
  }

  100% {
    opacity: 0;
    transform: translateY(100%);
  }
}

@keyframes data-pulse {

  0%,
  100% {
    transform: scaleY(0.2);
    opacity: 0.3;
  }

  50% {
    transform: scaleY(1);
    opacity: 0.8;
  }
}

/* Ajout : styling du bouton et message erreur */
form {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.holo-button {
  background: rgba(13, 13, 13, 0.7);
  border: 1px solid rgba(0, 85, 242, 0.3);
  color: #007df2;
  font-family: "Fira Code", monospace;
  font-size: 1rem;
  padding: 0.6rem 1.8rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  border-radius: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 2rem;
}

.holo-button:hover {
  border-color: #007df2;
  color: #a855f7;
  box-shadow: 0 0 8px rgba(0, 125, 242, 0.5);
}

.holo-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(0, 125, 242, 0.3), transparent);
  transition: all 0.4s ease;
}

.holo-button:hover::before {
  left: 100%;
}

.error-message {
  color: #ff4d4d;
  text-align: center;
  margin-top: 1.5rem;
  font-family: "Fira Code", monospace;
  letter-spacing: 0.05em;
}

/* clock */
.clock-container {
  position: absolute;
  bottom: 0%;
  right: 2rem;
  color: rgba(0, 125, 242, 0.808);
  font-family: "Fira Code", monospace;
  font-size: 2em;
  letter-spacing: 0.1em;
  text-shadow: 0 0 8px rgba(0, 125, 242, 0.6);
  user-select: none;
  animation: clock-glow 1s ease-in-out infinite alternate;
}

@keyframes clock-glow {
  from {
    text-shadow: 0 0 6px rgba(0, 125, 242, 0.4);
  }

  to {
    text-shadow: 0 0 12px rgba(85, 174, 247, 0.7);
  }
}

/* === GRID LAYOUT === */
.main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr; /* deux colonnes */
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: #0d0d0d;
  overflow: hidden;
}

/* Colonne gauche (hexagones) */
.hexagon-section {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Colonne droite (login) */
.login-section {
  display: flex;
  justify-content: center;
  align-items: center;
  /* padding-top: 10%; */
}

/* Supprimer display:flex global qui déformait le layout */
body {
  margin: 0;
  background: #0d0d0d;
}

/* Centrer verticalement l’input et bouton */
.glitch-input-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem;
}

/* Corriger l’horloge : */
.clock-container {
  position: static;
  margin-top: 2rem;
  text-align: center;
}
/* === HEXAGON MENU STYLE === */
.hexagon-menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2.5rem;
  perspective: 1000px;
}

.hexagon-item {
  position: relative;
  width: 120px;
  height: 138px;
  cursor: pointer;
  transition: transform 0.4s ease, filter 0.4s ease;
}

.hexagon-item:hover {
  transform: scale(1.1);
  filter: brightness(1.3);
}

.hex-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.hex-item div {
  position: absolute;
  width: 100%;
  height: 100%;
  background: #111823;
  transform: rotate(60deg);
  border: 2px solid #007df2;
  opacity: 0.8;
}

.hex-content {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 138px;
  text-align: center;
  color: #00aaff;
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
}

.hex-content svg {
  position: absolute;
  top: 0;
  left: 0;
  z-index: -1;
  transition: fill 0.3s ease;
}

.hex-content-inner {
  z-index: 2;
}

.hex-content:hover svg path {
  fill: rgba(0, 125, 242, 0.3);
}

.hex-content .icon {
  font-size: 1.8rem;
  display: block;
  margin-bottom: 0.4rem;
}

.hex-content .title {
  font-family: "Fira Code", monospace;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* centrage correct dans ta grille */
.hexagon-section {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* === Responsive === */
@media (max-width: 1024px) {
  .hexagon-item {
    width: 100px;
    height: 115px;
  }
  .hex-content {
    width: 100px;
    height: 115px;
  }
  .hex-content .icon {
    font-size: 1.5rem;
  }
  .hex-content .title {
    font-size: 0.8rem;
  }
}

@media (max-width: 768px) {
  .main-grid {
    grid-template-columns: 1fr; /* Une seule colonne */
    grid-template-rows: auto auto;
    height: auto;
    padding: 2rem 0;
  }

  .hexagon-section {
    order: 1;
    margin-bottom: 3rem;
  }

  .login-section {
    order: 2;
  }

  .glitch-input-wrapper {
    padding: 1rem;
  }

  .clock-container {
    margin-top: 1.5rem;
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .hexagon-item {
    width: 80px;
    height: 92px;
  }
  .hex-content {
    width: 80px;
    height: 92px;
  }
  .hex-content .icon {
    font-size: 1.2rem;
  }
  .hex-content .title {
    font-size: 0.7rem;
  }

  .holo-input {
    height: 3rem;
    font-size: 1rem;
  }
  .input-container {
    width: 16rem;
  }
  .holo-button {
    padding: 0.5rem 1.5rem;
    font-size: 0.9rem;
  }
}
