/* ==========================================
   LOGIN PAGE - THEME PREMIUM + GOOGLE AUTH
   ========================================== */

:root {
  --login-white: #ffffff;
  --login-pink: #ff69b4;
  --login-gold: #C9B037;
  --login-gold-light: #f4e5c2;
  --login-gold-dark: #b8941f;
  --login-black: #1a1a1a;
  --login-gray: #666666;
  --login-gray-light: #999999;
  --login-green: #28a745;
  --login-red: #dc3545;
  --login-blue: #4e73df;
  --login-orange: #fd7e14;
  --login-purple: #6f42c1;
  --login-gradient-primary: linear-gradient(135deg, var(--login-gold), var(--login-pink));
  --login-gradient-secondary: linear-gradient(135deg, var(--login-blue), var(--login-purple));
  --login-gradient-success: linear-gradient(135deg, var(--login-green), #20c997);
  --login-gradient-danger: linear-gradient(135deg, var(--login-red), #c82333);
  --login-shadow-sm: 0 2px 12px rgba(201, 176, 55, 0.15);
  --login-shadow-md: 0 6px 24px rgba(201, 176, 55, 0.25);
  --login-shadow-lg: 0 12px 40px rgba(201, 176, 55, 0.35);
  --login-shadow-xl: 0 20px 60px rgba(201, 176, 55, 0.4);
  --login-radius-lg: 24px;
  --login-radius-xl: 32px;
  --login-transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --login-transition-bounce: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

body {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(135deg, var(--login-white), #fef7ff);
  color: var(--login-black);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

.login-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  position: relative;
}

/* Panneau gauche - Formulaire */
.login-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4rem 3rem;
  background: var(--login-white);
  position: relative;
  overflow: hidden;
}

.login-left::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 30%, rgba(201, 176, 55, 0.05) 50%, transparent 70%);
  animation: shimmer 8s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.login-header {
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
  z-index: 1;
}

.logo-container {
  position: relative;
  display: inline-block;
  margin-bottom: 2rem;
}

.logo-image {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--login-gold);
  box-shadow: 0 8px 24px rgba(201, 176, 55, 0.3);
  transition: var(--login-transition-bounce);
}

.logo-image:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 32px rgba(201, 176, 55, 0.4);
}

.logo-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, rgba(201, 176, 55, 0.2), transparent 70%);
  border-radius: 50%;
  animation: pulse 3s infinite;
}

@keyframes pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
  50% { transform: translate(-50%, -50%) scale(1.1); opacity: 0.3; }
}

.login-title {
  font-family: 'Cinzel', serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--login-black);
  margin-bottom: 0.5rem;
  background: var(--login-gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.login-subtitle {
  color: var(--login-gray);
  font-size: 1.125rem;
  font-weight: 500;
}

/* Messages d'alerte */
.alert-message {
  background: var(--login-gradient-danger);
  color: var(--login-white);
  padding: 1rem 1.5rem;
  border-radius: 16px;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 8px 24px rgba(220, 53, 69, 0.3);
  animation: slideInDown 0.5s ease-out;
}

.alert-message.success {
  background: var(--login-gradient-success);
  box-shadow: 0 8px 24px rgba(40, 167, 69, 0.3);
}

@keyframes slideInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.alert-icon {
  font-size: 1.5rem;
  animation: bounceIn 0.6s ease-out;
}

@keyframes bounceIn {
  0% { transform: scale(0); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.alert-text {
  font-weight: 600;
}

/* Formulaire */
.login-form {
  position: relative;
  z-index: 1;
}

.form-group {
  margin-bottom: 2rem;
}

.input-container {
  position: relative;
  margin-bottom: 0.5rem;
}

.form-input {
  width: 100%;
  padding: 1rem 1.25rem 1rem 3.5rem;
  border: 2px solid rgba(201, 176, 55, 0.3);
  border-radius: 16px;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  background: var(--login-white);
  transition: var(--login-transition-smooth);
  color: var(--login-black);
}

.form-input:focus {
  outline: none;
  border-color: var(--login-gold);
  box-shadow: 0 0 0 4px rgba(201, 176, 55, 0.1);
  transform: translateY(-2px);
}

.form-label {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--login-gray);
  font-weight: 600;
  font-size: 0.875rem;
  pointer-events: none;
  transition: var(--login-transition-smooth);
  z-index: 1;
}

.input-container.focused .form-label {
  top: -0.75rem;
  left: 1rem;
  font-size: 0.75rem;
  background: var(--login-white);
  padding: 0 0.5rem;
  border-radius: 8px;
  color: var(--login-gold);
}

.label-icon {
  font-size: 1.125rem;
  transition: var(--login-transition-smooth);
}

.input-border {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--login-gradient-primary);
  transform: scaleX(0);
  transition: var(--login-transition-smooth);
}

.input-container.focused .input-border {
  transform: scaleX(1);
}

.password-toggle {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--login-gray);
  cursor: pointer;
  font-size: 1.25rem;
  transition: var(--login-transition-smooth);
  z-index: 2;
}

