/* ========================================
   AUTH PAGE - DESIGN CENTRÉ
======================================== */

/* Variables */
:root {
  --auth-primary: #10b981;
  --auth-primary-dark: #059669;
  --auth-secondary: #3b82f6;
  --auth-accent: #06b6d4;
}

/* Reset pour la page auth */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfeff 100%);
}

/* Background animé */
.auth-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.bg-shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.3;
  animation: float 20s ease-in-out infinite;
}

.shape-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--auth-primary), transparent);
  top: -200px;
  left: -200px;
}

.shape-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--auth-secondary), transparent);
  bottom: -150px;
  right: -150px;
  animation-delay: 5s;
}

.shape-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--auth-accent), transparent);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: 10s;
}

@keyframes float {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  25% {
    transform: translate(50px, -50px) scale(1.1);
  }
  50% {
    transform: translate(-30px, 30px) scale(0.9);
  }
  75% {
    transform: translate(30px, 50px) scale(1.05);
  }
}

/* Container centré */
.auth-centered-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

/* Branding */
.auth-brand {
  text-align: center;
  animation: fadeInDown 0.6s ease;
}

.brand-logo-circle {
  width: 80px;
  height: 80px;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    135deg,
    var(--auth-primary),
    var(--auth-secondary)
  );
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
  font-size: 2.5rem;
  color: white;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(16, 185, 129, 0.4);
  }
}

.brand-title {
  margin: 0 0 0.5rem 0;
  font-family: "Poppins", sans-serif;
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(
    135deg,
    var(--auth-primary),
    var(--auth-secondary)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-tagline {
  margin: 0;
  font-size: 1rem;
  color: #6b7280;
}

/* Carte de formulaire */
.auth-card {
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.5) inset;
  animation: fadeInUp 0.6s ease 0.2s backwards;
}

.auth-card-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-card-header h2 {
  margin: 0 0 0.5rem 0;
  font-size: 1.875rem;
  font-weight: 700;
  color: #111827;
}

.auth-card-header p {
  margin: 0;
  font-size: 1rem;
  color: #6b7280;
}

/* Alertes */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  animation: slideDown 0.3s ease;
}

.alert-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.alert-content {
  flex: 1;
}

.alert-content p {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.5;
}

.alert-close {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s ease;
  flex-shrink: 0;
}

.alert-close:hover {
  opacity: 1;
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #dc2626;
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #059669;
}

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

/* Formulaire */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #374151;
}

.form-label i {
  font-size: 1rem;
  color: var(--auth-primary);
}

.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-prefix {
  position: absolute;
  left: 1rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #6b7280;
  pointer-events: none;
  z-index: 1;
}

.form-control {
  width: 100%;
  padding: 1rem;
  font-size: 1rem;
  color: #111827;
  background: #f9fafb;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  transition: all 0.3s ease;
  font-family: inherit;
}

.input-group .form-control {
  padding-left: 4rem;
  padding-right: 3.5rem;
}

.form-control:focus {
  outline: none;
  background: white;
  border-color: var(--auth-primary);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.form-control::placeholder {
  color: #9ca3af;
}

.input-suffix {
  position: absolute;
  right: 1rem;
  background: transparent;
  border: none;
  color: #6b7280;
  cursor: pointer;
  font-size: 1.125rem;
  padding: 0.25rem;
  transition: color 0.2s ease;
  z-index: 1;
}

.input-suffix:hover {
  color: #111827;
}

.form-error {
  display: block;
  font-size: 0.8125rem;
  color: #dc2626;
  font-weight: 500;
  min-height: 1.25rem;
}

/* Options du formulaire */
.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
}

.checkbox-wrapper input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.checkbox-custom {
  width: 20px;
  height: 20px;
  border: 2px solid #d1d5db;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.checkbox-wrapper input:checked + .checkbox-custom {
  background: var(--auth-primary);
  border-color: var(--auth-primary);
}

.checkbox-wrapper input:checked + .checkbox-custom::after {
  content: "✓";
  color: white;
  font-size: 0.75rem;
  font-weight: bold;
}

.checkbox-label {
  font-size: 0.875rem;
  color: #374151;
}

.link-primary {
  color: var(--auth-primary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  transition: color 0.2s ease;
}

.link-primary:hover {
  color: var(--auth-primary-dark);
}

/* Bouton de connexion */
.btn-submit {
  width: 100%;
  padding: 1rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  background: linear-gradient(
    135deg,
    var(--auth-primary),
    var(--auth-primary-dark)
  );
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

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

.btn-submit:hover:not(:disabled)::before {
  left: 100%;
}

.btn-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-submit:active:not(:disabled) {
  transform: translateY(0);
}

.btn-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.spinner {
  animation: spin 1s linear infinite;
}

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

/* Footer du formulaire */
.form-footer {
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

.form-footer p {
  margin: 0;
  font-size: 0.9375rem;
  color: #6b7280;
}

/* Footer de la page */
.auth-footer-text {
  text-align: center;
  animation: fadeIn 0.6s ease 0.4s backwards;
}

.auth-footer-text p {
  margin: 0;
  font-size: 0.875rem;
  color: #6b7280;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

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

/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 640px) {
  .auth-page {
    padding: 1rem;
  }

  .auth-centered-container {
    gap: 1.5rem;
  }

  .brand-logo-circle {
    width: 70px;
    height: 70px;
    font-size: 2rem;
  }

  .brand-title {
    font-size: 1.75rem;
  }

  .brand-tagline {
    font-size: 0.9375rem;
  }

  .auth-card {
    padding: 2rem 1.5rem;
  }

  .auth-card-header h2 {
    font-size: 1.5rem;
  }

  .form-options {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 400px) {
  .auth-card {
    padding: 1.5rem 1rem;
  }

  .brand-title {
    font-size: 1.5rem;
  }

  .input-group .form-control {
    padding-left: 3.5rem;
  }

  .input-prefix {
    font-size: 0.875rem;
  }
}

/* Mode paysage mobile */
@media (max-height: 600px) and (orientation: landscape) {
  .auth-page {
    padding: 1rem;
  }

  .auth-brand {
    display: none;
  }

  .auth-card {
    padding: 1.5rem;
  }
}
