/* ============================================================
   NexCode UI — auth.css
   Estilos compartidos de Login y Registro (auth-card de 2 paneles).
   Requiere base.css cargado antes.
   Clases tomadas tal cual de los prototipos originales.
   ============================================================ */

/* Variables de escala del auth (hito 13.6): un solo lugar manda; TODO deriva
   de aquí. Ajustadas para que /registro/ (la pantalla más alta) quepa sin
   scroll a 1366×768. */
:root {
  --auth-col-max: 400px;
  --auth-logo-h: 30px;
  --auth-title: 1.65rem;
  --auth-subtitle: .9rem;
  --auth-input-h: 40px;
  --auth-gap: 12px;
  --auth-btn-h: 44px;
  --auth-link: .85rem;
}

html, body { min-height: 100%; }

body.nc-auth-body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--nc-font-body);
  color: var(--nc-ink);
  /* Degradado de la familia "2a" (misma paleta que el hero del home) */
  background: linear-gradient(155deg, #070D1A 0%, #0A1226 55%, #0C1730 100%);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.shell { position: relative; z-index: 1; min-height: 100vh; padding: 32px; display: grid; place-items: center; }

/* Tarjeta exterior: ancho y alto acotados, ALTO se ajusta al contenido y queda
   CENTRADA en el viewport con el fondo de página visible por los 4 lados. */
.auth-card {
  width: 100%;
  max-width: 1080px;
  /* min-height > alto del contenido de registro → al centrar (justify-content)
     queda holgura pareja arriba y abajo; nunca roza el borde inferior. */
  min-height: 680px;
  max-height: calc(100vh - 64px);
  height: auto;
  display: grid;
  grid-template-columns: minmax(340px, .9fr) minmax(440px, 1.1fr);
  overflow: hidden;
  border-radius: 28px;
  background: rgba(255,255,255,.98);
  border: 1px solid rgba(130,167,255,.22);
  box-shadow: var(--nc-shadow-xl);
}

/* ===== Panel visual (izquierda) ===== */
.visual-panel {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;   /* contenido centrado, proporcionado al nuevo alto */
  gap: 22px;
  padding: 48px 46px;
  color: #fff;
  /* Degradado de la familia "2a"; los circuitos/símbolos los pone el include
     fondo_tecnologico (variante panel). */
  background: linear-gradient(165deg, #070D1A 0%, #0A1226 55%, #0C1730 100%);
}
/* Banner de fondo (hito 13.1): imagen del negocio con overlay azul encima para
   que el texto blanco siga legible. Solo cuando la página subió su banner. */
.visual-panel--banner {
  background-image:
    linear-gradient(155deg, rgba(10,23,56,.86) 0%, rgba(11,27,69,.82) 54%, rgba(8,39,95,.86) 100%),
    var(--auth-banner);
  background-size: cover;
  background-position: center;
}
/* La retícula (::before) y el glow (::after) del panel visual se retiraron:
   ahora el fondo "2a" (include fondo_tecnologico, variante panel) provee glow +
   circuitos + símbolos. El contenido va por encima con z-index. */
.brand-mini {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  width: fit-content;
  font-family: var(--nc-font-display);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -.03em;
}
.brand-mark {
  width: 36px; height: 36px;
  border: 1px solid rgba(157,187,255,.25);
  border-radius: 10px;
  display: grid; place-items: center;
  background: rgba(46,107,246,.12);
  box-shadow: inset 0 0 24px rgba(46,107,246,.08);
}
.brand-mark span { font-family: var(--nc-font-mono); font-size: 18px; color: #8FB0FF; font-weight: 700; }

.visual-center { position: relative; z-index: 2; text-align: center; margin: 0; padding: 0; }
.visual-center h1 {
  font-family: var(--nc-font-display);
  font-size: clamp(23px, 2.4vw, 30px);
  line-height: 1.14;
  margin: 0 0 10px;
  font-weight: 800;
  letter-spacing: -.035em;
}
.visual-center p { width: min(380px, 100%); margin: 0 auto; color: rgba(226,233,248,.82); font-size: var(--auth-subtitle); line-height: 1.55; }

.hero-logo-wrap {
  width: 148px; height: 148px;
  margin: 0 auto 14px;
  position: relative;
  display: grid; place-items: center;
  animation: float 5.4s ease-in-out infinite;
}
.hero-logo-wrap::before {
  content: '';
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(46,107,246,.34), rgba(46,107,246,.08) 44%, transparent 72%);
  filter: blur(22px);
}
.hero-logo-wrap img {
  position: relative;
  z-index: 2;
  width: 128px;
  max-height: 128px;
  object-fit: contain;
  filter: drop-shadow(0 18px 34px rgba(21,81,212,.32));
}

.trust-row {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 14px;
}
.trust-item { text-align: center; padding: 12px 8px 5px; border-top: 1px solid rgba(157,187,255,.11); }
.trust-icon {
  width: 38px; height: 38px;
  margin: 0 auto 7px;
  display: grid; place-items: center;
  border-radius: 12px;
  color: #6F98FF;
  background: rgba(46,107,246,.08);
  border: 1px solid rgba(91,141,255,.12);
}
.trust-item strong { display: block; font-family: var(--nc-font-display); font-size: 14px; margin-bottom: 3px; }
.trust-item span { display: block; color: rgba(196,210,240,.68); font-size: 12px; line-height: 1.35; }

/* ===== Panel de formulario (derecha) ===== */
.form-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;   /* contenido centrado vertical → cero cola muerta */
  align-items: center;
  padding: 48px;             /* espacio superior e inferior visualmente igual */
  background:
    radial-gradient(circle at 88% 8%, rgba(46,107,246,.07), transparent 30%),
    #FFFFFF;
}
.form-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent 0%, #2E6BF6 50%, transparent 100%);
  opacity: .42;
}

