/* =========================================================
   Pantallas de acceso: login y recuperación de contraseña
   (mismo diseño que el login del Ranking legislativo)
   ========================================================= */

:root {
  --a-azul-1: #3A4CB0;
  --a-azul-2: #2A3897;
  --a-azul-3: #1B2474;
  --a-azul-4: #121A5C;
  --a-tinta: #16206E;
  --a-texto: #1D1F2B;
  --a-texto-2: #5B6072;
  --a-borde: #DCDFEA;
  --a-campo: #F5F6FA;
  --a-dorado: #E2C88C;
  --a-dorado-2: #C9A45C;
  --a-error: #B42318;
  /* misma letra que dentro del sistema (styles.css → --font) */
  --a-font: -apple-system, BlinkMacSystemFont, 'Inter', 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body.acceso {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--a-font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--a-texto);
  -webkit-font-smoothing: antialiased;
  background: linear-gradient(160deg, var(--a-azul-1) 0%, var(--a-azul-2) 38%, var(--a-azul-3) 72%, var(--a-azul-4) 100%);
  background-attachment: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  overflow-x: hidden;
}

a { color: inherit; }

/* círculos grandes del fondo */
.acceso__fondo { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.acceso__fondo span {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
}
.acceso__fondo span:nth-child(1) { width: 440px; height: 440px; top: -90px; right: -120px; }
.acceso__fondo span:nth-child(2) { width: 520px; height: 520px; bottom: -300px; left: -260px; }

/* ---------- tarjeta exterior azul ---------- */

.acceso__marco {
  position: relative;
  width: 100%;
  max-width: 1000px;
  display: grid;
  grid-template-columns: 1fr minmax(0, 430px);
  align-items: center;
  gap: 24px;
  padding: 24px;
  border-radius: 32px;
  overflow: hidden;
  background: linear-gradient(150deg, #3346AA 0%, #2B3A9C 55%, #26338F 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 40px 80px rgba(8, 12, 50, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.acceso__circulo {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  pointer-events: none;
}
.acceso__circulo--1 { width: 300px; height: 300px; top: -170px; left: 48%; }
.acceso__circulo--2 { width: 340px; height: 340px; bottom: -190px; left: -40px; }

/* ---------- lado izquierdo: marca ---------- */

.acceso__marca { position: static; padding: 40px 24px 40px 40px; color: #fff; }
.acceso__marca-contenido { position: relative; z-index: 1; max-width: 460px; }

.acceso__sello {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(145deg, #F1DDA8, var(--a-dorado-2) 55%, #9C7A36);
  box-shadow: 0 14px 30px rgba(6, 10, 45, 0.45);
  margin-bottom: 30px;
}
.acceso__sello img { width: 100%; height: 100%; border-radius: 50%; display: block; object-fit: cover; background: #0C165D; }

.acceso__bienvenido {
  margin: 0;
  font-size: 30px;
  line-height: 1.15;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.acceso__sistema {
  margin: 12px 0 0;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--a-dorado);
}

.acceso__regla {
  display: block;
  width: 60px;
  height: 4px;
  border-radius: 2px;
  margin: 22px 0 24px;
  background: linear-gradient(90deg, var(--a-dorado), var(--a-dorado-2));
}

.acceso__descripcion {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.84);
}

/* ---------- lado derecho: tarjeta blanca ---------- */

.acceso__tarjeta {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 28px;
  padding: 44px 40px 26px;
  box-shadow: 0 24px 50px rgba(6, 10, 45, 0.28);
}

.acceso__titulo {
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--a-tinta);
}

.acceso__ayuda {
  margin: 8px 0 26px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--a-texto-2);
}

.acceso__form { display: flex; flex-direction: column; gap: 18px; }

.acceso__campo { display: flex; flex-direction: column; gap: 6px; }

.acceso__campo label {
  font-size: 12.5px;
  font-weight: 600;
  color: #6E6E73;
}

.acceso__campo input {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  font-family: var(--a-font);
  font-size: 15px;
  color: var(--a-texto);
  background: var(--a-campo);
  border: 1px solid var(--a-borde);
  border-radius: 14px;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}
.acceso__campo input:hover { border-color: #C7CBDB; }
.acceso__campo input:focus {
  outline: none;
  background: #fff;
  border-color: var(--a-azul-2);
  box-shadow: 0 0 0 4px rgba(42, 56, 151, 0.16);
}
.acceso__campo input[aria-invalid="true"] { border-color: var(--a-error); }

.acceso__clave { position: relative; }
.acceso__clave input { padding-right: 92px; }

.acceso-mostrar {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  min-width: 80px;
  height: 40px;
  padding: 0 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  font-family: var(--a-font);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--a-azul-2);
  cursor: pointer;
}
.acceso-mostrar:hover { background: rgba(42, 56, 151, 0.07); }

.acceso__olvido { display: flex; justify-content: flex-end; margin-top: -12px; margin-bottom: -6px; }
.acceso__olvido a, .acceso__secundario a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 13px;
  font-weight: 600;
  color: var(--a-azul-2);
  text-decoration: none;
}
.acceso__olvido a:hover, .acceso__secundario a:hover { text-decoration: underline; }

.acceso__boton {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 12px 20px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(180deg, #3243A6 0%, #1E2878 100%);
  color: #fff;
  font-family: var(--a-font);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(30, 40, 120, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}
.acceso__boton:hover { filter: brightness(1.08); box-shadow: 0 16px 32px rgba(30, 40, 120, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.18); }
.acceso__boton:active { transform: scale(0.985); }
.acceso__boton[disabled] { opacity: 0.7; cursor: progress; }

.acceso__pie {
  margin: 26px 0 0;
  text-align: center;
  font-size: 12.5px;
  line-height: 1.6;
  color: #6B7080;
}

.acceso__secundario { margin: 14px 0 0; text-align: center; }

.acceso__volver {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin: -14px 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--a-azul-2);
  text-decoration: none;
}
.acceso__volver:hover { text-decoration: underline; }

.acceso__error { font-size: 12.5px; font-weight: 500; color: var(--a-error); }
.acceso__nota { font-size: 12.5px; line-height: 1.5; color: var(--a-texto-2); }

.acceso__aviso {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  margin: -8px 0 22px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.5;
}
.acceso__aviso i { font-size: 19px; flex-shrink: 0; margin-top: 1px; }
.acceso__aviso[hidden] { display: none; }
.acceso__aviso--error { background: #FEF0EE; color: var(--a-error); }
.acceso__aviso--info { background: #EEF0FA; color: var(--a-azul-3); }

.acceso__icono {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  font-size: 28px;
  background: #EEF0FA;
  color: var(--a-azul-2);
}
.acceso__icono--ok { background: #E8F5EC; color: #1E7B3C; }
.acceso__icono--alerta { background: #FDF3E4; color: #9A5B0B; }

.acceso__lista {
  margin: -8px 0 28px;
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--a-texto-2);
}
.acceso__lista li + li { margin-top: 6px; }

:focus-visible { outline: 3px solid var(--a-dorado); outline-offset: 3px; border-radius: 6px; }
.acceso__tarjeta :focus-visible { outline-color: var(--a-azul-2); }

/* ---------- tablet y teléfono ---------- */

@media (max-width: 900px) {
  body.acceso { padding: 16px; align-items: flex-start; }
  .acceso__marco { grid-template-columns: 1fr; gap: 0; padding: 12px; border-radius: 28px; }
  .acceso__marca { padding: 28px 16px 26px; text-align: center; }
  .acceso__marca-contenido { margin: 0 auto; }
  .acceso__sello { width: 84px; height: 84px; margin: 0 auto 18px; }
  .acceso__bienvenido { font-size: 22px; }
  .acceso__sistema { font-size: 11.5px; margin-top: 8px; }
  .acceso__regla { margin: 16px auto; }
  .acceso__descripcion { font-size: 13.5px; }
  .acceso__tarjeta { padding: 28px 20px 20px; border-radius: 22px; }
  .acceso__titulo { font-size: 24px; }
  .acceso__ayuda { font-size: 14px; margin-bottom: 22px; }
  .acceso__sello { width: 72px; height: 72px; }
  /* iOS amplía la página si el texto del campo es menor a 16px (igual que dentro) */
  .acceso__campo input { font-size: 16px; }
  .acceso__circulo--1 { left: auto; right: -140px; top: -160px; }
}

/* en el teléfono el formulario va primero a la vista: se omite el párrafo largo */
@media (max-width: 480px) {
  .acceso__descripcion { display: none; }
  .acceso__regla { margin-bottom: 4px; }
  .acceso__marca { padding: 24px 16px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; }
}
