:root {
  --primary-color: #4f46e5;
  --secondary-color: #818cf8;
  --accent-color: #6366f1;
  --dark-bg: #0a0a0a;
  --dark-card: #1a1a1a;
  --dark-text: #ffffff;
  --dark-text-secondary: #a0a0a0;
  --error-color: #ef4444;
  --success-color: #10b981;
  --input-bg: rgba(255, 255, 255, 0.05);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --gradient-primary: linear-gradient(135deg, #4f46e5, #818cf8, #6366f1);
  --gradient-dark: linear-gradient(145deg, #141414, #0a0a0a);
  --neon-glow: 0 0 20px var(--primary-color), 0 0 40px rgba(79, 70, 229, 0.3);
  --border-radius-sm: 0.5rem;
  --border-radius-md: 0.75rem;
  --border-radius-lg: 1.5rem;
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: radial-gradient(circle at center, #141414, var(--dark-bg));
  font-family: var(--font-family);
  color: var(--dark-text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow-x: hidden;
  background-attachment: fixed;
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
  line-height: 1.6;
}

@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.welcome-container {
  position: relative;
  width: 100%;
  max-width: 400px;
  margin-bottom: 2.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 1000px;
  z-index: 10;
}

.orbit {
  position: absolute;
  width: 200px;
  height: 200px;
  border: 2px solid rgba(79, 70, 229, 0.2);
  border-radius: 50%;
  animation: orbit 25s linear infinite;
  transform-style: preserve-3d;
  box-shadow: 0 0 15px rgba(79, 70, 229, 0.15);
  will-change: transform;
}

.orbit:nth-child(2) {
  width: 240px;
  height: 240px;
  border-width: 1px;
  border-color: rgba(79, 70, 229, 0.15);
  animation-duration: 35s;
  animation-direction: reverse;
}

.orbit:nth-child(3) {
  width: 280px;
  height: 280px;
  border-width: 1px;
  border-color: rgba(79, 70, 229, 0.1);
  animation-duration: 45s;
}

@keyframes orbit {
  0% { transform: rotateX(70deg) rotateZ(0deg); }
  100% { transform: rotateX(70deg) rotateZ(360deg); }
}

.signal-wave {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(79, 70, 229, 0.1);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%);
  left: 50%;
  top: 50%;
  animation: wave 4s cubic-bezier(0.1, 0.5, 0.1, 1) infinite;
  will-change: width, height, opacity;
}

@media (max-width: 768px) {
  .orbit {
    animation: none;
    opacity: 0.5;
  }
  
  .signal-wave {
    display: none;
  }
}

.signal-wave:nth-child(1) {
  animation-delay: 0s;
}

.signal-wave:nth-child(2) {
  animation-delay: 1s;
}

.signal-wave:nth-child(3) {
  animation-delay: 2s;
}

.signal-wave:nth-child(4) {
  animation-delay: 3s;
}

@keyframes wave {
  0% {
    width: 0;
    height: 0;
    opacity: 0.8;
  }
  100% {
    width: 300px;
    height: 300px;
    opacity: 0;
  }
}

.profile-image {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  border: 4px solid transparent;
  background: var(--gradient-primary) padding-box,
              linear-gradient(145deg, rgba(255,255,255,0.3), rgba(255,255,255,0.05)) border-box;
  box-shadow: 
    0 0 20px rgba(79, 70, 229, 0.3),
    0 0 60px rgba(79, 70, 229, 0.1),
    inset 0 0 20px rgba(79, 70, 229, 0.2);
  z-index: 20;
  animation: float 6s ease-in-out infinite, pulse 3s ease-in-out infinite;
  transition: var(--transition);
  object-fit: cover;
  position: relative;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(79, 70, 229, 0.3), 0 0 60px rgba(79, 70, 229, 0.1); }
  50% { box-shadow: 0 0 30px rgba(79, 70, 229, 0.5), 0 0 80px rgba(79, 70, 229, 0.2); }
}

.profile-image:hover {
  transform: scale(1.1) translateY(-10px);
  box-shadow: 
    0 0 30px rgba(79, 70, 229, 0.5),
    0 0 80px rgba(79, 70, 229, 0.2);
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-15px) rotate(-5deg); }
}

h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 2.5rem;
  text-align: center;
  background: var(--gradient-primary);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: fadeIn 1s ease-out, glow 3s ease-in-out infinite, textShine 5s linear infinite;
  letter-spacing: -0.5px;
  text-shadow: 
    0 0 10px rgba(99, 102, 241, 0.2),
    0 0 20px rgba(99, 102, 241, 0.1);
  position: relative;
  z-index: 5;
}

@keyframes textShine {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

@keyframes glow {
  0%, 100% { text-shadow: 0 0 20px rgba(99, 102, 241, 0.1); filter: brightness(1); }
  50% { text-shadow: 0 0 30px rgba(99, 102, 241, 0.3); filter: brightness(1.2); }
}

form {
  width: 90%;
  max-width: 420px;
  background: linear-gradient(145deg, #1c1c1c, var(--dark-card));
  padding: 2.5rem;
  border-radius: var(--border-radius-lg);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.2),
    0 2px 8px rgba(79, 70, 229, 0.1),
    inset 0 2px 4px rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.08);
  animation: slideUp 0.6s ease-out, formGlow 3s ease-in-out infinite;
  backdrop-filter: blur(10px);
  transform-style: preserve-3d;
  transition: var(--transition);
  z-index: 10;
  position: relative;
}

@keyframes formGlow {
  0%, 100% { box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), 0 2px 8px rgba(79, 70, 229, 0.1); }
  50% { box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), 0 2px 16px rgba(79, 70, 229, 0.2); }
}

