/* ═══════════════════════════════════════════════════════════════
   e-ID C.R.A. — Estilos de las páginas públicas
   (inicio de sesión, cambio de contraseña, carga, verificación)
   Paleta del Manual de Identidad Visual de la C.R.A.
   La tarjeta imita un carnet físico: ranura de cordón arriba y la
   franja tricolor institucional como banda lateral.
   ═══════════════════════════════════════════════════════════════ */
:root {
  --azul-oscuro: #0D3361;
  --azul-rey:    #1B4F8A;
  --azul-claro:  #00B5D9;
  --verde:       #8FD400;
  --amarillo:    #EDB512;
  --fondo:       #F4F7FB;
  --borde:       #D5DDE8;
  --texto:       #0F2340;
  --texto-suave: #52627A;
  --ok:          #15803D;
  --ok-bg:       #DCFCE7;
  --err:         #B91C1C;
  --err-bg:      #FEE2E2;
  --r: 14px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

.pub-body {
  font-family: 'Lato', system-ui, sans-serif;
  color: var(--texto);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  background-color: var(--azul-oscuro);
  /* Trama de líneas finas, como el fondo de seguridad de un documento */
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(0,181,217,.22), transparent 55%),
    repeating-linear-gradient(135deg, rgba(255,255,255,.035) 0 1px, transparent 1px 14px);
}

/* ── Tarjeta-carnet ─────────────────────────────────────────────── */
.pub-card {
  position: relative;
  width: 100%;
  max-width: 410px;
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 30px 70px rgba(3,18,40,.45), 0 2px 0 rgba(255,255,255,.5) inset;
  overflow: hidden;
}
.pub-card.ancho { max-width: 560px; }

/* Ranura del cordón */
.pub-card::before {
  content: '';
  position: absolute;
  top: 12px; left: 50%;
  width: 54px; height: 9px;
  transform: translateX(-50%);
  border-radius: 9px;
  background: rgba(3,18,40,.35);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.4);
  z-index: 2;
}

/* Franja tricolor (lateral en escritorio) */
.pub-tricolor {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 6px;
  background: linear-gradient(180deg, var(--amarillo) 0 33%, var(--verde) 33% 66%, var(--azul-claro) 66%);
  z-index: 1;
}

.pub-head {
  background: var(--azul-rey);
  background-image: linear-gradient(160deg, var(--azul-oscuro), var(--azul-rey));
  color: #fff;
  padding: 38px 28px 22px 34px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.pub-head img {
  height: 52px; width: auto; flex-shrink: 0;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.35));
}
.pub-head h1 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.02rem; font-weight: 700; line-height: 1.25;
}
.pub-head p {
  font-size: .78rem; color: rgba(255,255,255,.78); margin-top: 2px; line-height: 1.35;
}

.pub-content { padding: 26px 30px 28px 36px; }
.pub-center { text-align: center; }

.pub-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.25rem; font-weight: 700; line-height: 1.25;
  margin-bottom: 4px;
}
.pub-text { color: var(--texto-suave); font-size: .92rem; line-height: 1.55; margin-bottom: 22px; }
.pub-foot {
  margin-top: 22px; padding-top: 14px;
  border-top: 1px dashed var(--borde);
  font-size: .74rem; color: var(--texto-suave);
  display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap;
}