.form-content { width: min(var(--auth-col-max), 100%); }   /* columna compacta */

.logo-wrap { display: flex; justify-content: center; margin-bottom: var(--auth-gap); }
.logo-wrap img { height: var(--auth-logo-h); max-width: min(230px, 70vw); object-fit: contain; display: block; mix-blend-mode: multiply; }

.form-title { text-align: center; margin-bottom: calc(var(--auth-gap) * 1.4); }
.form-title h2 {
  margin: 0 0 4px;
  font-family: var(--nc-font-display);
  font-size: var(--auth-title);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -.04em;
  color: var(--nc-ink);
}
.form-title p { margin: 0; font-size: var(--auth-subtitle); color: var(--nc-ink-soft); }

/* ===== Campos ===== */
.field { margin-bottom: var(--auth-gap); }

.input-shell {
  height: var(--auth-input-h);
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 14px;
  background: #fff;
  border: 1px solid rgba(11,18,38,.14);
  border-radius: var(--nc-radius-input);
  box-shadow: 0 4px 14px rgba(11,18,38,.045);
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.input-shell:focus-within {
  border-color: rgba(46,107,246,.68);
  box-shadow: 0 0 0 4px rgba(46,107,246,.10), 0 10px 26px rgba(46,107,246,.07);
  transform: translateY(-1px);
}
.input-icon { flex: 0 0 auto; width: 24px; height: 24px; color: var(--nc-blue); display: grid; place-items: center; }
.input-icon svg { width: 22px; height: 22px; }
.input-shell input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--nc-ink);
  font: 500 15px var(--nc-font-body);
}
.input-shell input::placeholder { color: #7A8499; font-weight: 400; }

.password-toggle {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #526078;
  cursor: pointer;
  display: grid; place-items: center;
  transition: color .2s, background .2s;
}
.password-toggle:hover { color: var(--nc-blue); background: rgba(46,107,246,.08); }
.password-toggle svg { width: 20px; height: 20px; }

/* ===== Fila meta (recordarme / olvidé) ===== */
.meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: var(--auth-gap) 2px calc(var(--auth-gap) * 1.4);
  font-size: var(--auth-link);
}
.remember { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; color: #334155; user-select: none; position: relative; }
.remember input { position: absolute; opacity: 0; pointer-events: none; }
.checkmark {
  width: 22px; height: 22px;
  border: 1px solid rgba(11,18,38,.18);
  border-radius: 6px;
  display: grid; place-items: center;
  background: #fff;
  color: transparent;
  transition: .2s;
}
.remember input:checked + .checkmark {
  background: linear-gradient(135deg, #3E7BFF, #2E6BF6);
  border-color: var(--nc-blue);
  color: #fff;
  box-shadow: 0 4px 10px rgba(46,107,246,.25);
}
.forgot { color: var(--nc-blue-dark); text-decoration: none; font-weight: 500; }
.forgot:hover { text-decoration: underline; }

/* ===== Botón principal del formulario ===== */
.primary-btn {
  width: 100%;
  height: var(--auth-btn-h);
  border: 0;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #fff;
  background: linear-gradient(135deg, #3E7BFF 0%, #2E6BF6 55%, #1D4ED8 100%);
  box-shadow: 0 14px 30px rgba(46,107,246,.28);
  font: 700 15px var(--nc-font-display);
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, filter .2s;
}
.primary-btn svg { width: 18px; height: 18px; }
.primary-btn:hover { transform: translateY(-2px); box-shadow: 0 18px 36px rgba(46,107,246,.38); filter: saturate(1.08); }
.primary-btn:active { transform: translateY(0); }

/* ===== Divisor / enlaces secundarios ===== */
.divider {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  margin: calc(var(--auth-gap) * 1.3) 0 var(--auth-gap);
  color: #94A3B8;
  font-size: 13px;
}
.divider::before, .divider::after { content: ''; height: 1px; flex: 1; background: linear-gradient(90deg, transparent, rgba(11,18,38,.13)); }
.divider::after { background: linear-gradient(90deg, rgba(11,18,38,.13), transparent); }

.secondary-link {
  width: 100%;
  min-height: var(--auth-btn-h);
  border: 1px solid rgba(11,18,38,.10);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--nc-ink);
  text-decoration: none;
  background: #F8FAFD;
  font-family: var(--nc-font-display);
  font-weight: 600;
  font-size: var(--auth-link);
  transition: border-color .2s, background .2s, transform .2s;
}
.secondary-link:hover { border-color: rgba(46,107,246,.28); background: rgba(46,107,246,.045); transform: translateY(-1px); }

.register-copy { text-align: center; margin: calc(var(--auth-gap) * 1.3) 0 0; color: #334155; font-size: var(--auth-link); }
.register-copy a { color: var(--nc-blue-dark); text-decoration: none; font-weight: 600; margin-left: 5px; }
.register-copy a:hover { text-decoration: underline; }

/* ===== Extras del registro ===== */
.register-form .field { margin-bottom: calc(var(--auth-gap) - 3px); }
.register-form .input-shell { height: var(--auth-input-h); }
.terms-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 4px 2px calc(var(--auth-gap) * 1.3);
  color: #334155;
  font-size: var(--auth-link);
  line-height: 1.45;
}
.terms-row input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--nc-blue); cursor: pointer; }
.terms-row a { color: var(--nc-blue-dark); font-weight: 600; text-decoration: none; }
.terms-row a:hover { text-decoration: underline; }
.password-hint { margin: -4px 4px calc(var(--auth-gap) - 2px); color: #7A8499; font-size: 12px; }

/* ===== Toast (alias del prototipo original) ===== */
.toast {
  position: fixed;
  z-index: 50;
  right: 24px;
  bottom: 24px;
  max-width: 360px;
  padding: 14px 18px;
  border-radius: 14px;
  color: #fff;
  background: var(--nc-navy);
  box-shadow: 0 18px 40px rgba(2,8,30,.32);
  border: 1px solid rgba(91,141,255,.22);
  transform: translateY(26px);
  opacity: 0;
  pointer-events: none;
  transition: .28s ease;
  font-size: 14px;
}
.toast.show { transform: translateY(0); opacity: 1; }

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

/* ===== Responsive ===== */
@media (max-width: 1080px) {
  .shell { padding: 24px; }
  .auth-card { grid-template-columns: 1fr 1.1fr; max-height: calc(100vh - 48px); }
  .visual-panel { padding: 40px 30px; }
  .form-panel { padding: 42px 40px; }
  .hero-logo-wrap { width: 140px; height: 140px; }
  .hero-logo-wrap img { width: 120px; max-height: 120px; }
  .trust-row { gap: 8px; }
}

@media (max-width: 820px) {
  /* móvil: tarjeta a ancho completo con margen pequeño, apilada, con scroll */
  .shell { padding: 14px; min-height: 100vh; display: grid; place-items: center; }
  .auth-card {
    width: 100%; max-width: 560px;
    min-height: auto; max-height: none; height: auto;
    border-radius: 20px; grid-template-columns: 1fr;
    border: 1px solid rgba(130,167,255,.22);
  }
  .visual-panel { min-height: 300px; justify-content: flex-start; gap: 0; padding: 26px 24px 30px; }
  .brand-mini { margin-bottom: 8px; }
  .visual-center { padding: 10px 0 18px; }
  .hero-logo-wrap { width: 118px; height: 118px; margin-bottom: 10px; }
  .hero-logo-wrap img { width: 104px; max-height: 104px; }
  .visual-center h1 { font-size: 28px; margin-bottom: 8px; }
  .visual-center p { font-size: 14.5px; max-width: 390px; }
  .trust-row { margin-top: 8px; }
  .trust-item span { display: none; }
  .form-panel { padding: 34px 22px 38px; }
  .logo-wrap { margin-bottom: 16px; }
  .logo-wrap img { height: 42px; }
  .form-title { margin-bottom: 22px; }
}

@media (max-width: 520px) {
  .visual-panel { min-height: 300px; }
  .trust-icon { width: 36px; height: 36px; }
  .trust-item strong { font-size: 12.5px; }
  .form-panel { padding-left: 18px; padding-right: 18px; }
  .input-shell { height: 46px; padding: 0 14px; }
  .register-form .input-shell { height: 46px; }
  .meta-row { align-items: flex-start; flex-direction: column; gap: 10px; }
  .primary-btn { height: 48px; }
  .logo-wrap img { height: 38px; }
  .form-title h2 { font-size: 30px; }
  .form-title p { font-size: 14px; }
  .toast { left: 16px; right: 16px; bottom: 16px; max-width: none; }
}
