/* Variables CSS Krys - Version optimisée */
:root {
  --krys-blue: #1B64D7;
  --krys-blue-hover: #1557c2;
  --krys-blue-light: #00B4FF;
  --krys-violet: #5A00C8;
  --krys-aqua: #00C8DC;
  --krys-coral: #FF645C;
  --gradient-primary: linear-gradient(135deg, #1B64D7 0%, #00B4FF 50%, #5A00C8 100%);
  --shadow-medium: 0 10px 25px -3px rgba(27, 100, 215, 0.15);
  --shadow-strong: 0 20px 40px -12px rgba(27, 100, 215, 0.25);
}

/* Reset minimal */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  background: var(--gradient-primary) !important;
  margin: 0 !important;
  padding: 0 !important;
  min-height: 100vh !important;
}

/* Animations essentielles */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

/* Container principal */
.login-container {
  min-height: 100vh !important;
  background: var(--gradient-primary) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 2rem !important;
  position: relative !important;
  overflow: hidden !important;
}

/* Effet de fond décoratif */
.login-container::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 60%;
  height: 120%;
  background: linear-gradient(45deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  border-radius: 50%;
  transform: rotate(-15deg);
  animation: float 6s ease-in-out infinite;
}

/* Header avec logo */
.login-header {
  text-align: center !important;
  margin-bottom: 3rem !important;
  animation: slideUp 0.8s ease-out;
  z-index: 10 !important;
}

.logo-container {
  margin-bottom: 2rem !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

.logo {
  height: 4rem !important;
  width: auto !important;
  animation: pulse 3s ease-in-out infinite;
  filter: drop-shadow(0 4px 6px rgba(27, 100, 215, 0.1));
  display: block !important;
  margin: 0 auto !important;
}

.main-title {
  font-size: 2.5rem !important;
  font-weight: 700 !important;
  color: white !important;
  margin-bottom: 0.5rem !important;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
  letter-spacing: -0.02em !important;
}

.subtitle {
  font-size: 1.1rem !important;
  color: rgba(255, 255, 255, 0.9) !important;
  font-weight: 400 !important;
  line-height: 1.5 !important;
}

/* Card de connexion */
.login-card {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(20px) !important;
  border-radius: 24px !important;
  padding: 3rem !important;
  box-shadow: var(--shadow-strong) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  width: 100% !important;
  max-width: 420px !important;
  position: relative !important;
  z-index: 10 !important;
  animation: slideUp 0.8s ease-out 0.2s both;
}

/* Messages d'erreur */
.error-message {
  background: linear-gradient(135deg, #ff6b6b, #ff5252) !important;
  color: white !important;
  padding: 1rem 1.5rem !important;
  border-radius: 12px !important;
  margin-bottom: 2rem !important;
  font-size: 0.9rem !important;
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3) !important;
  animation: slideUp 0.5s ease-out;
}

/* Bouton de connexion Google */
.google-btn {
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.75rem !important;
  padding: 1rem 1.5rem !important;
  background: var(--krys-blue) !important;
  color: white !important;
  border: none !important;
  border-radius: 16px !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  box-shadow: var(--shadow-medium) !important;
  position: relative !important;
  overflow: hidden !important;
}

.google-btn::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: left 0.5s ease;
}

.google-btn:hover::before {
  left: 100%;
}

.google-btn:hover {
  background: var(--krys-blue-hover) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 15px 35px -5px rgba(27, 100, 215, 0.4) !important;
}

.google-btn:active {
  transform: translateY(0) !important;
}

.google-btn:disabled {
  opacity: 0.7 !important;
  cursor: not-allowed !important;
  transform: none !important;
}

/* Icône Google */
.google-icon {
  width: 1.25rem !important;
  height: 1.25rem !important;
  flex-shrink: 0 !important;
}

/* Spinner de chargement */
.loading-spinner {
  width: 1.25rem !important;
  height: 1.25rem !important;
  border: 2px solid rgba(255, 255, 255, 0.3) !important;
  border-top: 2px solid white !important;
  border-radius: 50% !important;
  animation: spin 1s linear infinite !important;
}

/* Séparateur */
.separator {
  margin: 2.5rem 0 !important;
  position: relative !important;
}

.separator-line {
  height: 1px !important;
  background: linear-gradient(90deg, transparent, #e5e7eb, transparent) !important;
}

.separator-text {
  margin-top: 10px;
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  background: rgba(255, 255, 255, 0.95) !important;
  padding: 0 1rem !important;
  font-size: 0.9rem !important;
  color: #6b7280 !important;
  font-weight: 500 !important;
}

/* Section d'information */
.info-section {
  color: #4b5563 !important;
  font-size: 0.9rem !important;
  line-height: 1.6 !important;
  margin-top: 1rem !important;
}

.info-section p {
  margin-bottom: 0.75rem !important;
  text-align: center;
  color: grey;
}

.info-section p:last-child {
  margin-bottom: 0 !important;
}

/* Footer */
.login-footer {
  text-align: center !important;
  margin-top: 50px;
  color: #ffffff36;
  font-size: 0.8rem !important;
  z-index: 10 !important;
}

.login-footer p {
  margin-bottom: 0.5rem !important;
}

/* Responsive */
@media (max-width: 640px) {
  .login-container {
    padding: 1rem !important;
  }
  
  .login-card {
    padding: 2rem !important;
    border-radius: 20px !important;
  }
  
  .main-title {
    font-size: 2rem !important;
  }
  
  .subtitle {
    font-size: 1rem !important;
  }
  
  .google-btn {
    padding: 0.875rem 1.25rem !important;
    font-size: 0.95rem !important;
  }
}

@media (max-width: 480px) {
  .main-title {
    font-size: 1.75rem !important;
  }
  
  .login-card {
    padding: 1.5rem !important;
  }
  
  .logo {
    height: 3rem !important;
  }
}

/* Override Tailwind classes */
.space-y-6 > * + * {
  margin-top: 1.5rem !important;
}

/* Focus states pour l'accessibilité */
.google-btn:focus-visible {
  outline: 2px solid white !important;
  outline-offset: 2px !important;
}

/* Personnalisation scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}