/* ── Formularios ────────────────────────────────────────────────── */
.pub-field { margin-bottom: 16px; }
.pub-field label {
  display: block;
  font-size: .82rem; font-weight: 700; color: var(--texto);
  margin-bottom: 6px;
}
.pub-input-wrap { position: relative; }
.pub-input-wrap > i {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: var(--texto-suave); font-size: 1rem; pointer-events: none;
}
.pub-field input {
  width: 100%;
  padding: 11px 42px 11px 40px;
  border: 1.5px solid var(--borde);
  border-radius: 10px;
  font: inherit; font-size: .95rem; color: var(--texto);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.pub-field input:focus {
  outline: none;
  border-color: var(--azul-claro);
  box-shadow: 0 0 0 3px rgba(0,181,217,.2);
}
.pub-ojo {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; cursor: pointer;
  width: 34px; height: 34px; border-radius: 8px;
  color: var(--texto-suave); font-size: 1.05rem;
}
.pub-ojo:hover { background: var(--fondo); color: var(--azul-rey); }
.pub-ojo:focus-visible { outline: 2px solid var(--azul-claro); }

.pub-meter { margin-top: 7px; height: 5px; border-radius: 5px; background: #EEF2F7; overflow: hidden; }
.pub-meter span { display: block; height: 100%; width: 0; transition: width .25s, background .25s; }
.pub-meter-txt { font-size: .76rem; margin-top: 4px; font-weight: 700; min-height: 1em; }

/* ── Botones ───────────────────────────────────────────────────── */
.pub-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1.5px solid transparent;
  font: inherit; font-size: .95rem; font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.pub-btn:active { transform: translateY(1px); }
.pub-btn:focus-visible { outline: 3px solid rgba(0,181,217,.55); outline-offset: 2px; }
.pub-btn + .pub-btn { margin-top: 10px; }
.pub-btn-primary { background: var(--azul-rey); color: #fff; }
.pub-btn-primary:hover { background: var(--azul-oscuro); color: #fff; }
.pub-btn-ghost { background: #fff; color: var(--texto-suave); border-color: var(--borde); }
.pub-btn-ghost:hover { border-color: var(--azul-rey); color: var(--azul-rey); }

/* Acciones del funcionario (después de iniciar sesión) */
.pub-acciones { display: grid; gap: 10px; }
.pub-accion {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 14px;
  border: 1.5px solid var(--borde);
  border-radius: 12px;
  text-decoration: none; color: var(--texto);
  transition: border-color .15s, background .15s;
}
.pub-accion:hover { border-color: var(--azul-rey); background: #F7FAFE; color: var(--texto); }
.pub-accion:focus-visible { outline: 3px solid rgba(0,181,217,.55); outline-offset: 2px; }
.pub-accion .ico {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 1.2rem;
  background: #E8F1FB; color: var(--azul-rey);
}
.pub-accion.destacada { background: var(--azul-rey); border-color: var(--azul-rey); color: #fff; }
.pub-accion.destacada:hover { background: var(--azul-oscuro); border-color: var(--azul-oscuro); color: #fff; }
.pub-accion.destacada .ico { background: rgba(255,255,255,.16); color: #fff; }
.pub-accion strong { display: block; font-size: .95rem; }
.pub-accion small { display: block; font-size: .8rem; opacity: .75; margin-top: 1px; }
.pub-accion .flecha { margin-left: auto; opacity: .5; }

/* ── Alertas ───────────────────────────────────────────────────── */
.pub-alert {
  display: flex; gap: 10px; align-items: flex-start;
  border-radius: 10px; padding: 11px 13px; margin-bottom: 16px;
  font-size: .88rem; font-weight: 600; line-height: 1.4;
}
.pub-alert.err { background: var(--err-bg); color: var(--err); }
.pub-alert.ok  { background: var(--ok-bg);  color: var(--ok); }

/* Ícono grande de resultado */
.pub-icon {
  width: 64px; height: 64px; margin: 4px auto 14px;
  border-radius: 50%;
  display: grid; place-items: center;
  font: 700 1.9rem 'Montserrat', sans-serif;
}
.pub-icon.ok  { background: var(--ok-bg);  color: var(--ok); }
.pub-icon.err { background: var(--err-bg); color: var(--err); }

/* Saludo */
.pub-saludo { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.pub-avatar {
  width: 48px; height: 48px; border-radius: 50%; flex-shrink: 0;
  background: var(--fondo); border: 2px solid var(--borde);
  display: grid; place-items: center;
  font: 700 1rem 'Montserrat', sans-serif; color: var(--azul-rey);
  overflow: hidden;
}
.pub-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pub-saludo small { color: var(--texto-suave); font-size: .82rem; display: block; }
.pub-saludo strong { font-family: 'Montserrat', sans-serif; font-size: 1.08rem; line-height: 1.25; display: block; }

/* ── Pantalla de carga ─────────────────────────────────────────── */
.pub-spinner {
  width: 56px; height: 56px; margin: 6px auto 18px;
  border-radius: 50%;
  border: 5px solid #E8F1FB;
  border-top-color: var(--azul-rey);
  animation: pub-giro .9s linear infinite;
}
@keyframes pub-giro { to { transform: rotate(360deg); } }

@media (max-width: 420px) {
  .pub-head { padding: 34px 20px 18px 26px; }
  .pub-content { padding: 22px 20px 24px 26px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition: none !important; }
}
