/* Variables de colores Quiniela para Auth */
:root {
  --quiniela-primary: #2d68cb;
  --quiniela-primary-dark: #0b398a;
  --quiniela-secondary: #12233f;
  --quiniela-accent: #ffb347;
  --quiniela-success: #10b981;
  --quiniela-warning: #f59e0b;
  --quiniela-error: #ef4444;
  --quiniela-gray-50: #f9fafb;
  --quiniela-gray-100: #f3f4f6;
  --quiniela-gray-200: #e5e7eb;
  --quiniela-gray-300: #d1d5db;
  --quiniela-gray-400: #9ca3af;
  --quiniela-gray-500: #6b7280;
  --quiniela-gray-600: #4b5563;
  --quiniela-gray-700: #374151;
  --quiniela-gray-800: #1f2937;
  --quiniela-gray-900: #111827;
}

/* Reset y base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--quiniela-gray-900);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Container principal */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  position: relative;
}

/* Background con imagen de fútbol mejorado */
.auth-background {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url("https://hebbkx1anhila5yf.public.blob.vercel-storage.com/login-background-EzcG3NX7r4Fvl00OVQQq5zNRsW8sp4.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: -2;
  animation: slowZoom 30s ease-in-out infinite alternate;
}

@keyframes slowZoom {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.05);
  }
}

.pattern-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.8) 0%,
    rgba(20, 30, 48, 0.9) 50%,
    rgba(0, 0, 0, 0.8) 100%
  );
  z-index: -1;
}

.pattern-overlay::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: radial-gradient(
    circle at 20% 50%,
    rgba(255, 165, 0, 0.1) 0%,
    transparent 50%
  ),
  radial-gradient(
    circle at 80% 80%,
    rgba(255, 215, 0, 0.1) 0%,
    transparent 50%
  );
  animation: pulseGlow 8s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

/* Card principal mejorado */
.auth-card {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(30px);
  border-radius: 24px;
  box-shadow: 
    0 30px 60px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  width: 100%;
  max-width: 480px;
  overflow: hidden;
  animation: slideUp 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  transform-style: preserve-3d;
}

.auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(
    90deg,
    var(--quiniela-secondary),
    var(--quiniela-primary),
    var(--quiniela-accent),
    var(--quiniela-primary),
    var(--quiniela-secondary)
  );
  background-size: 200% 100%;
  animation: shimmer 4s linear infinite;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(50px) rotateX(10deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotateX(0deg);
  }
}

