/* ============================================================
   CNTA · Login — layout + panel hero compartido
   ------------------------------------------------------------
   Mismo diseño que el login del Sistema de Planificación
   (planificacion-cnta/frontend/src/pages/Login). Lo consumen
   login.html y login_selector.html; el lienzo animado lo pinta
   /static/login-hero.js sobre <canvas class="hero-canvas">.
   ============================================================ */

/* ── Layout: hero flexible + panel de formulario de 420px ───── */
.login-root {
  display: flex;
  flex-direction: row;
  min-height: 100vh;
  background: var(--panel);
}

/* ── Panel hero (oscuro, animado) ───────────────────────────── */
.login-hero {
  order: 1;
  flex: 1 1 58%;
  min-height: 100vh;
  padding: 28px 36px;
  background: #0b0f0a;
  color: var(--white);
  position: relative;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.hero-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}
.hero-glow {
  position: absolute; border-radius: 50%;
  pointer-events: none; z-index: 1;
}
.hero-glow.g1 {
  bottom: -140px; left: -100px; width: 560px; height: 560px;
  background: radial-gradient(circle, rgba(127,187,0,.18) 0%, transparent 60%);
}
.hero-glow.g2 {
  top: -80px; right: -60px; width: 340px; height: 340px;
  background: radial-gradient(circle, rgba(127,187,0,.09) 0%, transparent 65%);
}
.hero-logo {
  display: inline-flex; align-items: center;
  width: fit-content;
  padding: 4px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  backdrop-filter: blur(6px);
  position: relative; z-index: 10;
}
.hero-logo-mark {
  display: flex; align-items: center; justify-content: center;
  padding: 4px 12px;
  border-radius: 999px;
}
.hero-logo-service {
  padding: 0 14px 0 12px;
  border-left: 1px solid rgba(255,255,255,.14);
  font-family: var(--font-display); font-size: 13px; font-weight: 600;
  line-height: 26px;
  color: rgba(255,255,255,.85);
  white-space: nowrap;
}
.hero-logo img { height: 26px; width: auto; object-fit: contain; display: block; }

.hero-body {
  margin-top: auto;
  padding-bottom: 12px;
  position: relative; z-index: 10;
}
.hero-eyebrow {
  font-family: var(--font-display);
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .12em;
  color: var(--lime-500);
  margin: 0 0 16px;
  display: flex; align-items: center; gap: 8px;
}
.hero-eyebrow::before {
  content: "";
  display: inline-block; width: 20px; height: 2px;
  background: var(--lime-500); border-radius: 999px;
}
.hero-body h1 {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.2vw, 42px);
  font-weight: 700; line-height: 1.12; letter-spacing: -.02em;
  color: var(--white);
  max-width: 640px;
  margin: 0 0 8px;
}
.hero-body h1 em { font-style: normal; color: var(--lime-500); }
.hero-tagline {
  font-size: 15px; line-height: 1.6;
  color: rgba(255,255,255,.66);
  max-width: 400px;
  margin: 12px 0 0;
}
.hero-chips {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 24px 0 0; padding: 0;
  list-style: none;
}
.hero-chips li {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.04);
  backdrop-filter: blur(4px);
  font-family: var(--font-display); font-size: 12px; font-weight: 600;
  color: rgba(255,255,255,.72);
}
.hero-chips li::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--lime-500); flex-shrink: 0;
}
.hero-footer {
  margin: 36px 0 0;
  font-size: 12px;
  color: rgba(255,255,255,.45);
  position: relative; z-index: 10;
}

/* ── Panel de formulario (blanco, 420px) ────────────────────── */
.login-panel {
  order: 2;
  flex: 0 0 420px;
  min-height: 100vh;
  padding: 48px;
  background: var(--panel);
  border-left: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  position: relative;
}
/* margin-block:auto centra el form; el pie queda abajo cuando existe */
.login-form-wrap { width: 100%; max-width: 320px; margin-block: auto; }
.login-form-wrap h2 {
  font-family: var(--font-display);
  font-size: 26px; font-weight: 700; letter-spacing: -.02em;
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 6px;
}
.login-form-wrap .desc {
  font-size: 13px; line-height: 1.55;
  color: #6e6e6e;
  margin: 0 0 32px;
}
.login-form-wrap .desc strong { color: var(--ink); font-weight: 600; }