.password-toggle:hover {
  color: var(--login-gold);
}

.toggle-icon {
  transition: var(--login-transition-smooth);
}

/* Options du formulaire */
.form-options {
  margin-bottom: 2rem;
}

.checkbox-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  position: relative;
}

.checkbox-input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.checkbox-checkmark {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(201, 176, 55, 0.3);
  border-radius: 6px;
  transition: var(--login-transition-smooth);
  position: relative;
}

.checkbox-input:checked ~ .checkbox-checkmark {
  background: var(--login-gradient-primary);
  border-color: var(--login-gold);
}

.checkbox-input:checked ~ .checkbox-checkmark::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--login-white);
  font-weight: bold;
  font-size: 0.875rem;
}

.checkbox-label {
  color: var(--login-gray);
  font-weight: 500;
  font-size: 0.875rem;
}

/* Bouton de connexion */
.login-button {
  width: 100%;
  padding: 1.25rem;
  border: none;
  border-radius: 16px;
  background: var(--login-gradient-primary);
  color: var(--login-white);
  font-family: 'Cinzel', serif;
  font-size: 1.125rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--login-transition-bounce);
  position: relative;
  overflow: hidden;
  margin-bottom: 2rem;
}

.login-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(201, 176, 55, 0.4);
}

.login-button:active {
  transform: translateY(0);
}

.login-button.loading {
  pointer-events: none;
  opacity: 0.8;
}

.button-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.button-text {
  transition: var(--login-transition-smooth);
}

.login-button.loading .button-text {
  opacity: 0.7;
}

.button-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top: 2px solid var(--login-white);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: none;
}

.login-button.loading .button-spinner {
  display: block;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.button-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.2) 50%, transparent 70%);
  opacity: 0;
  transition: var(--login-transition-smooth);
}

.login-button:hover .button-glow {
  opacity: 1;
}

/* Liens */
.login-links {
  text-align: center;
}

.link-item {
  margin-bottom: 1rem;
  color: var(--login-gray);
  font-size: 0.875rem;
}

.link-primary {
  color: var(--login-gold);
  text-decoration: none;
  font-weight: 600;
  transition: var(--login-transition-smooth);
}

.link-primary:hover {
  color: var(--login-pink);
  text-decoration: underline;
}

.link-secondary {
  color: var(--login-gray);
  text-decoration: none;
  font-weight: 500;
  transition: var(--login-transition-smooth);
}

.link-secondary:hover {
  color: var(--login-gold);
  text-decoration: underline;
}

.link-return {
  color: var(--login-gray);
  text-decoration: none;
  font-weight: 500;
  transition: var(--login-transition-smooth);
}

.link-return:hover {
  color: var(--login-pink);
  text-decoration: underline;
}

/* Panneau droit - Présentation */
.login-right {
  background: var(--login-gradient-primary);
  color: var(--login-white);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4rem 3rem;
  position: relative;
  overflow: hidden;
}

.login-right::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
  animation: shimmer 10s infinite;
}

.presentation-content {
  position: relative;
  z-index: 1;
  text-align: center;
}

.presentation-header {
  margin-bottom: 3rem;
}

.presentation-title {
  font-family: 'Cinzel', serif;
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.title-decoration {
  width: 100px;
  height: 4px;
  background: var(--login-white);
  margin: 0 auto;
  border-radius: 2px;
  box-shadow: 0 2px 8px rgba(255,255,255,0.3);
}

.presentation-text {
  font-size: 1.125rem;
  line-height: 1.8;
  margin-bottom: 3rem;
  opacity: 0.9;
}

.presentation-text strong {
  color: var(--login-white);
  font-weight: 600;
}

.features-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 3rem;
}

.feature-item {
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  transition: var(--login-transition-bounce);
}

.feature-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.feature-icon {
  width: 60px;
  height: 60px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 1rem;
  border: 2px solid rgba(255,255,255,0.2);
  transition: var(--login-transition-smooth);
}

.feature-item:hover .feature-icon {
  background: rgba(255,255,255,0.2);
  transform: scale(1.05);
}

.feature-text {
  font-weight: 500;
  font-size: 0.875rem;
}

.quote-container {
  margin-bottom: 3rem;
}

.quote-content {
  background: rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 2rem;
  border: 1px solid rgba(255,255,255,0.2);
  position: relative;
}

.quote-text {
  font-family: 'Cinzel', serif;
  font-size: 1.25rem;
  font-style: italic;
  line-height: 1.6;
  margin-bottom: 1rem;
  position: relative;
}

.quote-text::before {
  content: '"';
  position: absolute;
  top: -10px;
  left: -10px;
  font-size: 3rem;
  opacity: 0.3;
}

