/* ============================================
   VARIABLES Y CONFIGURACIÓN
   ============================================ */
:root {
  --primary: #2563EB;
  --primary-dark: #1d4ed8;
  --primary-light: #3b82f6;
  --dark: #0F172A;
  --white: #FFFFFF;
  --accent: #22C55E;
  --accent-light: #4ade80;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   ESTILOS GLOBALES
   ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--gray-50);
  color: var(--dark);
  overflow: hidden;
}

/* ============================================
   CONTENEDOR PRINCIPAL
   ============================================ */
.container {
  display: flex;
  height: 100vh;
  background: var(--white);
}

/* ============================================
   LADO IZQUIERDO - BRANDING
   ============================================ */
.left {
  flex: 1;
  background: linear-gradient(135deg, var(--dark) 0%, #1a2f4f 100%);
  color: var(--white);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.left-content {
  position: relative;
  z-index: 10;
  width: 100%;
  padding: 60px 50px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

/* DECORACIÓN DE FONDO */
.bg-decoration {
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.15) 0%, transparent 70%);
  top: -100px;
  right: -100px;
  z-index: 1;
  animation: float 6s ease-in-out infinite;
}

.bg-decoration::before {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 197, 94, 0.1) 0%, transparent 70%);
  bottom: -50px;
  left: -50px;
  animation: float 8s ease-in-out infinite reverse;
}

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

/* SECCIÓN DE BRANDING */
/* SECCIÓN DE BRANDING */
.brand-section {
  text-align: center;
  margin-bottom: 40px;
  animation: slideInDown 0.8s ease-out;
}

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

.brand-label {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 20px;
  text-transform: uppercase;
}

.logo-main-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 26px;
  padding: 10px 0;
}

.logo-main {
  width: 100%;
  max-width: 380px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 12px 30px rgba(37, 99, 235, 0.25));
  transition: var(--transition);
}

.logo-main:hover {
  transform: scale(1.02);
  filter: drop-shadow(0 18px 40px rgba(37, 99, 235, 0.35));
}

.brand-title {
  font-size: 2.4rem;
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
  color: var(--white);
}

.tagline {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 400;
  line-height: 1.6;
  max-width: 500px;
  margin: 0 auto;
}

/* PILARES */
.pillars {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin: 40px 0;
}

.pillar {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  transition: var(--transition);
  cursor: pointer;
}

.pillar:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(34, 197, 94, 0.3);
  transform: translateX(5px);
}

.pillar-icon {
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 1.2rem;
  font-weight: 600;
  background: rgba(34, 197, 94, 0.2);
  color: var(--accent);
}

.pillar-1 .pillar-icon { background: rgba(37, 99, 235, 0.2); color: var(--primary); }
.pillar-2 .pillar-icon { background: rgba(34, 197, 94, 0.2); color: var(--accent); }
.pillar-3 .pillar-icon { background: rgba(251, 191, 36, 0.2); color: #fbbf24; }
.pillar-4 .pillar-icon { background: rgba(168, 85, 247, 0.2); color: #d8b4fe; }

.pillar-text h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.pillar-text p {
  font-size: 0.85rem;
  opacity: 0.8;
}

/* FOOTER IZQUIERDO */
.footer-left {
  text-align: center;
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-left p {
  font-size: 0.85rem;
  opacity: 0.7;
  line-height: 1.6;
}

/* ============================================
   LADO DERECHO - AUTENTICACIÓN
   ============================================ */
.right {
  flex: 1;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}

.auth-wrapper {
  width: 100%;
  max-width: 450px;
  padding: 40px 30px;
}

.auth-container {
  width: 100%;
}

/* TABS */
.tabs-container {
  display: flex;
  position: relative;
  margin-bottom: 40px;
  background: var(--gray-100);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
}

.tab-btn {
  flex: 1;
  padding: 12px 16px;
  background: transparent;
  border: none;
  color: var(--gray-500);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border-radius: 10px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  z-index: 2;
}

.tab-btn i {
  font-size: 1rem;
}

.tab-btn.active {
  color: var(--white);
}

.tab-indicator {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 10px;
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.tab-btn:nth-child(2).active ~ .tab-indicator {
  left: calc(50% + 4px);
}

/* FORMULARIOS */
.auth-form {
  opacity: 0;
  visibility: hidden;
  position: absolute;
  width: 100%;
  transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
  transform: translateY(10px);
}

.auth-form.active {
  opacity: 1;
  visibility: visible;
  position: relative;
  transform: translateY(0);
}

.auth-form h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--dark);
}

.form-subtitle {
  font-size: 0.95rem;
  color: var(--gray-500);
  margin-bottom: 30px;
}

/* GRUPOS DE FORMULARIO */
.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.input-wrapper i {
  position: absolute;
  left: 14px;
  color: var(--gray-400);
  font-size: 1.1rem;
  pointer-events: none;
  transition: var(--transition);
}

.input-wrapper input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  border: 2px solid var(--gray-200);
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: var(--transition);
  background: var(--white);
  color: var(--dark);
}

.input-wrapper input::placeholder {
  color: var(--gray-400);
}

.input-wrapper input:focus {
  outline: none;
  border-color: var(--primary);
  background: linear-gradient(to right, rgba(37, 99, 235, 0.02), rgba(37, 99, 235, 0.02));
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.input-wrapper input:focus ~ i {
  color: var(--primary);
}

.toggle-password {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: var(--transition);
}

.toggle-password:hover {
  color: var(--primary);
  background: rgba(37, 99, 235, 0.1);
}

.password-hint {
  font-size: 0.85rem;
  color: var(--gray-500);
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.password-hint i {
  color: var(--warning);
}

/* REMEMBER & FORGOT */
.remember-forgot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  font-size: 0.9rem;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.checkbox input {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary);
}

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

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

.checkbox-terms {
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.checkbox-terms a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}

.checkbox-terms a:hover {
  text-decoration: underline;
}

/* BOTONES */
.btn-primary {
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--white);
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(37, 99, 235, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.2);
}

.btn-primary i {
  font-size: 1rem;
  transition: var(--transition);
}

.btn-primary:hover i {
  transform: translateX(4px);
}

/* DIVIDER */
.divider {
  text-align: center;
  margin: 24px 0;
  color: var(--gray-400);
  font-size: 0.9rem;
  position: relative;
}

.divider::before,
.divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: calc((100% - 100px) / 2);
  height: 1px;
  background: var(--gray-200);
}

