/* ==================================================================
   ZX Abogados · Firma electrónica · pantalla de acceso
   La misma pantalla que la intranet: tinta con luces de sello y
   rejilla, titular condensado y tarjeta de papel con dos accesos
   (clientes con su código, y despacho).
   ================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body.acceso {
  min-height: 100vh; min-height: 100svh;
  display: grid; grid-template-rows: auto 1fr auto;
  background: var(--zx-noche); color: var(--zx-sobre-tinta);
  font-family: var(--zx-ui); font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
html[lang^="zh"] body.acceso { font-family: var(--zx-cjk); }
[hidden] { display: none !important; }
img { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.tarjeta :focus-visible { outline-color: var(--zx-sello); }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
::selection { background: var(--zx-sello); color: #fff; }

/* ------------------------------ fondo ------------------------------ */
.acceso-fondo { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; background: var(--zx-fondo-tinta); --mx: 70%; --my: 30%; }
.acceso-fondo::after { content: ""; position: absolute; inset: 0; background: radial-gradient(520px circle at var(--mx) var(--my), rgba(255, 255, 255, 0.07), transparent 60%); transition: background 0.2s; }
.luz { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.6; animation: flotar 16s ease-in-out infinite alternate; }
.luz-sello { width: 46vw; height: 46vw; min-width: 340px; min-height: 340px; right: -10vw; top: -14vw; background: radial-gradient(circle, rgba(192, 12, 12, 0.6), rgba(192, 12, 12, 0) 65%); }
.luz-azul { width: 40vw; height: 40vw; min-width: 280px; min-height: 280px; left: -12vw; bottom: -16vw; background: radial-gradient(circle, rgba(47, 93, 138, 0.65), rgba(47, 93, 138, 0) 65%); animation-delay: -7s; animation-duration: 20s; }
.malla { position: absolute; inset: 0; background-image: var(--zx-rejilla); background-size: 64px 64px; -webkit-mask-image: radial-gradient(ellipse at 40% 45%, #000 15%, transparent 75%); mask-image: radial-gradient(ellipse at 40% 45%, #000 15%, transparent 75%); }
.glifo { position: absolute; right: -4vw; bottom: -10vw; font-family: var(--zx-cjk); font-weight: 700; font-size: min(62vw, 760px); line-height: 1; color: rgba(255, 255, 255, 0.025); -webkit-text-stroke: 1px rgba(255, 255, 255, 0.05); user-select: none; }
@keyframes flotar { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(3vw, 4vh, 0) scale(1.08); } }

/* ------------------------------ barra ------------------------------ */
.barra { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: max(18px, env(safe-area-inset-top)) clamp(16px, 4vw, 48px) 0; }
.marca { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.marca img { width: 40px; height: 40px; border-radius: 8px; box-shadow: 0 8px 22px rgba(192, 12, 12, 0.4); transition: transform 0.3s var(--zx-ease); }
.marca:hover img { transform: rotate(-6deg) scale(1.05); }
.marca-txt { display: grid; line-height: 1.15; }
.marca-txt b { font-family: var(--zx-display); font-weight: 700; font-size: 17px; letter-spacing: 0.01em; }
.marca-txt small { font-family: var(--zx-cjk); font-size: 12px; color: var(--zx-sobre-tinta-gris); }
.idiomas { display: inline-flex; border: 1px solid var(--zx-sobre-tinta-filete); border-radius: var(--zx-radio-s); overflow: hidden; }
.idiomas a { display: inline-grid; place-items: center; min-height: 34px; padding: 0 12px; color: var(--zx-sobre-tinta-gris); text-decoration: none; font-family: var(--zx-display); font-weight: 700; font-size: 15px; }
.idiomas a[lang^="zh"] { font-family: var(--zx-cjk); font-size: 14px; }
.idiomas a + a { border-left: 1px solid var(--zx-sobre-tinta-filete); }
.idiomas a:hover { color: #fff; }
.idiomas a[aria-current] { background: #fff; color: var(--zx-tinta); }

/* ------------------------------ escena ----------------------------- */
.escena { position: relative; z-index: 1; width: min(1180px, 100% - 32px); margin: 0 auto; padding: clamp(28px, 6vh, 72px) 0 40px; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, 460px); gap: clamp(32px, 6vw, 96px); align-items: center; }
.antetitulo { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 0 0 22px; font-family: var(--zx-display); font-weight: 700; font-size: 15px; letter-spacing: 0.04em; color: #ff8a80; text-transform: uppercase; }
.antetitulo::before { content: ""; width: 28px; height: 3px; border-radius: 2px; background: var(--zx-sello); }
html[lang^="zh"] .antetitulo { font-family: var(--zx-cjk); letter-spacing: 0.12em; }
.antetitulo-otro { color: var(--zx-sobre-tinta-gris); text-transform: none; letter-spacing: 0.02em; font-family: var(--zx-cjk); font-weight: 400; }
html[lang^="zh"] .antetitulo-otro { font-family: var(--zx-display); }
.titular { margin: 0; max-width: 12ch; font-family: var(--zx-display); font-weight: 700; font-size: clamp(46px, 6.4vw, 96px); line-height: 0.94; letter-spacing: -0.015em; text-wrap: balance; animation: entrar 0.8s var(--zx-ease) both; }
html[lang^="zh"] .titular { font-family: var(--zx-cjk); max-width: 9em; font-size: clamp(40px, 5.2vw, 76px); line-height: 1.12; letter-spacing: 0.02em; }
.lema { max-width: 42ch; margin: 24px 0 0; font-size: 17px; color: var(--zx-sobre-tinta-gris); animation: entrar 0.8s 0.12s var(--zx-ease) both; }
.puntos { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 10px; max-width: 470px; animation: entrar 0.8s 0.22s var(--zx-ease) both; }
.puntos li { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-top: 1px solid var(--zx-sobre-tinta-filete); font-size: 15px; }
.glifo-punto { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: rgba(192, 12, 12, 0.16); border: 1px solid rgba(192, 12, 12, 0.45); color: #ffb3ad; font-family: var(--zx-cjk); font-weight: 700; font-size: 17px; }
@keyframes entrar { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ------------------------------ tarjeta ---------------------------- */
.tarjeta { position: relative; padding: 30px 30px 22px; border-radius: var(--zx-radio-l); background: var(--zx-papel); color: var(--zx-texto); box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.06); animation: entrar 0.8s 0.1s var(--zx-ease) both; }
.tarjeta::before { content: ""; position: absolute; left: 30px; right: 30px; top: 0; height: 3px; border-radius: 0 0 3px 3px; background: var(--zx-sello); }
.tarjeta-sello { position: absolute; top: -28px; right: 26px; width: 56px; height: 56px; border-radius: 12px; overflow: hidden; transform: rotate(-6deg); box-shadow: 0 14px 34px rgba(192, 12, 12, 0.45); }
.tarjeta-sello img { width: 100%; height: 100%; }

/* Selector de acceso: cliente o despacho. */
.selector { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 4px 0 24px; padding: 5px; border-radius: calc(var(--zx-radio) + 4px); background: var(--zx-marfil); }
.selector button { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 8px 12px; border: 0; border-radius: var(--zx-radio); background: transparent; color: var(--zx-gris); font: inherit; text-align: left; cursor: pointer; transition: background var(--zx-transicion), color var(--zx-transicion), box-shadow var(--zx-transicion); }
.selector button svg { flex: none; width: 22px; height: 22px; }
.selector button span { display: grid; line-height: 1.2; min-width: 0; }
.selector button b { font-family: var(--zx-display); font-size: 16px; letter-spacing: 0.01em; color: var(--zx-tinta-3); }
html[lang^="zh"] .selector button b { font-family: var(--zx-cjk); font-size: 15px; }
.selector button small { font-size: 12.5px; }
.selector button:hover { color: var(--zx-tinta); }
.selector button[aria-selected="true"] { background: #fff; color: var(--zx-sello); box-shadow: 0 1px 2px rgba(27, 32, 39, 0.08), 0 6px 16px -10px rgba(27, 32, 39, 0.4); }
.selector button[aria-selected="true"] b { color: var(--zx-tinta); }

.kicker { margin: 0 0 6px; font-size: 12.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--zx-sello); }
html[lang^="zh"] .kicker { letter-spacing: 0.04em; }
.tarjeta h2 { margin: 0; font-family: var(--zx-display); font-weight: 700; font-size: 32px; line-height: 1.02; letter-spacing: -0.01em; }
html[lang^="zh"] .tarjeta h2 { font-family: var(--zx-cjk); font-size: 28px; line-height: 1.2; letter-spacing: 0.02em; }
.subtitulo { margin: 8px 0 20px; font-size: 14.5px; color: var(--zx-gris); }
.error { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 18px; padding: 11px 13px; border-radius: var(--zx-radio); background: var(--zx-sello-claro); border: 1px solid rgba(192, 12, 12, 0.35); color: var(--zx-burdeos); font-size: 14px; }
.error svg { flex: none; width: 18px; height: 18px; margin-top: 2px; }
.abierto { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; padding: 12px 14px; border-radius: var(--zx-radio); background: var(--zx-jade-claro); border: 1px solid rgba(30, 122, 87, 0.35); color: var(--zx-jade); font-size: 14.5px; font-weight: 700; text-decoration: none; }
.abierto svg { flex: none; width: 20px; height: 20px; }
.abierto span { flex: 1; }
.abierto:hover { border-color: var(--zx-jade); }
.campo { margin-bottom: 16px; }
.campo label { display: block; margin-bottom: 6px; font-size: 13.5px; font-weight: 700; color: var(--zx-tinta-3); }
.control { position: relative; }
.control .ico { position: absolute; left: 13px; top: 50%; width: 19px; height: 19px; transform: translateY(-50%); color: var(--zx-gris-claro); pointer-events: none; }
.control input { width: 100%; min-height: 50px; padding: 0 48px 0 42px; border: 1px solid var(--zx-filete); border-radius: var(--zx-radio); background: var(--zx-niebla); color: var(--zx-texto); font: inherit; font-size: 16px; transition: border-color var(--zx-transicion), background var(--zx-transicion), box-shadow var(--zx-transicion); }
.control input:hover { border-color: #b9c0c9; }
.control input:focus { outline: none; border-color: var(--zx-tinta); background: #fff; box-shadow: 0 0 0 3px rgba(27, 32, 39, 0.12); }
.control input:focus + .ver, .control:focus-within .ico { color: var(--zx-tinta); }
.control-codigo .ico { width: 22px; height: 22px; left: 16px; }
.control-codigo input { min-height: 64px; padding: 0 16px 0 52px; font-family: var(--zx-display); font-weight: 700; font-size: 30px; letter-spacing: 0.16em; text-transform: uppercase; }
.control-codigo input::placeholder { color: #c3c9d1; letter-spacing: 0.16em; }
.ver { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--zx-gris); cursor: pointer; }
.ver:hover { background: var(--zx-marfil); color: var(--zx-tinta); }
.ver svg { width: 20px; height: 20px; }
.ver .ojo-tachado, .ver[aria-pressed="true"] .ojo { display: none; }
.ver[aria-pressed="true"] .ojo-tachado { display: block; }
.fila-recordar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; margin: 4px 0 20px; }
.recordar { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; color: var(--zx-tinta-3); cursor: pointer; }
.recordar input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.casilla { width: 20px; height: 20px; display: grid; place-items: center; border: 1.5px solid #9aa3ad; border-radius: 5px; background: #fff; transition: background var(--zx-transicion), border-color var(--zx-transicion); }
.casilla svg { width: 14px; height: 14px; stroke: #fff; stroke-width: 3; opacity: 0; }
.recordar input:checked + .casilla { background: var(--zx-tinta); border-color: var(--zx-tinta); }
.recordar input:checked + .casilla svg { opacity: 1; }
.recordar input:focus-visible + .casilla { outline: 3px solid var(--zx-sello); outline-offset: 2px; }
.entrar { position: relative; overflow: hidden; width: 100%; min-height: 54px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: var(--zx-radio); background: var(--zx-sello); color: #fff; font-family: var(--zx-display); font-weight: 700; font-size: 19px; letter-spacing: 0.01em; cursor: pointer; box-shadow: var(--zx-sombra-sello); transition: background var(--zx-transicion), transform 0.15s, box-shadow 0.2s; }
html[lang^="zh"] .entrar { font-family: var(--zx-cjk); font-size: 17px; letter-spacing: 0.08em; }
.entrar svg { width: 20px; height: 20px; stroke-width: 2.2; transition: transform 0.2s; }
.entrar::after { content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.3), transparent); transform: skewX(-20deg); transition: left 0.6s var(--zx-ease); }
.entrar:hover { background: var(--zx-sello-hover); transform: translateY(-1px); box-shadow: 0 14px 34px rgba(192, 12, 12, 0.42); }
.entrar:hover::after { left: 120%; }
.entrar:hover svg { transform: translateX(3px); }
.entrar:active { transform: translateY(1px); }
.entrar[aria-busy="true"] { pointer-events: none; opacity: 0.8; }
.ayuda { margin: 16px 0 0; font-size: 13.5px; color: var(--zx-gris); }
.enlaces-pie { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--zx-filete-suave); }
.enlaces-pie a { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; text-decoration: none; color: var(--zx-tinta); }
.enlaces-pie a:hover { color: var(--zx-sello); }
.enlaces-pie svg { width: 16px; height: 16px; stroke-width: 2.2; }
.legales { display: inline-flex; gap: 14px; }
.legales a { font-weight: 400; font-size: 13px; color: var(--zx-gris); }

/* ------------------------------- pie ------------------------------- */
.pie { position: relative; z-index: 1; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 10px; padding: 18px 16px max(18px, env(safe-area-inset-bottom)); font-size: 12.5px; color: var(--zx-sobre-tinta-gris); }
.pie [lang^="zh"] { font-family: var(--zx-cjk); }
.sin-js { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 5; margin: 0; padding: 14px 16px; border-radius: var(--zx-radio); background: var(--zx-sello); color: #fff; text-align: center; font-weight: 700; }

/* ---------------------------- responsive --------------------------- */
@media (max-width: 960px) {
  .escena { grid-template-columns: 1fr; gap: 36px; padding-top: 28px; }
  .puntos { display: none; }
  .titular { font-size: clamp(40px, 11vw, 64px); }
  .lema { margin-top: 16px; font-size: 16px; }
}
@media (max-width: 520px) {
  .marca-txt small { display: none; }
  .tarjeta { padding: 28px 18px 20px; }
  .tarjeta::before { left: 18px; right: 18px; }
  .tarjeta h2 { font-size: 28px; }
  .antetitulo-otro { display: none; }
  .selector button { gap: 8px; padding: 8px 10px; }
  .selector button svg { display: none; }
  .control-codigo input { font-size: 24px; letter-spacing: 0.12em; }
}
@media (prefers-reduced-motion: reduce) {
  .luz, .titular, .lema, .puntos, .tarjeta { animation: none; }
  .entrar::after { display: none; }
}
