/* ============================================
   AUTH PREMIUM — Styles pour l'authentification
   Glassmorphism, animations, stepper, inputs premium
   ============================================ */

/* === BACKGROUND === */
.auth-gradient-bg {
  background: linear-gradient(135deg, #0f0c29 0%, #1a1040 30%, #1e1b4b 60%, #0f172a 100%);
  position: relative;
  overflow: hidden;
}

.auth-gradient-bg::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at 30% 20%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
              radial-gradient(ellipse at 70% 80%, rgba(124, 58, 237, 0.1) 0%, transparent 50%);
  animation: authBgShift 20s ease-in-out infinite;
}

@keyframes authBgShift {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(2%, -2%); }
  66% { transform: translate(-2%, 1%); }
}

/* === GLASS CARD === */
.auth-glass-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  position: relative;
  z-index: 1;
}

.auth-glass-card-strong {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.6);
}

/* === INPUTS === */
.auth-input {
  width: 100%;
  padding: 16px 16px 16px 48px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  color: #fff;
  font-size: 16px;
  transition: all 0.3s ease;
  outline: none;
}

.auth-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.auth-input:focus {
  border-color: rgba(124, 58, 237, 0.6);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.auth-input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  pointer-events: none;
  transition: transform 0.3s ease;
}

.auth-input:focus ~ .auth-input-icon {
  transform: translateY(-50%) scale(1.1);
}

.auth-input-error {
  border-color: rgba(239, 68, 68, 0.5) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

/* === BUTTONS === */
.auth-btn-primary {
  width: 100%;
  padding: 16px 24px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  border: none;
  border-radius: 16px;
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.auth-btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px -8px rgba(124, 58, 237, 0.4);
}

.auth-btn-primary:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

.auth-btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.auth-btn-primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transition: left 0.6s ease;
}

.auth-btn-primary:hover::after {
  left: 100%;
}

.auth-btn-secondary {
  width: 100%;
  padding: 14px 24px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.auth-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.auth-btn-secondary:active {
  transform: translateY(0) scale(0.98);
}

.auth-btn-google {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.auth-btn-google:hover {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 12px rgba(66, 133, 244, 0.2);
}

.auth-btn-telegram {
  background: rgba(0, 136, 204, 0.15);
  border: 1px solid rgba(0, 136, 204, 0.3);
}

.auth-btn-telegram:hover {
  background: rgba(0, 136, 204, 0.25);
  box-shadow: 0 4px 12px rgba(0, 136, 204, 0.2);
}

.auth-btn-passkey {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border: none;
  color: #1a1040;
  font-size: 18px;
  padding: 18px 24px;
}

.auth-btn-passkey:hover {
  box-shadow: 0 12px 30px -8px rgba(245, 158, 11, 0.4);
  transform: translateY(-2px);
}

/* === DIVIDER === */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  color: rgba(255, 255, 255, 0.3);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
}

/* === STEPPER === */
.auth-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 32px;
}

.auth-stepper-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.auth-stepper-dot-active {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.auth-stepper-dot-inactive {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.4);
}

.auth-stepper-dot-completed {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.auth-stepper-line {
  width: 48px;
  height: 2px;
  border-radius: 2px;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-stepper-line-active {
  background: linear-gradient(90deg, #2563eb, #7c3aed);
}

.auth-stepper-line-inactive {
  background: rgba(255, 255, 255, 0.08);
}

/* === ANIMATIONS === */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

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

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

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes confetti {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(-200px) rotate(720deg); opacity: 0; }
}

.auth-animate-slide-up {
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-animate-fade-in {
  animation: fadeIn 0.4s ease;
}

.auth-animate-scale-in {
  animation: scaleIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* === CHECKMARK ANIMATION === */
.auth-checkmark {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  animation: scaleIn 0.3s ease;
}

.auth-checkmark svg {
  width: 28px;
  height: 28px;
}

.auth-checkmark-path {
  stroke-dasharray: 1000;
  stroke-dashoffset: 0;
  animation: checkmarkDraw 0.6s ease forwards;
}

@keyframes checkmarkDraw {
  from { stroke-dashoffset: 1000; }
  to { stroke-dashoffset: 0; }
}

/* === LOADING SPINNER === */
.auth-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

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

/* === CONFETTI EFFECT === */
.auth-confetti-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 10;
}

.auth-confetti-piece {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  animation: confettiFall 1.5s ease-out forwards;
}

@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(300px) rotate(720deg); opacity: 0; }
}

/* === PASSKEY ICON === */
.auth-passkey-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.1));
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 36px;
  box-shadow: 0 8px 32px rgba(245, 158, 11, 0.15);
  animation: pulse 2s ease-in-out infinite;
}

/* === SUCCESS ILLUSTRATION === */
.auth-success-illustration {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto;
}

/* === RESPONSIVE === */
@media (max-width: 640px) {
  .auth-glass-card {
    border-radius: 24px 24px 0 0;
    margin: 0;
  }

  .auth-btn-passkey {
    font-size: 16px;
    padding: 16px 20px;
  }

  .auth-stepper-line {
    width: 32px;
  }
}

/* === TRANSITION GROUP === */
.auth-step-enter {
  opacity: 0;
  transform: translateY(20px);
}

.auth-step-enter-active {
  opacity: 1;
  transform: translateY(0);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-step-exit {
  opacity: 1;
  transform: translateY(0);
}

.auth-step-exit-active {
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.3s ease;
}
