  /* ===== Página de inicio de sesión / registro — azul · blanco · dorado ===== */
.login-page { min-height: 100vh; display: grid; place-items: center; overflow-x: hidden; }
.login-bg { position: fixed; inset: 0; z-index: -1; background: var(--bg); overflow: hidden; }
.login-bg__glow { position: absolute; width: 70vw; height: 70vw; max-width: 900px; max-height: 900px; left: -20vw; top: -20vh; background: radial-gradient(circle, rgba(47,107,255,.35), transparent 60%); filter: blur(60px); animation: pulse 9s ease-in-out infinite; }
.login-bg__glow::after { content: ""; position: absolute; right: -60%; bottom: -30%; width: 80%; height: 80%; background: radial-gradient(circle, rgba(242,193,78,.22), transparent 60%); filter: blur(50px); }
.login-bg__grid {
  position: absolute; inset: 0; opacity: .45;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px; mask-image: radial-gradient(circle at 70% 50%, #0c1322, transparent 70%);
}

.login {
  width: min(1100px, 100% - 2rem); margin: 2rem auto; display: grid; grid-template-columns: 1.15fr 1fr;
  background: rgba(10,20,40,.75); border: 1px solid var(--line-2); border-radius: 26px; overflow: hidden; box-shadow: var(--shadow), 0 0 0 1px rgba(242,193,78,.08);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); animation: pop .5s cubic-bezier(.2,.7,.2,1);
}
[data-theme="light"] .login { background: rgba(255,255,255,.9); }