.quote-decoration {
  width: 50px;
  height: 2px;
  background: var(--login-white);
  margin: 0 auto;
  border-radius: 1px;
}

.stats-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.stat-item {
  text-align: center;
  padding: 1rem;
  background: rgba(255,255,255,0.1);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.2);
  transition: var(--login-transition-smooth);
}

.stat-item:hover {
  background: rgba(255,255,255,0.15);
  transform: translateY(-2px);
}

.stat-number {
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.75rem;
  opacity: 0.8;
}

/* Éléments décoratifs */
.decorative-elements {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 0;
}

.decoration-circle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  animation: float 6s ease-in-out infinite;
}

.decoration-1 {
  width: 100px;
  height: 100px;
  top: 10%;
  left: 10%;
  animation-delay: 0s;
}

.decoration-2 {
  width: 60px;
  height: 60px;
  top: 20%;
  right: 15%;
  animation-delay: 2s;
}

.decoration-3 {
  width: 80px;
  height: 80px;
  bottom: 20%;
  left: 20%;
  animation-delay: 4s;
}

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

/* Responsive */
@media (max-width: 1024px) {
  .login-wrapper {
    grid-template-columns: 1fr;
  }
  
  .login-right {
    display: none;
  }
  
  .login-left {
    padding: 2rem;
  }
  
  .login-title {
    font-size: 2rem;
  }
  
  .features-list {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

@media (max-width: 768px) {
  .login-left {
    padding: 1.5rem;
  }
  
  .login-title {
    font-size: 1.75rem;
  }
  
  .logo-image {
    width: 60px;
    height: 60px;
  }
  
  .form-input {
    padding: 0.875rem 1rem 0.875rem 3rem;
    font-size: 0.875rem;
  }
  
  .login-button {
    padding: 1rem;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .login-left {
    padding: 1rem;
  }
  
  .login-title {
    font-size: 1.5rem;
  }
  
  .logo-image {
    width: 50px;
    height: 50px;
  }
  
  .form-input {
    padding: 0.75rem 0.875rem 0.75rem 2.5rem;
    font-size: 16px; /* Empêche le zoom sur iOS */
  }
  
  .login-button {
    padding: 0.875rem;
    font-size: 0.875rem;
  }
  
  /* ==========================================
   GOOGLE AUTH STYLES
   ========================================== */

  /* Séparateur Google */
  .divider-container {
    display: flex;
    align-items: center;
    margin: 2rem 0;
    gap: 1rem;
  }

  .divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--login-gold-light), transparent);
  }

  .divider-text {
    color: var(--login-gray);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0 1rem;
  }

  /* Container Google Auth */
  .google-auth-container {
    margin: 1.5rem 0;
    text-align: center;
  }

  /* Bouton Google personnalisé */
  .btn-google-custom {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    background: var(--login-white);
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    color: #3c4043;
    cursor: pointer;
    transition: var(--login-transition-smooth);
    font-family: 'Inter', sans-serif;
    position: relative;
    overflow: hidden;
  }

  .btn-google-custom:hover {
    background: #f8f9fa;
    border-color: var(--login-gold);
    transform: translateY(-2px);
    box-shadow: var(--login-shadow-sm);
  }

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

  .btn-google-custom::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(201, 176, 55, 0.1), transparent);
    transition: left 0.6s ease;
  }

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

  /* Animation de chargement Google */
  .btn-google-custom.loading {
    pointer-events: none;
    opacity: 0.7;
  }

  .btn-google-custom.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid var(--login-gold);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: googleSpin 1s linear infinite;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
  }

  @keyframes googleSpin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
  }

  /* Messages d'erreur Google */
  .google-error {
    background: linear-gradient(135deg, #fee, #fdd);
    color: #c33;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid #fcc;
    margin: 1rem 0;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .google-error::before {
    content: '⚠️';
    font-size: 1rem;
  }

  /* Message de succès Google */
  .google-success {
    background: linear-gradient(135deg, #efe, #dfd);
    color: #363;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid #cfc;
    margin: 1rem 0;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .google-success::before {
    content: '✅';
    font-size: 1rem;
  }

  /* Focus states pour accessibilité */
  .btn-google-custom:focus {
    outline: 2px solid var(--login-gold);
    outline-offset: 2px;
  }
  
  /* Responsive pour Google Auth */
  @media (max-width: 768px) {
    .divider-container {
      margin: 1.5rem 0;
    }
    
    .btn-google-custom {
      padding: 0.75rem 1rem;
      font-size: 0.9rem;
    }
    
    .divider-text {
      font-size: 0.85rem;
      padding: 0 0.75rem;
    }
  }

  @media (max-width: 480px) {
    .btn-google-custom {
      gap: 0.5rem;
    }
    
    .btn-google-custom svg {
      width: 16px;
      height: 16px;
    }
  }
  
  .stats-preview {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}