/* Nota informativa (lima + escudo) */
.login-note {
  margin-top: 20px;
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px;
  background: var(--lime-50);
  border: 1px solid rgba(127,187,0,.35);
  border-radius: var(--r-md);
  font-size: 12px; line-height: 1.5;
  color: var(--brand-700);
  text-wrap: pretty;
}
.login-note svg { flex-shrink: 0; margin-top: 1px; }
.login-note p { margin: 0; }
.login-note strong { font-weight: 700; }
.login-note a { color: inherit; font-weight: 600; }

.login-panel-footer {
  padding-top: 32px;
  width: 100%; max-width: 320px;
  text-align: center;
  font-size: 12px; line-height: 1.5; color: #6e6e6e;
}
.login-panel-footer a {
  color: var(--ink); font-weight: 600; text-decoration: none;
  border-bottom: 1px solid var(--ink-4);
}
.login-panel-footer a:hover { border-bottom-color: var(--ink); }

/* Variante discreta de la nota: texto gris con escudo, sin caja.
   Se usa cuando la nota no debe competir con los botones. */
.login-note.quiet {
  margin-top: 24px; padding: 0;
  background: none; border: 0;
  color: #6e6e6e;
}
.login-note.quiet svg { color: var(--brand-700); }

/* Botón primario oscuro (mismo look que "Iniciar sesión con Microsoft") */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; height: 48px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  background: var(--black); color: var(--white);
  font-family: var(--font-display); font-size: 15px; font-weight: 600;
  letter-spacing: .01em;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(30,30,30,.18);
  transition: background-color .15s, box-shadow .15s, transform .15s;
}
.btn-primary:hover:not(:disabled) {
  background: #2a2a2a;
  box-shadow: 0 6px 20px rgba(30,30,30,.22);
  transform: translateY(-1px);
}
.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.btn-primary:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }
.btn-primary[aria-busy="true"] { cursor: progress; opacity: .85; }
.btn-primary[aria-busy="true"]::before {
  content: "";
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.35); border-top-color: var(--white);
  animation: btn-spin .7s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* Botón secundario (outline) */
.btn-secondary {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: 48px;
  border-radius: var(--r-md);
  background: var(--panel); color: var(--ink);
  border: 1px solid var(--line);
  font-family: var(--font-display); font-size: 14px; font-weight: 600;
  text-decoration: none; cursor: pointer;
  transition: border-color .12s, background .12s;
}
.btn-secondary:hover { border-color: var(--ink-3); background: var(--bg-soft); }

/* Icono Microsoft (4 cuadrados de marca) */
.ms-icon {
  width: 18px; height: 18px;
  display: inline-grid;
  grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px;
  flex-shrink: 0;
}
.ms-icon span { border-radius: 1px; }
.ms-icon span:nth-child(1) { background: #f25022; }
.ms-icon span:nth-child(2) { background: #7fba00; }
.ms-icon span:nth-child(3) { background: #00a4ef; }
.ms-icon span:nth-child(4) { background: #ffb900; }

@media (prefers-reduced-motion: reduce) {
  .btn-primary, .btn-primary:hover:not(:disabled) { transform: none; transition: background-color .15s; }
  .btn-primary[aria-busy="true"]::before { animation-duration: 2s; }
}

/* ── Responsive: banda de marca compacta + formulario ──────────
   En móvil el hero se reduce a una banda oscura con el logo y el
   nombre del servicio; el titular, chips y pie se ocultan para que
   el formulario quede visible sin scroll. */
@media (max-width: 767px) {
  .login-root { flex-direction: column; }
  .login-hero {
    order: 1;
    flex: none;
    min-height: 0;
    padding: 16px 24px;
  }
  .hero-glow.g1 { bottom: -360px; }
  .hero-body, .hero-footer { display: none; }
  .hero-logo-service { white-space: normal; line-height: 1.25; padding-block: 4px; }
  .login-panel {
    order: 2;
    flex: 1 0 auto;
    width: 100%;
    min-height: 0;
    padding: 32px 24px 24px;
    border-left: 0;
  }
  .login-form-wrap { margin-block: 0 auto; }
  .login-form-wrap, .login-panel-footer { max-width: 100%; }
}

/* Skip link a11y */
.skip-link {
  position: absolute; left: -9999px; top: 8px;
  background: var(--ink); color: var(--white);
  padding: 8px 12px; border-radius: 6px;
  z-index: 100; font-weight: 600; text-decoration: none;
}
.skip-link:focus { left: 8px; }