/* Panel de marca */
.login__brand {
  position: relative; padding: 3rem; display: flex; flex-direction: column; gap: 1rem; overflow: hidden;
  background: radial-gradient(700px 400px at 20% 0%, rgba(47,107,255,.35), transparent 70%), var(--bg);
  border-right: 1px solid var(--line-2);
}
.login__brand::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 40px 40px; opacity: .35; mask-image: radial-gradient(circle at 50% 100%, #0c1322, transparent 70%); pointer-events: none; }
.login__brand > * { position: relative; z-index: 1; }
.logo--xl { font-size: 2.5rem; gap: .8rem; margin-bottom: .5rem; }
.logo--sm { display: inline-flex; width: 50px; height: 50px; border-radius: 15px; background: var(--gold-grad); color: #0b1a3a; place-items: center; justify-content: center; margin-bottom: .8rem; box-shadow: 0 10px 26px rgba(242,193,78,.35); }
.logo--sm svg { color: #0b1a3a; filter: none; }
.login__brand h1 { font-size: clamp(2rem, 4vw, 3rem); text-transform: uppercase; }
.login__features { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; color: var(--muted); font-size: .95rem; }
.login__features li { display: flex; align-items: center; gap: .7rem; }
.login__features span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--blue-soft); border: 1px solid var(--line-2); font-size: 1rem; flex: none; }
.login__laptop { margin-top: auto; width: 78%; align-self: flex-end; filter: drop-shadow(0 30px 40px rgba(12,19,34,.6)); animation: float 6s ease-in-out infinite; }

/* Panel del formulario */
.login__panel { padding: 2.6rem 2.5rem; display: flex; flex-direction: column; justify-content: center; gap: 1.5rem; }
.login__card { width: 100%; max-width: 400px; margin-inline: auto; }
.login__head h2 { text-transform: none; font-size: 1.9rem; }

.tabs { display: flex; gap: .3rem; padding: .3rem; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 14px; margin-top: .4rem; }
.tab { flex: 1; padding: .65rem .8rem; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 700; font-family: var(--font-display); font-size: 1.05rem; letter-spacing: .03em; transition: background .25s, color .25s, box-shadow .25s; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--gold-grad); color: #0b1a3a; box-shadow: 0 8px 22px rgba(242,193,78,.35); }
.form-panel { animation: pop .3s ease; }
.form-panel > p.muted { margin: 1rem 0 0; font-size: .92rem; }
.form-panel code { background: var(--bg-3); color: var(--gold); padding: .05rem .35rem; border-radius: 5px; font-size: .85em; }

.field { display: flex; flex-direction: column; gap: .4rem; margin-top: 1.1rem; }
.field label { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 700; }
.field__input {
  display: flex; align-items: center; gap: .6rem; padding: 0 .9rem; height: 50px;
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 13px; color: var(--muted); transition: border-color .2s, box-shadow .2s;
}
.field__input:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); color: var(--gold); }
.field__input input { flex: 1; background: none; border: 0; outline: 0; color: var(--text); font-size: 1rem; min-width: 0; }
.field__input input::placeholder { color: var(--muted); opacity: .8; }
.field__input.is-invalid { border-color: #ff5a6a; box-shadow: 0 0 0 3px rgba(255,90,106,.18); }
.field__eye { border: 0; background: none; color: var(--muted); padding: .2rem; display: grid; place-items: center; }
.field__eye:hover { color: var(--gold); }
.field__hint { font-size: .75rem; }

.login__row { display: flex; justify-content: space-between; align-items: center; margin-top: 1rem; font-size: .85rem; }
.login__row a:hover { color: var(--gold); }
.check { display: flex; align-items: center; gap: .45rem; color: var(--muted); cursor: pointer; }
.check input { accent-color: var(--gold); width: 16px; height: 16px; }
.login__forget-user { display: block; margin-top: .4rem; padding: 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: .78rem; text-decoration: underline; cursor: pointer; }
.login__forget-user:hover { color: var(--gold); }
.login__forget-user:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.login__error { margin: 1rem 0 0; padding: .7rem .9rem; border-radius: 10px; font-size: .9rem; font-weight: 600; background: rgba(255,90,106,.12); border: 1px solid rgba(255,90,106,.45); color: #ff8a96; }
.login__ok { margin: 1rem 0 0; padding: .7rem .9rem; border-radius: 10px; font-size: .9rem; font-weight: 600; background: rgba(74,222,128,.12); border: 1px solid rgba(74,222,128,.4); color: var(--ok); }
.btn--block { width: 100%; justify-content: center; margin-top: 1.2rem; height: 52px; font-size: 1rem; }
.btn.is-loading { opacity: .7; pointer-events: none; }
.btn.is-loading span::after { content: "…"; }

.login__switch { text-align: center; font-size: .88rem; margin: 1rem 0 0; }
.login__switch a { color: var(--gold); font-weight: 700; }
.login__terms { margin-top: 1rem; font-size: .85rem; }
.login__terms-details { margin-top: 1rem; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface-2); }
.login__terms-details[open] { border-color: var(--gold-3); }
.login__terms-details summary { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .8rem .9rem; cursor: pointer; color: var(--gold); font-size: .86rem; font-weight: 700; list-style: none; }
.login__terms-details summary::-webkit-details-marker { display: none; }
.login__terms-details summary::after { content: "+"; flex: 0 0 24px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--gold-soft); color: var(--gold); font-weight: 800; }
.login__terms-details[open] summary::after { content: "−"; }
.login__terms-copy { max-height: 240px; overflow-y: auto; padding: 0 .9rem .85rem; color: var(--muted); font-size: .78rem; line-height: 1.55; }
.login__terms-copy p { margin: .25rem 0 .65rem; }
.login__terms-copy ol { margin: 0; padding-left: 1.25rem; }
.login__terms-copy li + li { margin-top: .5rem; }
.login__terms-copy strong { color: var(--text); }
.strength { height: 5px; background: var(--bg-3); border-radius: 99px; overflow: hidden; margin-top: .2rem; }
.strength i { display: block; height: 100%; width: 0; border-radius: 99px; transition: width .3s, background .3s; }
.strength i[data-level="1"] { width: 33%; background: #ff5a6a; }
.strength i[data-level="2"] { width: 66%; background: var(--warn); }
.strength i[data-level="3"] { width: 100%; background: var(--ok); }

.login__demo { margin-top: 1.6rem; padding-top: 1.2rem; border-top: 1px solid var(--line); font-size: .8rem; display: grid; gap: .5rem; }
.login__chips { display: flex; gap: .5rem; flex-wrap: wrap; }
.chip { font-family: ui-monospace, monospace; font-size: .78rem; padding: .38rem .75rem; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); transition: border-color .2s, color .2s; }
.chip:hover { border-color: var(--gold); color: var(--gold); }
.login__foot { text-align: center; font-size: .78rem; margin: 0; }

@keyframes shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-6px); } 40%, 60% { transform: translateX(6px); } }
.shake { animation: shake .5s; }

@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; }
  .login__brand { border-right: 0; border-bottom: 1px solid var(--line-2); padding: 2rem; }
  .login__laptop { display: none; }
  .login__panel { padding: 2rem 1.5rem; }
}