form:hover {
  transform: translateY(-5px) scale(1.01);
}

label {
  display: block;
  margin-bottom: 0.75rem;
  color: var(--dark-text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  transition: var(--transition);
  text-transform: uppercase;
  letter-spacing: 1px;
}

label:hover {
  color: var(--dark-text);
  transform: translateX(5px);
}

input {
  width: 100%;
  padding: 1rem 1.25rem;
  margin-bottom: 1.75rem;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius-md);
  background: var(--input-bg);
  color: var(--dark-text);
  font-size: 1rem;
  transition: var(--transition);
  caret-color: var(--primary-color);
  backdrop-filter: blur(5px);
  box-sizing: border-box;
}

input:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.07);
  transform: translateX(5px);
}

input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.25);
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(5px) scale(1.02);
}

button[type="submit"] {
  width: 100%;
  padding: 1.25rem;
  background: var(--gradient-primary);
  background-size: 200% auto;
  border: none;
  border-radius: var(--border-radius-md);
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 2px;
}

button[type="submit"]:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 
    0 6px 15px rgba(79, 70, 229, 0.3),
    0 2px 5px rgba(79, 70, 229, 0.2),
    inset 0 2px 4px rgba(255, 255, 255, 0.2);
  animation: buttonGlow 1.5s ease-in-out infinite;
  background-position: right center;
}

@keyframes buttonGlow {
  0%, 100% { box-shadow: 0 6px 15px rgba(79, 70, 229, 0.3); }
  50% { box-shadow: 0 6px 30px rgba(79, 70, 229, 0.5); }
}

button[type="submit"]:active {
  transform: translateY(-1px);
}

button[type="submit"]::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: 0.5s;
}

button[type="submit"]:hover::before {
  left: 100%;
}

p[style*="color: red"] {
  color: var(--error-color) !important;
  text-align: center;
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
  font-weight: 500;
  animation: shake 0.5s ease-in-out;
  padding: 0.75rem;
  background: rgba(239, 68, 68, 0.1);
  border-radius: var(--border-radius-sm);
  border: 1px solid rgba(239, 68, 68, 0.2);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.1);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px) rotate(-2deg); }
  40% { transform: translateX(6px) rotate(2deg); }
  60% { transform: translateX(-4px) rotate(-1deg); }
  80% { transform: translateX(4px) rotate(1deg); }
}

p a, #firstConnectionButton {
  display: block;
  text-align: center;
  margin-top: 1.25rem;
  color: var(--dark-text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  transition: var(--transition);
  position: relative;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius-sm);
}

p a:hover {
  color: var(--secondary-color);
  text-shadow: 0 0 10px rgba(129, 140, 248, 0.3);
  background: rgba(129, 140, 248, 0.1);
  transform: translateY(-2px);
}

p a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 50%;
  background: var(--gradient-primary);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

p a:hover::after {
  width: 50%;
}

#firstConnectionButton {
  width: 90%;
  max-width: 420px;
  margin: 1.25rem auto;
  padding: 1rem;
  background: rgba(79, 70, 229, 0.1);
  border: 2px solid var(--primary-color);
  border-radius: var(--border-radius-md);
  color: var(--primary-color);
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  backdrop-filter: blur(5px);
}

#firstConnectionButton:hover {
  background: rgba(79, 70, 229, 0.15);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 
    0 4px 12px rgba(79, 70, 229, 0.2),
    inset 0 2px 4px rgba(255, 255, 255, 0.1);
  animation: buttonPulse 2s infinite;
}

@keyframes buttonPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

@keyframes fadeIn {
  from { 
    opacity: 0;
    transform: translateY(20px) scale(0.9);
  }
  to { 
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 768px) {
  h1 {
    font-size: 1.75rem;
    padding: 0 1.25rem;
  }

  form {
    width: 85%;
    padding: 2rem;
  }

  .welcome-container {
    transform: scale(0.85);
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.5rem;
  }

  form {
    padding: 1.5rem;
  }

  input {
    font-size: 1rem;
    padding: 0.875rem 1rem;
  }

  .welcome-container {
    transform: scale(0.75);
  }
}

@media (prefers-color-scheme: dark) {
  input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 30px var(--dark-card) inset;
    -webkit-text-fill-color: var(--dark-text);
  }
}

.satellite-container {
  position: absolute;
  width: 100%;
  height: 100%;
  animation: rotate 25s linear infinite;
  transform-style: preserve-3d;
  z-index: 1;
}

.satellite {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--gradient-primary);
  border-radius: 50%;
  box-shadow: var(--neon-glow);
  animation: satellitePulse 2s ease-in-out infinite;
}

@keyframes satellitePulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.8; }
}

.satellite:nth-child(1) { top: 0; left: 50%; }
.satellite:nth-child(2) { top: 50%; right: 0; }
.satellite:nth-child(3) { bottom: 0; left: 50%; }
.satellite:nth-child(4) { top: 50%; left: 0; }

@keyframes rotate {
  from { transform: rotateZ(0deg) rotateX(60deg) perspective(1000px); }
  to { transform: rotateZ(360deg) rotateX(60deg) perspective(1000px); }
}

/* Ajout d'éléments décoratifs */
.particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background-color: var(--primary-color);
  border-radius: 50%;
  opacity: 0.5;
  animation: particleFloat 15s infinite linear;
}

@keyframes particleFloat {
  0% {
    transform: translateY(0) translateX(0);
    opacity: 0;
  }
  10% {
    opacity: 0.8;
  }
  90% {
    opacity: 0.8;
  }
  100% {
    transform: translateY(-100vh) translateX(20px);
    opacity: 0;
  }
}

/* Amélioration de l'accessibilité */
:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

::selection {
  background-color: var(--primary-color);
  color: white;
}