/* auth.css — Estilos de acceso, registro y verificación (SGDRP).
   Reutiliza la paleta del sistema (perfil.css / secciones-alumno.css):
   azul #1670c0 sobre fondo #f3f6fa, tarjetas blancas, campos #f3f7fc.
   Antes estas vistas no tenían hoja propia: las clases .auth-* no
   existían en ningún CSS y el login/registro se veía sin estilos. */
:root {
  --bg: #f3f6fa;
  --bar: #1670c0;
  --line: #d6e0ec;
  --text: #1f2d3d;
  --muted: #5b6b7d;
  --card: #fff;
  --ink: #1f2d3d;
  --ink2: #5b6b7d;
  --gold: #1670c0;
  --gold2: #2a84d6;
  --field: #f3f7fc;
  --field2: #e4eef9;
  --fline: #c5d6ea;
  --gr: 22, 112, 192;
  --hov: rgba(22, 112, 192, .1);
  --ring: rgba(22, 112, 192, .14);
  --shd: rgba(15, 60, 110, .2);
  /* Diseno de la maqueta (2cz-e, Victor): barra con degradado y
     facetas, fondo claro con facetas, sombra suave de tarjetas. */
  --bar-grad: linear-gradient(65deg, rgba(255, 255, 255, .16) 0 14%, transparent 14%), linear-gradient(65deg, transparent 42%, rgba(255, 255, 255, .09) 42% 56%, transparent 56%), linear-gradient(65deg, transparent 70%, rgba(0, 0, 0, .07) 70% 84%, transparent 84%), linear-gradient(118deg, #1e5daa 0%, #2b74c2 42%, #3a86d2 70%, #2561a9 100%);
  /* 2cz-f (2 dic 2026, Victor): mas variedad de facetas, no un solo
     triangulo grande: varios trazos diagonales de distintos angulos,
     tamanos y opacidades, como en la maqueta. */
  --bg-grad: linear-gradient(115deg, transparent 52%, rgba(255, 255, 255, .55) 52% 78%, transparent 78%), linear-gradient(65deg, rgba(219, 233, 247, .55) 0 20%, transparent 20%), linear-gradient(65deg, transparent 34%, rgba(255, 255, 255, .45) 34% 44%, transparent 44%), linear-gradient(135deg, transparent 68%, rgba(203, 222, 240, .5) 68% 84%, transparent 84%), linear-gradient(115deg, transparent 82%, rgba(255, 255, 255, .35) 82%), linear-gradient(180deg, #eef4fb 0%, #e6eff8 100%);
  --card-shadow: 0 10px 28px rgba(15, 60, 110, .10);
  --error: #b3261e;
  --errorbg: #fdecea;
  box-sizing: border-box;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg-grad);
  background-attachment: fixed;
  color: var(--text);
  font-family: 'Noto Sans', system-ui, 'Segoe UI', Arial, sans-serif;
}

/* Las fuentes de los botones tambien son Noto Sans (2cz-e, Victor):
   los controles de formulario no heredan la fuente del body por
   defecto; con font: inherit usan la misma que el resto. El diseno
   de los botones no se toca: solo la fuente. */
button,
input,
select,
textarea {
  font: inherit;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  padding: 32px 32px 28px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  box-shadow: 0 16px 40px var(--shd);
  text-align: center;
}

.auth-card--wide {
  max-width: 560px;
}

.auth-header {
  text-align: center;
}

.auth-header h1 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
}

.auth-subtitle {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}

.auth-system-name {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

/* Formulario: etiquetas apiladas, campos a todo lo ancho. */
.auth-form,
.auth-card form {
  text-align: left;
}

.auth-card label {
  display: block;
  margin-bottom: 14px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

.auth-card input,
.auth-card select {
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border: 1.5px solid var(--fline);
  border-radius: 10px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
}

.auth-card input:focus,
.auth-card select:focus {
  border-color: var(--gold);
  outline: none;
  box-shadow: 0 0 0 3px var(--ring);
}

/* Botones de pastilla (2cz): el estilo estandar vive en
   secciones-alumno.css (.btn, .btn-primary, .btn-secondary), identico
   al de la ventana de confirmacion; aqui solo quedan los ajustes de
   posicion de la vista de autenticacion. */

.auth-login-btn {
  width: 100%;
  margin-top: 8px;
}

.auth-error {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--errorbg);
  color: var(--error);
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
}

.auth-error[hidden] {
  display: none;
}

.auth-footer {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.auth-footer a,
.auth-register-links a {
  color: var(--gold);
  font-weight: 600;
  text-decoration: none;
}

.auth-footer a:hover,
.auth-register-links a:hover {
  text-decoration: underline;
}

.auth-footer .btn {
  width: 100%;
}

.auth-register-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  margin: 0 0 20px;
  font-size: 14px;
  text-align: center;
}

/* Selector de rol: ver .auth-roles (2cz-k, el diseno nuevo del logueo). */

@media (max-width: 520px) {
  .auth-card {
    padding: 24px 20px;
  }
}

/* Diseno del logueo (2cz-k, 3 dic 2026, Victor): distribucion como la
   del SIE (franja superior, encabezado grande, dos tarjetas para
   elegir el rol, pie con leyenda), pero con los elementos y estilos
   del sistema: la franja y el encabezado usan el degradado con
   facetas de las barras (var(--bar-grad)), Noto Sans, tarjetas
   blancas a 16px con sombra suave y botones de pastilla del sistema.
   El eyebrow va en verde ITSA (#68b258, 2cz-c). La leyenda del pie
   es discreta: texto chiquito y apagado sobre el fondo claro. */
.auth-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

/* Franja superior: los mismos estilos de las barras del sistema
   (degradado con facetas) y el nombre del sistema sobre ella. */
.auth-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 20px;
  background: var(--bar-grad);
}