/* Header del card mejorado */
.auth-header {
  background: linear-gradient(
    135deg,
    var(--quiniela-primary) 0%,
    var(--quiniela-primary-dark) 100%
  );
  color: white;
  padding: 3rem 2rem 2.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.auth-header::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 70%
  );
  animation: rotate 20s linear infinite;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.auth-header::after {
  content: "";
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 25px solid transparent;
  border-right: 25px solid transparent;
  border-top: 15px solid var(--quiniela-primary-dark);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.brand-section {
  position: relative;
  z-index: 1;
}

.brand-logo {
  height: 60px;
  width: auto;
  margin-bottom: 1.5rem;
  filter:  drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

.auth-header h1 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  letter-spacing: -0.5px;
}

.auth-header p {
  opacity: 0.95;
  font-size: 1.05rem;
  font-weight: 400;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Contenedor del formulario */
.auth-form-container {
  padding: 2.5rem;
}

/* Alertas mejoradas */
.alert {
  padding: 1.25rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  font-weight: 500;
  animation: slideInAlert 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.alert::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: currentColor;
}

@keyframes slideInAlert {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.alert i {
  font-size: 1.3rem;
  margin-top: 0.1rem;
  animation: bounce 0.6s ease;
}

@keyframes bounce {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}

.alert-error {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%);
  color: var(--quiniela-error);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert-success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
  color: var(--quiniela-success);
  border: 1px solid rgba(16, 185, 129, 0.3);
  flex-direction: column;
  align-items: stretch;
}

.success-actions {
  margin-top: 1rem;
}

.btn-success-action {
  background: var(--quiniela-success);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  display: inline-block;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-success-action:hover {
  background: #059669;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

/* Formulario mejorado */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.form-group {
  position: relative;
  opacity: 0;
  animation: fadeInUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.2s; }
.form-group:nth-child(3) { animation-delay: 0.3s; }
.form-group:nth-child(4) { animation-delay: 0.4s; }
.form-group:nth-child(5) { animation-delay: 0.5s; }

.form-group label {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 600;
  color: var(--quiniela-gray-700);
  margin-bottom: 0.625rem;
  font-size: 0.95rem;
  letter-spacing: 0.3px;
}

.form-group label i {
  color: var(--quiniela-primary);
  width: 18px;
  transition: transform 0.3s ease;
}

.form-group:focus-within label i {
  transform: scale(1.2);
}

.form-group input {
  width: 100%;
  padding: 1rem 1.25rem;
  border: 2px solid var(--quiniela-gray-200);
  border-radius: 12px;
  font-size: 1rem;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  background: var(--quiniela-gray-50);
  font-weight: 500;
}

.form-group input:focus {
  outline: none;
  border-color: var(--quiniela-primary);
  background: white;
  box-shadow: 0 0 0 4px rgba(255, 165, 0, 0.12), 0 4px 12px rgba(255, 165, 0, 0.15);
  transform: translateY(-2px);
}

.form-group input::placeholder {
  color: var(--quiniela-gray-400);
  font-weight: 400;
}

/* Input border animado mejorado */
.input-border {
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--quiniela-primary),
    var(--quiniela-accent),
    var(--quiniela-primary)
  );
  background-size: 200% 100%;
  transform: scaleX(0);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-radius: 2px;
  margin-top: -2px;
}

.form-group input:focus + .input-border {
  transform: scaleX(1);
  animation: borderShimmer 2s linear infinite;
}

@keyframes borderShimmer {
  0% {
    background-position: 0% 0%;
  }
  100% {
    background-position: 200% 0%;
  }
}

/* Password input mejorado */
.password-input {
  position: relative;
}

.password-toggle {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--quiniela-gray-400);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.password-toggle:hover {
  color: var(--quiniela-primary);
  background: rgba(255, 165, 0, 0.1);
  transform: translateY(-50%) scale(1.1);
}

.password-toggle:active {
  transform: translateY(-50%) scale(0.95);
}

/* Password strength mejorado */
.password-strength {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: fadeIn 0.3s ease;
}

.strength-bar {
  flex: 1;
  height: 6px;
  background: var(--quiniela-gray-200);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.strength-fill {
  height: 100%;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}

.strength-fill::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  animation: strengthShine 2s ease-in-out infinite;
}

@keyframes strengthShine {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

.strength-weak .strength-fill {
  width: 33%;
  background: linear-gradient(90deg, var(--quiniela-error), #ff6b6b);
}

.strength-medium .strength-fill {
  width: 66%;
  background: linear-gradient(90deg, var(--quiniela-warning), #ffc107);
}

.strength-strong .strength-fill {
  width: 100%;
  background: linear-gradient(90deg, var(--quiniela-success), #34d399);
}

.strength-text {
  font-weight: 600;
  min-width: 60px;
}

/* Form options mejorado */
.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: -0.5rem;
}

/* Checkbox personalizado mejorado */
.checkbox-container {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--quiniela-gray-600);
  transition: color 0.3s ease;
}

.checkbox-container:hover {
  color: var(--quiniela-gray-900);
}

.checkbox-container input {
  display: none;
}

.checkmark {
  width: 20px;
  height: 20px;
  border: 2px solid var(--quiniela-gray-300);
  border-radius: 6px;
  position: relative;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
}

.checkbox-container:hover .checkmark {
  border-color: var(--quiniela-primary);
  transform: scale(1.05);
}

.checkbox-container input:checked + .checkmark {
  background: linear-gradient(135deg, var(--quiniela-primary), var(--quiniela-primary-dark));
  border-color: var(--quiniela-primary);
  transform: scale(1.1);
}

.checkbox-container input:checked + .checkmark::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  color: white;
  font-size: 13px;
  font-weight: bold;
  animation: checkPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes checkPop {
  to {
    transform: translate(-50%, -50%) scale(1);
  }
}

/* Enlaces mejorados */
.forgot-password,
.terms-link,
.auth-link {
  color: var(--quiniela-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  position: relative;
}

.forgot-password::after,
.terms-link::after,
.auth-link::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--quiniela-primary);
  transition: width 0.3s ease;
}

.forgot-password:hover::after,
.terms-link:hover::after,
.auth-link:hover::after {
  width: 100%;
}

.forgot-password:hover,
.terms-link:hover,
.auth-link:hover {
  color: var(--quiniela-primary-dark);
}

/* Botón principal mejorado */
.btn-primary-auth {
  background: linear-gradient(
    135deg,
    var(--quiniela-secondary) 0%,
    var(--quiniela-primary) 50%,
    var(--quiniela-primary-dark) 100%
  );
  background-size: 200% 100%;
  color: #ffffff;
  border: none;
  padding: 1.125rem 2rem;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 
    0 6px 20px rgba(255, 165, 0, 0.4),
    0 0 0 0 rgba(255, 165, 0, 0.5);
  position: relative;
  overflow: hidden;
  margin-top: 0.5rem;
}

.btn-primary-auth::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  transition: left 0.6s ease;
}

.btn-primary-auth:hover {
  background-position: 100% 0;
  transform: translateY(-3px);
  box-shadow: 
    0 10px 30px rgba(255, 165, 0, 0.5),
    0 0 0 4px rgba(255, 165, 0, 0.2);
}

.btn-primary-auth:hover::before {
  left: 100%;
}

.btn-primary-auth:active {
  transform: translateY(-1px);
  box-shadow: 
    0 4px 15px rgba(255, 165, 0, 0.4),
    0 0 0 2px rgba(255, 165, 0, 0.2);
}

.btn-primary-auth:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 6px 20px rgba(255, 165, 0, 0.4);
  }
  50% {
    box-shadow: 0 6px 20px rgba(255, 165, 0, 0.6);
  }
}

