/* ADFAM 21 — Acceso Unificado
   Paleta alineada a la landing: navy casi negro + degradado cian → azul
   Tipografía: Inter (marca, titular e interfaz) */

:root {
  --bg-900: #0A0E16;
  --bg-800: #0D1220;
  --bg-700: #121A2C;

  --panel-800: #0F1626;
  --field-800: #141C30;
  --border-700: #232E45;

  --slate-300: #B9C2D4;
  --slate-400: #94A3B8;
  --slate-500: #6B7793;

  --cyan-400: #22D3EE;
  --blue-500: #3B82F6;
  --blue-600: #2563EB;

  --white: #F5F8FC;

  --focus-ring: 0 0 0 3px rgba(34, 211, 238, 0.25);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--white);
  background: var(--bg-900);
}

/* ---------- BOTÓN VOLVER ---------- */

.btn-back {
  position: fixed;
  top: 1.5rem;
  left: 1.5rem;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.9rem 0.5rem 0.75rem;
  border-radius: 999px;
  background: rgba(15, 22, 38, 0.7);
  border: 1px solid var(--border-700);
  backdrop-filter: blur(6px);
  color: var(--slate-300);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.btn-back:hover {
  color: var(--white);
  border-color: var(--cyan-400);
  transform: translateX(-2px);
}

.auth-shell {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  min-height: 100vh;
}

/* ---------- PANEL DE MARCA ---------- */

.brand-panel {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  background:
    radial-gradient(120% 140% at 12% 8%, #101B32 0%, var(--bg-800) 55%, var(--bg-900) 100%);
  padding: 4rem 3.5rem;
  border-right: 1px solid var(--border-700);
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
}

.glow-a {
  width: 340px;
  height: 340px;
  top: -120px;
  left: -80px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.28) 0%, transparent 70%);
}

.glow-b {
  width: 380px;
  height: 380px;
  bottom: -160px;
  right: -100px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.22) 0%, transparent 70%);
}

.stitch-pattern {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.5;
  pointer-events: none;
}

.brand-panel-inner {
  position: relative;
  z-index: 1;
  max-width: 400px;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 2.75rem;
}

.brand-mark-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--cyan-400), var(--blue-500));
  color: var(--bg-900);
  font-size: 1rem;
  flex-shrink: 0;
}

.brand-mark-text {
  font-weight: 800;
  font-size: 1.45rem;
  letter-spacing: -0.01em;
  color: var(--white);
}

.brand-mark-text sup {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--cyan-400);
  top: -0.7em;
}

.brand-line {
  font-weight: 700;
  font-size: clamp(1.6rem, 2.4vw, 2.1rem);
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--white);
  margin: 0 0 1.1rem;
  max-width: 20ch;
}

.brand-sub {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--slate-400);
  max-width: 34ch;
  margin: 0 0 2.5rem;
}

.brand-portals {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.brand-portals li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.85rem;
  color: var(--slate-300);
}

.brand-portals li::before {
  content: '';
  width: 14px;
  height: 2px;
  border-radius: 1px;
  background: linear-gradient(90deg, var(--cyan-400), var(--blue-500));
  flex-shrink: 0;
}

.brand-trust {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 2.75rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-700);
  font-size: 0.78rem;
  color: var(--slate-500);
  max-width: 30ch;
}

.brand-trust svg { flex-shrink: 0; color: var(--slate-500); }

/* ---------- PANEL DE FORMULARIO ---------- */

.form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-900);
  padding: 2.5rem 2rem;
}

.form-card {
  width: 100%;
  max-width: 400px;
  animation: rise-in 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.form-card-inner {
  background: var(--panel-800);
  border: 1px solid var(--border-700);
  border-radius: 18px;
  padding: 2.5rem 2.25rem;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.55);
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.form-header h1 {
  font-weight: 800;
  font-size: 1.7rem;
  letter-spacing: -0.01em;
  color: var(--white);
  margin: 0 0 0.5rem;
}

.form-header p {
  font-size: 0.9rem;
  color: var(--slate-400);
  line-height: 1.55;
  margin: 0 0 2rem;
}

.clean-form {
  display: flex;
  flex-direction: column;
  gap: 1.3rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.input-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--slate-300);
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 0.9rem;
  color: var(--slate-500);
  pointer-events: none;
  transition: color 0.15s ease;
}

.input-wrap:focus-within .input-icon { color: var(--cyan-400); }

.input-group input {
  width: 100%;
  font-family: inherit;
  font-size: 0.94rem;
  color: var(--white);
  background: var(--field-800);
  border: 1px solid var(--border-700);
  border-radius: 10px;
  padding: 0.78rem 0.95rem 0.78rem 2.6rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input-group input::placeholder {
  color: var(--slate-500);
}

.input-group input:focus {
  outline: none;
  border-color: var(--cyan-400);
  box-shadow: var(--focus-ring);
}

.input-group input[type="password"] {
  padding-right: 2.75rem;
}

.btn-toggle-pass {
  position: absolute;
  right: 0.6rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--cyan-400);
  font-family: inherit;
}

.btn-toggle-pass:hover { color: var(--blue-500); }

.btn-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 0.85rem;
  margin-top: 0.35rem;
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--white);
  background: linear-gradient(135deg, var(--cyan-400), var(--blue-500));
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.1s ease;
}

.btn-submit svg { transition: transform 0.15s ease; }
.btn-submit:hover:not(:disabled) svg { transform: translateX(3px); }

.btn-submit:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-submit:active:not(:disabled) { transform: translateY(0); }

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.form-footer-note {
  margin-top: 1.5rem;
  font-size: 0.78rem;
  color: var(--slate-500);
  text-align: center;
}

/* ---------- TOAST (usado por config.js) ---------- */
#adfamToast { font-family: 'Inter', sans-serif; }

/* ---------- RESPONSIVE ---------- */

@media (max-width: 860px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .brand-panel {
    padding: 2.5rem 1.75rem;
    min-height: 220px;
    border-right: none;
    border-bottom: 1px solid var(--border-700);
  }

  .brand-panel-inner { max-width: none; }

  .brand-mark { margin-bottom: 1.25rem; }
  .brand-line { font-size: 1.3rem; max-width: none; margin-bottom: 0.6rem; }
  .brand-sub { margin-bottom: 0; max-width: none; }
  .brand-portals { display: none; }

  .form-panel { padding: 2.25rem 1.5rem 3rem; }
  .form-card-inner { padding: 2rem 1.5rem; border-radius: 16px; }
  .btn-back { top: 1rem; left: 1rem; font-size: 0.78rem; }
}

@media (prefers-reduced-motion: reduce) {
  .form-card { animation: none; }
  .btn-submit { transition: none; }
}