.auth-strip-logos {
  display: flex;
  flex: none;
  align-items: center;
  gap: 12px;
}

.auth-strip-logos img {
  object-fit: contain;
}

.auth-strip-logos .auth-logo-tecnm,
.auth-strip-logos .auth-logo-itsa {
  height: 26px;
}

.auth-strip-nombre {
  margin: 0;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .18em;
  line-height: 1.5;
  text-align: left;
  text-transform: uppercase;
}

/* Encabezado: mismo degradado de la barra; la tarjeta blanca con
   borde dorado lleva los tres logos; el titulo es el del sistema. */
.auth-hero {
  padding: 28px 16px 20px;
  background: var(--bar-grad);
}

.auth-hero-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  max-width: 1080px;
  margin: 0 auto;
}

/* El logo del SGDRP va suelto y grande. OJO: el alto es fijo (140px),
   nunca height: 100%: el PNG mide 2300x2300 y con porcentaje el alto
   quedaba indefinido y la imagen explotaba a su tamano intrinseco,
   rompiendo todo el encabezado (2cz-m). */
.auth-hero-logo {
  display: flex;
  flex: none;
}

.auth-hero-logo img {
  height: 140px;
  width: auto;
  object-fit: contain;
}

.auth-hero-eyebrow {
  margin: 0 0 10px;
  /* Verde ITSA (2cz-c): el del logo del instituto. */
  color: #68b258;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.auth-hero h1 {
  margin: 0 0 10px;
  color: #fff;
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 800;
  line-height: 1.15;
}

.auth-hero-sub {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: rgba(255, 255, 255, .88);
  font-size: 17px;
  line-height: 1.4;
}

.auth-hero-sub img {
  height: 30px;
  width: auto;
  flex: none;
  object-fit: contain;
}

/* "Elige como quieres entrar:" al pie del encabezado, como en el SIE. */
.auth-hero-elegir {
  max-width: 1080px;
  margin: 18px auto 0;
  color: #fff;
  font-size: 18px;
  font-weight: 600;
}

.auth-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  padding: 28px 16px 32px;
}

/* En login y registro no hay encabezado grande: el logo y la tarjeta
   quedan centrados en la pantalla. */
.auth-main--centrado {
  justify-content: center;
}

.auth-form-logo {
  height: 96px;
  width: auto;
  margin-bottom: 20px;
  object-fit: contain;
}

/* La tarjeta del formulario usa el mismo radio y sombra suave que
   las tarjetas de rol. */
.auth-main .auth-card {
  border-color: var(--ring);
  border-radius: 16px;
  box-shadow: var(--card-shadow);
}

/* Tarjetas de rol: blancas, 16px, sombra suave. El hover es el
   ligero de siempre: solo el fondo cambia tantito, sin movimiento
   ni sombra (2cz-g); al pasar el mouse una rayita azul crece por
   todo el ancho de abajo de la tarjeta. */
.auth-roles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  width: 100%;
  max-width: 1080px;
}

.auth-role {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 26px;
  border: 1px solid var(--ring);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--card-shadow);
  text-align: center;
  overflow: hidden;
  transition: background-color .2s ease;
}

.auth-role:hover {
  background: var(--field2);
}

/* Rayita azul por todo el ancho de abajo de la tarjeta: crece desde
   el centro al pasar el mouse por la tarjeta. */
.auth-role::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--bar);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .35s ease;
}

.auth-role:hover::after {
  transform: scaleX(1);
}

.auth-role-icon {
  display: grid;
  width: 64px;
  height: 64px;
  flex: none;
  place-items: center;
  margin: 0 auto 20px;
  border: 2px solid var(--bar);
  border-radius: 50%;
  background: #fff;
  color: var(--bar);
}

.auth-role-icon svg {
  width: 36px;
  height: 36px;
  /* admin-panel.css (que trae el .admin-icon con el trazo) esta
     deshabilitado en el logueo, asi que el trazo va aqui: sin el,
     los glifos se veian negros con el relleno por defecto. */
  fill: none;
  stroke: var(--bar);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-role-label {
  margin: 0 0 6px;
  color: var(--ink2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.auth-role h2 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
}

.auth-role-desc {
  margin: 0;
  color: var(--ink2);
  font-size: 15px;
  line-height: 1.55;
}

.auth-role-pie {
  margin-top: auto;
}

.auth-role-sep {
  margin: 24px 0 20px;
  border: none;
  border-top: 1px solid var(--line);
}

.auth-role-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

/* Etiqueta del rol sobre el titulo de la tarjeta del formulario. */
.auth-form-rol {
  margin: 0 0 6px;
  color: var(--ink2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}

/* Pie con la leyenda: discreto, texto chiquito y apagado. */
.auth-leyenda {
  padding: 24px 16px 28px;
  border-top: 1px solid var(--line);
  color: var(--ink2);
  font-size: 12.5px;
  line-height: 1.7;
  text-align: center;
}

.auth-leyenda p {
  margin: 0;
}

.auth-leyenda-nombre {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

@media (max-width: 720px) {
  .auth-hero {
    padding: 22px 16px 18px;
  }

  .auth-hero-inner {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }

  .auth-hero-logo {
    justify-content: center;
  }

  .auth-hero-logo img {
    height: 110px;
  }

  .auth-hero-elegir {
    text-align: center;
  }

  .auth-hero-sub {
    justify-content: center;
  }

  .auth-main {
    padding: 28px 12px 36px;
  }

  .auth-roles {
    grid-template-columns: 1fr;
  }

  .auth-role {
    padding: 24px 20px;
  }

  .auth-strip-nombre {
    font-size: 12px;
    letter-spacing: .12em;
  }
}
