/* ==========================================
   EDU21.AI — AUTH (LOGIN / REGISTRO)
   ========================================== */

.auth-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--dark);
  overflow-x: hidden;
}

/* === FONDO === */
.auth-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.25;
}
.auth-orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--purple), transparent 70%);
  top: -150px;
  left: -100px;
}
.auth-orb-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--orange), transparent 70%);
  bottom: -100px;
  right: -100px;
  opacity: 0.15;
}
.auth-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(103, 61, 230, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(103, 61, 230, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* === LOGO === */
.auth-logo {
  position: relative;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 22px;
  font-weight: 800;
  color: var(--white);
  padding: 24px 32px;
  text-decoration: none;
}

/* === WRAPPER === */
.auth-wrapper {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr 520px;
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px 48px;
  gap: 60px;
  align-items: center;
}

/* === PANEL IZQUIERDO === */
.auth-side {
  display: flex;
  align-items: center;
}
.auth-side-content h2 {
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 800;
  color: var(--white);
  line-height: 1.2;
  margin-bottom: 16px;
}
.auth-side-content > p {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 36px;
}
.auth-benefits {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 36px;
}
.auth-benefits li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.benefit-icon {
  font-size: 22px;
  flex-shrink: 0;
  margin-top: 2px;
}
.auth-benefits strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 2px;
}
.auth-benefits span {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}
.auth-testimonial {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
}
.auth-testimonial p {
  font-size: 14px;
  color: var(--text);
  font-style: italic;
  line-height: 1.6;
  margin-bottom: 12px;
}
.auth-testimonial-author {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
}

/* === PANEL FORMULARIO === */
.auth-panel {
  background: var(--dark-2);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.4);
}

/* === TABS === */
.auth-tabs {
  display: flex;
  background: var(--dark-3);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 32px;
  gap: 4px;
}
.auth-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}
.auth-tab.active {
  background: var(--purple);
  color: var(--white);
  box-shadow: 0 2px 12px rgba(103, 61, 230, 0.4);
}
.auth-tab:not(.active):hover {
  color: var(--white);
  background: rgba(255,255,255,0.06);
}

/* === FORMULARIO === */
.auth-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 6px;
}
.auth-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 28px;
  line-height: 1.5;
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.forgot-link {
  font-size: 12px;
  color: var(--purple-light);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition);
}
.forgot-link:hover { color: var(--white); }

/* Input */
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-icon {
  position: absolute;
  left: 14px;
  font-size: 15px;
  color: var(--text-muted);
  pointer-events: none;
  z-index: 1;
}
.input-wrap input,
.input-wrap select {
  width: 100%;
  padding: 12px 14px 12px 40px;
  background: var(--dark-3);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--white);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
}
.input-wrap input::placeholder { color: var(--text-muted); opacity: 0.6; }
.input-wrap input:focus,
.input-wrap select:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(103, 61, 230, 0.18);
}
.input-wrap input.error { border-color: #ef4444; }
.input-wrap input.success { border-color: #22c55e; }
.input-wrap--select::after {
  content: '▾';
  position: absolute;
  right: 14px;
  color: var(--text-muted);
  pointer-events: none;
  font-size: 12px;
}
.toggle-password {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 15px;
  color: var(--text-muted);
  padding: 4px;
  line-height: 1;
  transition: color var(--transition);
}
.toggle-password:hover { color: var(--white); }

/* Fuerza contraseña */
.password-strength {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.strength-bar {
  flex: 1;
  height: 4px;
  background: var(--dark-4);
  border-radius: 99px;
  overflow: hidden;
}
.strength-fill {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  transition: width 0.3s ease, background 0.3s ease;
}
.strength-label {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Checkbox */
.form-check {
  margin-bottom: 14px;
}
.check-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1.5;
}
.check-label input[type="checkbox"] { display: none; }
.check-custom {
  width: 18px;
  height: 18px;
  min-width: 18px;
  border: 2px solid var(--border);
  border-radius: 5px;
  background: var(--dark-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  transition: all var(--transition);
}
.check-label input:checked + .check-custom {
  background: var(--purple);
  border-color: var(--purple);
}
.check-label input:checked + .check-custom::after {
  content: '✓';
  font-size: 11px;
  color: white;
  font-weight: 700;
}
.inline-link {
  color: var(--purple-light);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Botón submit */
.btn-submit {
  margin-top: 4px;
  margin-bottom: 20px;
  font-size: 15px;
  padding: 14px;
  position: relative;
}
.btn-loader {
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Social logins */
.social-logins {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}
.social-login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px;
  background: var(--dark-3);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}
.social-login-btn:hover {
  border-color: var(--purple);
  background: rgba(103, 61, 230, 0.08);
  color: var(--white);
}

/* Switch link */
.auth-switch {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}
.switch-link {
  background: none;
  border: none;
  color: var(--purple-light);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--transition);
}
.switch-link:hover { color: var(--white); }

/* Error / éxito inline */
.field-error {
  font-size: 12px;
  color: #ef4444;
  margin-top: 4px;
  display: none;
}
.field-error.visible { display: block; }

/* Toast de notificación */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--dark-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  font-size: 14px;
  color: var(--white);
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.3s ease;
  max-width: 320px;
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}
.toast--success { border-color: rgba(34, 197, 94, 0.4); }
.toast--error   { border-color: rgba(239, 68, 68, 0.4); }

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 900px) {
  .auth-wrapper {
    grid-template-columns: 1fr;
    max-width: 520px;
  }
  .auth-side { display: none; }
  .auth-logo { padding: 20px 24px; }
}
@media (max-width: 480px) {
  .auth-panel { padding: 28px 20px; }
  .form-row { grid-template-columns: 1fr; }
  .social-logins { grid-template-columns: 1fr; }
}
