/* ===========================================================================
   auth.css — Estilos aislados para las páginas de autenticación (split-screen).
   Scopeado bajo .auth-page-body / .auth-card para no filtrar al resto de la app.
   Usa exclusivamente los tokens de custom.css (--primary, --bg-*, --text-*, ...).
   =========================================================================== */

.auth-page-body {
  min-height: 100vh;
  background: var(--bg-body);
  color: var(--text-primary);
  margin: 0;
}

.auth-wrap {
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  box-sizing: border-box;
}

.auth-card {
  width: 100%;
  max-width: 960px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.12);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr;
}

.auth-copyright {
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

/* ---------- Panel de marca (izquierda) ---------- */
.auth-brand {
  position: relative;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #ffffff;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-brand-logo img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.14);
  padding: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.auth-brand-title {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
}

.auth-brand-subtitle {
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.82);
  margin: 0;
}

.auth-features {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-feature {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-feature-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #ffffff;
}

.auth-feature-label {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
}

.auth-feature-sub {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.3;
}

/* ---------- Panel del formulario (derecha) ---------- */
.auth-panel {
  background: var(--bg-card);
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-panel-inner {
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
}

.auth-heading {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 4px;
}

.auth-subheading {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 22px;
}

/* ---------- Alertas ---------- */
.auth-alert {
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  line-height: 1.4;
}

.auth-alert-danger {
  background: rgba(239, 68, 68, 0.10);
  color: #b91c1c;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.auth-alert-warning {
  background: rgba(245, 158, 11, 0.10);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.auth-alert-info {
  background: var(--primary-bg);
  color: var(--primary-dark);
  border: 1px solid var(--primary-border);
}

[data-theme="dark"] .auth-alert-danger { color: #fca5a5; }
[data-theme="dark"] .auth-alert-warning { color: #fcd34d; }
[data-theme="dark"] .auth-alert-info { color: var(--primary-light); }

/* ---------- Campos ---------- */
.auth-form-group {
  margin-bottom: 16px;
}

.auth-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.auth-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.auth-label-row a {
  font-size: 12px;
  color: var(--primary);
  text-decoration: none;
}

.auth-label-row a:hover { text-decoration: underline; }

.auth-field {
  position: relative;
}

.auth-field-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

.auth-input {
  width: 100%;
  height: 48px;
  box-sizing: border-box;
  padding: 0 44px 0 40px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 16px; /* evita zoom en iOS */
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-input::placeholder { color: var(--text-muted); }

.auth-input:focus,
.auth-input:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-bg);
}

.auth-eye {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-eye:hover { color: var(--text-secondary); }
.auth-eye:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- Fila recordar / olvidada ---------- */
.auth-row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  gap: 12px;
  flex-wrap: wrap;
}

.auth-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}

.auth-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.auth-link {
  font-size: 13px;
  color: var(--primary);
  text-decoration: none;
}
.auth-link:hover { text-decoration: underline; }

/* ---------- Botones ---------- */
.auth-btn {
  width: 100%;
  height: 48px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.auth-btn-primary {
  background: var(--primary);
  color: #ffffff;
}
.auth-btn-primary:hover { background: var(--primary-dark); color: #ffffff; }
.auth-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.auth-btn-google {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-color);
}
.auth-btn-google:hover { background: var(--bg-input); color: var(--text-primary); }

.auth-btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary-border);
}
.auth-btn-outline:hover { background: var(--primary-bg); color: var(--primary); }

.auth-btn-danger-outline {
  background: transparent;
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.4);
}
.auth-btn-danger-outline:hover { background: rgba(239, 68, 68, 0.10); color: #ef4444; }

.auth-btn-sm { height: 40px; font-size: 13px; }

/* ---------- Divisor "o" ---------- */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 13px;
  margin: 18px 0;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

/* ---------- Footer del formulario ---------- */
.auth-footer {
  margin-top: 22px;
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
}
.auth-footer a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}
.auth-footer a:hover { text-decoration: underline; }

/* ---------- Toggle de tema flotante ---------- */
.auth-theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  z-index: 50;
}
.auth-theme-toggle:hover { color: var(--primary); }

/* ---------- Lista de conexiones sociales (/accounts/3rdparty/) ---------- */
.auth-connection {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  margin-bottom: 12px;
  background: var(--bg-input);
}
.auth-connection-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.auth-connection-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.auth-connection-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.auth-connection-sub { font-size: 12px; color: var(--text-muted); }

/* ===========================================================================
   Desktop: split 50/50
   =========================================================================== */
@media (min-width: 992px) {
  .auth-card {
    grid-template-columns: 1fr 1fr;
  }
  .auth-brand {
    padding: 44px 40px;
  }
  .auth-panel {
    padding: 48px 44px;
  }
}

/* ===========================================================================
   Móvil (< 992px): una columna, panel de marca compacto arriba
   =========================================================================== */
@media (max-width: 991.98px) {
  .auth-brand {
    padding: 24px 22px;
    gap: 12px;
  }
  .auth-brand-logo img { width: 56px; height: 56px; }
  .auth-brand-title { font-size: 21px; }
  .auth-features { display: none; } /* se colapsa la franja: solo marca + título */
}

@media (max-width: 480px) {
  .auth-wrap { padding: 0; }
  .auth-card { border-radius: 0; border: none; min-height: 100vh; }
  .auth-copyright { display: none; }
}