.field-validation { display:block; color:#ffadb8; margin-top:6px; font-size:.78rem; }
.field-validation:empty { display:none; }
button:disabled { opacity:.65; cursor:wait; }

/* ===== Validación en vivo: contadores, errores por campo y requisitos ===== */

/* Contador «12/20» al lado de la etiqueta */
.campo__cuenta {
  float: right;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.campo__cuenta--tope { color: var(--warn); }

/* Mensaje de error debajo del campo */
.campo__error {
  margin: .35rem 0 0;
  font-size: .78rem;
  font-weight: 600;
  line-height: 1.35;
  color: #ff8a96;
  display: flex;
  gap: .35rem;
  align-items: flex-start;
}
.campo__error::before { content: "⚠"; flex: none; }

/* Aviso de Bloq Mayús */
.campo__aviso {
  margin: .35rem 0 0;
  font-size: .78rem;
  font-weight: 600;
  color: var(--warn);
}

/* Campo correcto: borde verde y palomita */
.field__input.is-valid {
  border-color: rgba(74, 222, 128, .55);
}
.field__input.is-valid::after {
  content: "✓";
  color: var(--ok);
  font-weight: 800;
  font-size: .9rem;
  margin-left: .2rem;
}
.field__input.is-invalid::after { content: none; }

/* Lista de requisitos de la contraseña */
.requisitos {
  list-style: none;
  margin: .5rem 0 0;
  padding: .6rem .8rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .3rem .8rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: .75rem;
  color: var(--muted);
}
.requisitos li {
  display: flex;
  align-items: center;
  gap: .4rem;
  transition: color .2s;
}
.requisitos li span {
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  font-size: .65rem;
  font-weight: 800;
  border: 1px solid var(--line-2);
  flex: none;
}
.requisitos li.ok { color: var(--ok); }
.requisitos li.ok span { border-color: var(--ok); background: rgba(74, 222, 128, .15); }

/* Botón deshabilitado mientras el formulario no sea válido */
.btn--block:disabled {
  /* Antes era el dorado al 45 %: sobre el azul marino se veía marrón. Ahora es un contorno dorado
     tenue con texto legible, y pasa a dorado lleno cuando el formulario está listo. */
  opacity: 1;
  background: #efc66e14;
  border: 1px solid #efc66e59;
  color: #d9c9a3;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn--block:disabled::after { content: none; }

/* Ojo de mostrar contraseña, activo */
.field__eye.is-on { color: var(--gold); }

@media (max-width: 480px) { .requisitos { grid-template-columns: 1fr; } }

/* ===== Cuenta bloqueada: pantalla del código de desbloqueo ===== */
.desbloqueo { text-align: left; }
.desbloqueo__icono { display: grid; place-items: center; width: 60px; height: 60px; margin: 1.2rem auto 0; border-radius: 50%; background: var(--gold-soft); border: 1px solid var(--line-2); color: var(--gold); }
.desbloqueo__titulo { margin: .8rem 0 0; text-align: center; font-family: var(--font-display); font-size: 1.5rem; color: var(--text); }
.desbloqueo strong { color: var(--gold); }
.field__input input.desbloqueo__codigo { font-family: var(--font-display); font-size: 1.6rem; letter-spacing: .5em; text-align: center; }
.desbloqueo .login__row .login__forget-user { margin-top: 0; }
.desbloqueo .login__forget-user:disabled { opacity: .6; cursor: default; text-decoration: none; }
.desbloqueo__ayuda { display: block; margin-top: 1rem; line-height: 1.45; }
.desbloqueo #okDesbloqueo { background: var(--gold-soft); border-color: var(--line-2); color: var(--text); font-weight: 500; }

/* ---------- Login y registro con DNI (2026-11-10) ---------- */
.login__row--enlaces { justify-content: space-between; flex-wrap: wrap; margin-top: .2rem; }
.login__row--enlaces .login__forget-user { margin-top: .2rem; }
.field__input--accion { padding-right: 6px; }
.login__verificar { flex-shrink: 0; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--gold); background: var(--gold-soft); color: var(--gold); font: 600 .8rem var(--font, inherit); cursor: pointer; }
.login__verificar:hover:not(:disabled) { background: var(--gold); color: #0f172a; }
.login__verificar:disabled { opacity: .45; cursor: default; }
.login__verificar.is-loading { opacity: .7; cursor: progress; }
.field__input input[readonly] { color: var(--text); cursor: default; }
.verificacion { margin: .5rem 0 0; padding: .6rem .8rem; border-radius: 10px; font-size: .82rem; line-height: 1.45; }
.verificacion--ok { background: rgba(74,222,128,.10); border: 1px solid rgba(74,222,128,.4); color: var(--ok, #4ade80); }
.verificacion--simulada { background: rgba(251,191,36,.10); border: 1px dashed #f59e0b; color: #fbbf24; }
.verificacion--simulada strong { letter-spacing: .04em; }