.divider::before {
  left: 0;
}

.divider::after {
  right: 0;
}

/* LOGIN SOCIAL */
.social-login {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.social-btn {
  padding: 12px 16px;
  background: var(--gray-100);
  border: 2px solid var(--gray-200);
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--dark);
  font-family: inherit;
}

.social-btn:hover {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.05);
  color: var(--primary);
}

.google-btn:hover {
  border-color: #ea4335;
  background: rgba(234, 67, 53, 0.05);
  color: #ea4335;
}

.github-btn:hover {
  border-color: #333;
  background: rgba(51, 51, 51, 0.05);
  color: #333;
}

.social-btn i {
  font-size: 1.1rem;
}

.social-btn span {
  display: none;
}

@media (min-width: 768px) {
  .social-btn span {
    display: inline;
  }
}

/* MENSAJES */
.message {
  display: none;
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  margin-top: 20px;
  animation: slideInUp 0.3s ease-out;
}

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

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

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

.message-loading {
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  border: 1px solid rgba(37, 99, 235, 0.3);
}

.message-info {
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  border: 1px solid rgba(37, 99, 235, 0.3);
}

/* ============================================
   RESPONSIVIDAD
   ============================================ */
@media (max-width: 1024px) {
  .brand-title {
    font-size: 2rem;
  }

  .pillars {
    gap: 12px;
  }

  .pillar {
    padding: 12px;
  }

  .auth-wrapper {
    padding: 30px 20px;
  }
}

@media (max-width: 768px) {
  .container {
    flex-direction: column;
  }

  .left {
    flex: 0;
    height: auto;
    min-height: 250px;
    padding: 40px 20px;
    justify-content: flex-start;
  }

  .left-content {
    padding: 0;
    height: auto;
  }

  .brand-section {
    margin-bottom: 30px;
  }

  .logo-container {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
  }

  .logo-img {
    width: 70px;
    height: 70px;
  }

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

  .tagline {
    font-size: 0.95rem;
  }

  .pillars {
    display: none;
  }

  .footer-left {
    display: none;
  }

  .right {
    flex: 1;
  }

  .auth-wrapper {
    max-width: 100%;
    padding: 30px 20px;
  }

  .tabs-container {
    margin-bottom: 30px;
  }

  .tab-btn {
    font-size: 0.85rem;
    padding: 10px 12px;
  }

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

  .form-subtitle {
    margin-bottom: 24px;
  }

  .social-login {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .auth-wrapper {
    padding: 20px 16px;
  }

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

  .auth-form h2 {
    font-size: 1.25rem;
  }

  .form-group {
    margin-bottom: 18px;
  }

  .input-wrapper input {
    padding: 11px 12px 11px 36px;
    font-size: 16px; /* Evita zoom en iOS */
  }

  .btn-primary {
    padding: 12px 20px;
    font-size: 0.9rem;
  }

  .tabs-container {
    padding: 3px;
    gap: 3px;
  }

  .tab-btn {
    padding: 9px 10px;
    font-size: 0.8rem;
    gap: 6px;
  }

  .tab-btn i {
    font-size: 0.9rem;
  }

  .remember-forgot {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .divider {
    margin: 18px 0;
  }

  .social-btn {
    padding: 10px 12px;
    font-size: 0.85rem;
  }
}

/* ============================================
   ESTADOS DE BOTONES
   ============================================ */

button[type="submit"].disabled {
  opacity: 0.5;
  cursor: not-allowed !important;
}

button[type="submit"]:not(.disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
}

button[type="submit"]:not(.disabled):active {
  transform: translateY(0);
}

.logo-slogan {
  margin-top: 12px;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 500;
  text-align: center;
}