/* =====================================================================
   AUTH (Login / Registro) — mismo lenguaje visual del home.
   Todo aislado bajo .auth-v2 para no colisionar con Bootstrap
   (cargado globalmente en base.html) ni con estilo.css del sistema.
   OJO: "btn-mayor" del estilo.css global se usa en los avisos del
   sistema (base.html) — aquí no se toca ni se reutiliza, se usan
   clases propias (btn-primario) para no romper esos avisos.
   ===================================================================== */
.auth-v2 {
  --au-white: #ffffff;
  --au-surface: #F6F8FC;
  --au-line: #E4E9F2;
  --au-ink: #0F1B33;
  --au-ink-soft: #5B6B85;
  /* (2026-10) Los azules del sistema (tokens.css). */
  --au-blue-deep: var(--mc-azul-oscuro);
  --au-blue: var(--mc-azul);
  --au-blue-pale: var(--mc-azul-palido);
  --au-red: #C0392B;
  /* Auditoría 2026-10, UX-10: la misma tipografía del sistema que el resto
     de la aplicación (tokens.css), en vez de Fraunces/Inter de Google Fonts. */
  --au-font-display: var(--mc-fuente);
  --au-font-body: var(--mc-fuente);

  font-family: var(--au-font-body);
  color: var(--au-ink);
  background: var(--au-white);
}
.auth-v2 * { box-sizing: border-box; }
.auth-v2 a { text-decoration: none; }

/* =====================================================================
   REDISEÑO 2026-11 — todo al centro y el resto limpio: un fondo gris
   apenas azulado con un brillo suave de la marca arriba, el logo y una
   sola tarjeta blanca redondeada con el formulario. Sin panel lateral.
   Los selectores llevan .auth-v2 delante para mandar sobre rediseno.css.
   ===================================================================== */
.auth-split {
  min-height: 100vh;
  background:
    radial-gradient(1100px 520px at 50% -140px, rgba(0, 103, 184, 0.13), rgba(0, 103, 184, 0) 70%),
    radial-gradient(700px 360px at 50% 100%, rgba(18, 38, 47, 0.06), rgba(18, 38, 47, 0) 70%),
    var(--mc-superficie);
}
.auth-panel-form {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
}
.auth-v2 .auth-form-inner {
  width: 100%;
  max-width: 440px;
  background: var(--au-white);
  border: 1px solid var(--mc-linea);
  border-radius: 11px;
  padding: 2.4rem 2.4rem 2rem;
  box-shadow: 0 1px 2px rgba(23, 37, 47, 0.04), 0 24px 48px -28px rgba(0, 30, 50, 0.28);
}

.auth-logo {
  display: inline-block;
  margin-bottom: 1.5rem;
  line-height: 0;
  border-radius: 6px;
}
.auth-logo img { height: 42px; width: auto; }
.auth-form-inner h1 {
  font-family: var(--au-font-display);
  font-weight: 650;
  font-size: 1.55rem;
  letter-spacing: -0.01em;
  color: #17252F;
  text-align: center;
  margin: 0 0 0.4rem;
}
.auth-subtitulo { color: var(--au-ink-soft); font-size: 0.92rem; line-height: 1.5; text-align: center; margin: 0 0 1.6rem; }

.auth-v2 .btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  min-height: 48px;
  border: 1px solid #DADCE0;
  border-radius: 6px;
  padding: 0.7rem;
  background: #fff;
  color: #1F1F1F;
  font-weight: 600;
  font-size: 0.92rem;
  transition: 0.15s;
}
.auth-v2 .btn-google:hover { border-color: #C3CCD5; background: var(--mc-hover); }
/* Auditoría 2026-10, SEG-24: el botón de Google ahora es un <button> dentro de
   un formulario POST (antes un enlace); mismo aspecto. */
.form-google { margin: 0; }
button.btn-google { font-family: inherit; line-height: inherit; cursor: pointer; }

.auth-separador {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.4rem 0;
  color: var(--au-ink-soft);
  font-size: 0.8rem;
}
.auth-separador::before, .auth-separador::after { content: ""; flex: 1; height: 1px; background: var(--mc-linea); }

.campo { margin-bottom: 1rem; }
.campo label { display: block; font-size: 0.82rem; font-weight: 600; color: #17252F; margin-bottom: 0.4rem; }
.auth-v2 .campo input,
.auth-v2 .campo select,
.auth-v2 .campo textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 0.9rem;
  /* Borde de campo con contraste >= 3:1 (antes --au-line, 1,2:1). Auditoría 2026-10, UX-13 */
  border: 1px solid var(--mc-borde-campo);
  border-radius: 6px;
  font-family: var(--au-font-body);
  font-size: 0.95rem;
  color: var(--au-ink);
  background: #fff;
  transition: 0.15s;
}
.auth-v2 .campo input[type="checkbox"],
.auth-v2 .campo input[type="radio"] { width: auto; min-height: 0; padding: 0; }
.auth-v2 .campo input:focus,
.auth-v2 .campo select:focus,
.auth-v2 .campo textarea:focus {
  outline: none;
  border-color: var(--au-blue);
  background: #fff;
  /* Anillo de foco: 1px azul sólido (contraste) + el halo pálido de siempre. Auditoría 2026-10, UX-13 */
  box-shadow: 0 0 0 1px var(--au-blue), 0 0 0 4px var(--au-blue-pale);
}
.campo-error { color: var(--au-red); font-size: 0.8rem; margin-top: 0.35rem; }
.campo-error ul.errorlist { list-style: none; margin: 0; padding: 0; }
.auth-v2 .campo-error[role="alert"] { background: var(--mc-peligro-fondo); border: 0; border-radius: 6px; padding: 0.7rem 0.9rem; font-size: 0.85rem; }
.campo-ayuda { color: var(--au-ink-soft); font-size: 0.78rem; margin-top: 0.35rem; line-height: 1.4; }

.auth-icono-check {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--mc-exito-fondo);
  color: var(--mc-exito);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 auto 1.25rem;
}