/* Divider mejorado */
.auth-divider {
  margin: 2rem 0;
  text-align: center;
  position: relative;
}

.auth-divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--quiniela-gray-300),
    transparent
  );
}

.auth-divider span {
  background: white;
  padding: 0 1.25rem;
  color: var(--quiniela-gray-500);
  font-size: 0.9rem;
  font-weight: 600;
  position: relative;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Social login mejorado */
.social-login {
  margin-bottom: 1.5rem;
  animation: fadeInUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.6s backwards;
}

.btn-social {
  width: 100%;
  padding: 1rem 1.25rem;
  border: 2px solid var(--quiniela-gray-200);
  border-radius: 12px;
  background: white;
  color: var(--quiniela-gray-700);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.875rem;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn-social::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: var(--quiniela-gray-50);
  transform: translate(-50%, -50%);
  transition: width 0.4s ease, height 0.4s ease;
}

.btn-social:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-social:not(:disabled):hover {
  border-color: var(--quiniela-gray-400);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.btn-social:not(:disabled):hover::before {
  width: 100%;
  height: 100%;
}

.btn-social i,
.btn-social span {
  position: relative;
  z-index: 1;
}

.btn-google i {
  color: #db4437;
  font-size: 1.2rem;
}

.btn-google:not(:disabled):hover {
  border-color: #db4437;
}

/* Footer del auth */
.auth-footer {
  text-align: center;
  color: var(--quiniela-gray-600);
  font-size: 0.95rem;
  margin-top: 1rem;
  animation: fadeIn 0.6s ease 0.7s backwards;
}

/* Back to home mejorado */
.back-home {
  position: absolute;
  top: 2rem;
  left: 2rem;
  z-index: 10;
  animation: slideInLeft 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.back-link {
  color: rgba(255, 255, 255, 0.95);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 600;
  transition: all 0.3s ease;
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  backdrop-filter: blur(20px);
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.back-link:hover {
  color: white;
  background: rgba(255, 255, 255, 0.25);
  transform: translateX(-4px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.back-link i {
  transition: transform 0.3s ease;
}

.back-link:hover i {
  transform: translateX(-4px);
}

/* Estados de validación mejorados */
.form-group.error input {
  border-color: var(--quiniela-error);
  background: rgba(239, 68, 68, 0.05);
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-8px);
  }
  75% {
    transform: translateX(8px);
  }
}

.form-group.success input {
  border-color: var(--quiniela-success);
  background: rgba(16, 185, 129, 0.05);
}

.error-message {
  color: var(--quiniela-error);
  font-size: 0.85rem;
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-weight: 500;
  animation: slideInError 0.3s ease;
}

@keyframes slideInError {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.error-message i {
  font-size: 0.9rem;
}

/* Responsive mejorado */
@media (max-width: 768px) {
  .auth-container {
    padding: 0.5rem;
    align-items: flex-start;
    padding-top: 1rem;
  }

  .auth-card {
    max-width: 100%;
    border-radius: 16px;
    margin: 0 auto;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
  }

  .auth-header {
    padding: 2rem 1.5rem 1.75rem;
  }

  .auth-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
  }

  .auth-header p {
    font-size: 0.95rem;
  }

  .brand-logo {
    height: 55px;
    margin-bottom: 1rem;
  }

  .auth-form-container {
    padding: 1.75rem 1.5rem;
  }

  .auth-form {
    gap: 1.5rem;
  }

  .form-group label {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
  }

  .form-group input {
    padding: 0.875rem 1rem;
    font-size: 0.95rem;
  }

  .password-toggle {
    right: 0.875rem;
    padding: 0.375rem;
  }

  .form-options {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .checkbox-container {
    font-size: 0.875rem;
  }

  .forgot-password,
  .terms-link,
  .auth-link {
    font-size: 0.875rem;
  }

  .btn-primary-auth {
    padding: 0.95rem 1.5rem;
    font-size: 0.98rem;
  }

  .btn-social {
    padding: 0.875rem 1rem;
    font-size: 0.95rem;
  }

  .alert {
    padding: 1rem;
    font-size: 0.9rem;
  }

  .auth-divider {
    margin: 1.5rem 0;
  }

  .back-home {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    right: auto;
  }

  .back-link {
    padding: 0.625rem 1rem;
    font-size: 0.9rem;
    backdrop-filter: blur(15px);
  }

  .back-link span {
    display: none;
  }

  .auth-footer {
    font-size: 0.9rem;
    margin-top: 0.75rem;
  }

  /* Ajustar animaciones para móvil */
  .auth-background {
    animation: none;
    background-attachment: scroll;
  }

  @keyframes slideUp {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

@media (max-width: 480px) {
  .auth-container {
    padding: 0.25rem;
    padding-top: 0.75rem;
  }

  .auth-card {
    border-radius: 12px;
    max-height: calc(100vh - 1.5rem);
  }

  .auth-header {
    padding: 1.75rem 1.25rem 1.5rem;
  }

  .auth-header h1 {
    font-size: 1.5rem;
    line-height: 1.2;
  }

  .auth-header p {
    font-size: 0.875rem;
    line-height: 1.4;
  }

  .brand-logo {
    height: 45px;
    margin-bottom: 0.875rem;
  }

  .auth-form-container {
    padding: 1.5rem 1.25rem;
  }

  .auth-form {
    gap: 1.25rem;
  }

  .form-group label {
    font-size: 0.875rem;
    gap: 0.5rem;
  }

  .form-group label i {
    width: 16px;
    font-size: 0.875rem;
  }

  .form-group input {
    padding: 0.8rem 0.875rem;
    font-size: 0.9rem;
    border-radius: 10px;
  }

  .password-toggle {
    right: 0.75rem;
  }

  .password-toggle i {
    font-size: 0.95rem;
  }

  .password-strength {
    font-size: 0.8rem;
    gap: 0.5rem;
    margin-top: 0.5rem;
  }

  .strength-bar {
    height: 5px;
  }

  .checkbox-container {
    font-size: 0.85rem;
  }

  .checkmark {
    width: 18px;
    height: 18px;
  }

  .btn-primary-auth {
    padding: 0.875rem 1.25rem;
    font-size: 0.95rem;
    border-radius: 10px;
    gap: 0.5rem;
  }

  .btn-social {
    padding: 0.8rem 0.875rem;
    font-size: 0.9rem;
    border-radius: 10px;
    gap: 0.625rem;
  }

  .btn-social i {
    font-size: 1.1rem;
  }

  .alert {
    padding: 0.875rem;
    font-size: 0.875rem;
    border-radius: 10px;
    gap: 0.75rem;
  }

  .alert i {
    font-size: 1.1rem;
  }

  .auth-divider {
    margin: 1.25rem 0;
    font-size: 0.85rem;
  }

  .auth-divider span {
    padding: 0 1rem;
  }

  .back-home {
    top: 0.5rem;
    left: 0.5rem;
  }

  .back-link {
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
  }

  .back-link i {
    font-size: 0.875rem;
  }

  .auth-footer {
    font-size: 0.85rem;
  }

  .error-message {
    font-size: 0.8rem;
    margin-top: 0.375rem;
  }

  .btn-success-action {
    padding: 0.625rem 1.25rem;
    font-size: 0.9rem;
  }
}

/* Optimización para pantallas muy pequeñas */
@media (max-width: 360px) {
  .auth-container {
    padding: 0.25rem;
  }

  .auth-card {
    border-radius: 10px;
  }

  .auth-header {
    padding: 1.5rem 1rem 1.25rem;
  }

  .auth-header h1 {
    font-size: 1.35rem;
  }

  .auth-header p {
    font-size: 0.825rem;
  }

  .brand-logo {
    height: 40px;
  }

  .auth-form-container {
    padding: 1.25rem 1rem;
  }

  .auth-form {
    gap: 1rem;
  }

  .form-group input {
    padding: 0.75rem;
    font-size: 0.875rem;
  }

  .btn-primary-auth,
  .btn-social {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
  }
}

/* Fix para scroll en móviles */
@media (max-width: 768px) {
  body {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .auth-card {
    -webkit-overflow-scrolling: touch;
  }

  /* Reducir animaciones en móvil para mejor performance */
  .auth-header::before {
    animation: none;
  }

  .pattern-overlay::before {
    animation: none;
    opacity: 0.7;
  }

  /* Simplificar transiciones */
  * {
    transition-duration: 0.2s !important;
    animation-duration: 0.3s !important;
  }
}

/* Loading spinner para botón */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.btn-primary-auth .fa-spinner {
  animation: spin 0.8s linear infinite;
}

/* Smooth scroll */
html {
  scroll-behavior: smooth;
}

/* Focus visible para accesibilidad */
*:focus-visible {
  outline: 2px solid var(--quiniela-primary);
  outline-offset: 2px;
}

/* Animación de fade in general */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}