.auth-v2 .btn-primario {
  width: 100%;
  min-height: 48px;
  background: var(--au-blue);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.8rem;
  font-weight: 700;
  font-size: 0.95rem;
  font-family: var(--au-font-body);
  cursor: pointer;
  transition: 0.15s;
}
.auth-v2 .btn-primario:hover { background: var(--au-blue-deep); }

.auth-pie { margin-top: 1.4rem; text-align: center; font-size: 0.88rem; color: var(--au-ink-soft); }
.auth-pie + .auth-pie { margin-top: 0.6rem; }
.auth-pie a { color: var(--au-blue); font-weight: 600; }
.auth-pie a:hover { text-decoration: underline; }
.auth-pie-legal { font-size: 0.78rem; }

@media (max-width: 768px) { /* antes 860px (auditoría 2026-10, UX-20) */
  .auth-panel-form { justify-content: flex-start; padding: 2rem 1rem; }
  .auth-v2 .auth-form-inner { padding: 1.75rem 1.25rem 1.5rem; border-radius: 10px; }
  .auth-logo { margin-bottom: 1.25rem; }
  .auth-logo img { height: 36px; }
  .auth-form-inner h1 { font-size: 1.4rem; }
}

/* (2026-10) Crear cuenta: Nombres y Apellidos en una misma fila. */
.auth-form-registro { display: grid; grid-template-columns: 1fr 1fr; column-gap: 0.85rem; }
.auth-form-registro > * { grid-column: 1 / -1; }
.auth-form-registro > .campo-first_name { grid-column: 1; }
.auth-form-registro > .campo-last_name { grid-column: 2; }
@media (max-width: 480px) {
  .auth-form-registro > .campo-first_name, .auth-form-registro > .campo-last_name { grid-column: 1 / -1; }
}

/* Auditoría 2026-10, SEG-26: campo trampa del registro (fuera de la pantalla). */
.campo-trampa { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* (2026-11) Página de error 404 con el mismo marco (templates/404.html). */
.auth-v2 .auth-error { text-align: center; }
.auth-error-icono { width: 64px; height: 64px; margin: 0 auto 1rem; border-radius: 10px; background: var(--au-blue-pale); color: var(--au-blue); display: flex; align-items: center; justify-content: center; }
.auth-error-icono svg { width: 32px; height: 32px; }
.auth-v2 .auth-error .dash-error-codigo { display: inline-block; margin-bottom: 0.9rem; padding: 0.3rem 0.85rem; border-radius: 6px; background: var(--au-blue-pale); color: var(--au-blue); font-size: 0.82rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.auth-v2 .auth-error .dash-error-titulo { margin: 0 0 0.5rem; }
.auth-v2 .auth-error .dash-error-texto { max-width: none; margin: 0 0 1.5rem; }
.auth-error-acciones { display: flex; flex-direction: column; gap: 0.6rem; }
.auth-v2 .auth-error-acciones .btn-primario { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.auth-v2 .auth-btn-sec { display: flex; align-items: center; justify-content: center; min-height: 48px; border: 1px solid var(--mc-borde-boton, #C9D6E2); border-radius: 6px; color: var(--au-blue); background: #fff; font-weight: 600; font-size: 0.95rem; }
.auth-v2 .auth-btn-sec:hover { background: var(--mc-hover); }
.auth-v2 .dash-error-pagina { min-height: 100vh; }
