/* Estilo compartido de las páginas públicas fuera de la portada: inicio de sesión, registro, privacidad y términos.
   Mismos tokens y temas (oscuro por defecto, claro con [data-theme="light"]) que index.html. Fuera de /libs/ a propósito
   (esa carpeta se cachea un año). */
:root {
    --amarillo: #FEC31D; --amarillo-hover: #e5af19;
    --fondo: #050505; --fondo-2: #0d0d0f; --tarjeta: #121215; --tarjeta-2: #18181c;
    --borde: #24242a; --borde-suave: #16161a;
    --texto: #f2f2f2; --texto-2: #b9b9c0; --texto-3: #8e8e97;
    --acento: #FEC31D; --acento-icono: #FEC31D; --acento-fondo: rgba(254,195,29,.12);
    --marco: #0a0a0c; --marco-barra: #111114; --marco-punto: #2c2c33;
    --sombra: 0 30px 80px rgba(0,0,0,.6), 0 0 0 1px rgba(254,195,29,.06);
    --input-fondo: #0a0a0c; --input-borde: #2a2a31; --btn2-borde: #3a3a42;
    --modal: #0e0e10; --scroll-pista: #000000; --scroll-barra: #333333; --brillo: rgba(254,195,29,.14);
    --error: #ff7b70; --exito: #3ddc84;
    color-scheme: dark;
}
[data-theme="light"] {
    --fondo: #f7f7f9; --fondo-2: #efeff3; --tarjeta: #ffffff; --tarjeta-2: #f4f4f7;
    --borde: #e1e1e8; --borde-suave: #e6e6ec;
    --texto: #121216; --texto-2: #474751; --texto-3: #62626d;
    --acento: #16161a; --acento-icono: #F0B000; --acento-fondo: rgba(254,195,29,.2); /* en claro el texto va en negro; el amarillo, como fondo o subrayado */
    --marco: #ffffff; --marco-barra: #f1f1f4; --marco-punto: #d3d3da;
    --sombra: 0 24px 60px rgba(20,20,40,.14), 0 0 0 1px rgba(0,0,0,.04);
    --input-fondo: #ffffff; --input-borde: #cfcfd8; --btn2-borde: #c9c9d2;
    --modal: #ffffff; --scroll-pista: #ececf0; --scroll-barra: #c4c4cc; --brillo: rgba(254,195,29,.25);
    --error: #b3261e; --exito: #15803d;
    color-scheme: light;
}
[data-theme="light"] .solo-oscuro { display: none !important; }
:root:not([data-theme="light"]) .solo-claro { display: none !important; }

* { box-sizing: border-box; }
body { margin: 0; font-family: 'Poppins', system-ui, sans-serif; background: var(--fondo); color: var(--texto); line-height: 1.6; -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; transition: background-color .3s, color .3s; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--acento); }
[data-theme="light"] a { text-decoration-color: var(--amarillo); text-decoration-thickness: 2px; text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.2; margin: 0; text-wrap: balance; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--amarillo); outline-offset: 3px; border-radius: 6px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--scroll-pista); }
::-webkit-scrollbar-thumb { background: var(--scroll-barra); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--amarillo); }

/* Barra superior */
.pub-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 32px; border-bottom: 1px solid var(--borde-suave); }
.pub-logo img { height: 34px; width: auto; }
.pub-top-der { display: flex; align-items: center; gap: 12px; }
.pub-volver { color: var(--texto-2); text-decoration: none; font-size: .9rem; display: inline-flex; align-items: center; gap: 8px; }
.pub-volver:hover { color: var(--acento); }
.tema-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--borde); background: transparent; color: var(--texto-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: .95rem; flex-shrink: 0; }
.tema-btn:hover { color: var(--acento); border-color: var(--amarillo); }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-family: inherit; font-weight: 600; font-size: .98rem; padding: 13px 24px; border-radius: 999px; border: 1px solid transparent; text-decoration: none; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.btn-primario { background: var(--amarillo); color: #000; }
.btn-primario:hover:not(:disabled) { background: var(--amarillo-hover); }
.btn-secundario { border-color: var(--btn2-borde); color: var(--texto); background: transparent; }
.btn-secundario:hover:not(:disabled) { border-color: var(--amarillo); color: var(--acento); }
.btn:disabled { opacity: .65; cursor: wait; }
.btn-bloque { width: 100%; }

/* Acceso: panel de marca + formulario */
.auth { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-lado { position: relative; overflow: hidden; background: var(--fondo-2); border-right: 1px solid var(--borde-suave); padding: 64px 56px; display: flex; flex-direction: column; justify-content: center; gap: 22px; }
.auth-lado::before { content: ''; position: absolute; right: -30%; top: -30%; width: 80%; aspect-ratio: 1; background: radial-gradient(closest-side, var(--brillo), transparent 70%); pointer-events: none; }
.auth-lado > * { position: relative; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--acento); }
.auth-lado h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); font-weight: 700; }
.auth-lado > p { color: var(--texto-2); font-size: 1.02rem; max-width: 34em; }
.auth-puntos { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.auth-puntos li { display: flex; gap: 10px; color: var(--texto-2); font-size: .94rem; }
.auth-puntos i { color: var(--acento-icono); margin-top: 5px; font-size: .8rem; }
.ventana { background: var(--marco); border: 1px solid var(--borde); border-radius: 12px; overflow: hidden; box-shadow: var(--sombra); max-width: 560px; }
.ventana-barra { display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: var(--marco-barra); border-bottom: 1px solid var(--borde); }
.ventana-barra span { width: 9px; height: 9px; border-radius: 50%; background: var(--marco-punto); }

.auth-form { display: flex; align-items: center; justify-content: center; padding: 48px 32px; }
.tarjeta { width: 100%; max-width: 440px; }
.tarjeta.ancha { max-width: 620px; }
.tarjeta h2 { font-size: 1.7rem; font-weight: 700; }
.tarjeta .sub { color: var(--texto-2); margin-top: 6px; font-size: .95rem; }
.tarjeta form { margin-top: 26px; }

/* Campos */
.campo { margin-bottom: 16px; }
.campo label, .etiqueta { display: block; font-size: .84rem; font-weight: 500; color: var(--texto-2); margin-bottom: 6px; }
.campo label small { color: var(--texto-3); font-weight: 400; }
.campo input, .campo select { width: 100%; padding: 12px 14px; background: var(--input-fondo); border: 1px solid var(--input-borde); border-radius: 10px; color: var(--texto); font-family: inherit; font-size: .95rem; transition: border-color .2s, box-shadow .2s; }
.campo input:focus, .campo select:focus { outline: none; border-color: var(--amarillo); box-shadow: 0 0 0 3px rgba(254,195,29,.2); }
.campo input[aria-invalid="true"], .campo select[aria-invalid="true"] { border-color: var(--error); }
.campo select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--texto-3) 50%), linear-gradient(135deg, var(--texto-3) 50%, transparent 50%); background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.fila-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 14px; }
.telefono { display: flex; gap: 8px; align-items: center; }
.telefono .mas { color: var(--acento); font-weight: 700; }
.telefono input.indicativo { width: 72px; flex: 0 0 72px; text-align: center; font-weight: 700; color: var(--acento); }
.telefono input:not(.indicativo) { flex: 1; min-width: 0; }
.clave { position: relative; }
.clave input { padding-right: 48px; }
.clave .ver-clave { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; background: none; color: var(--texto-3); cursor: pointer; border-radius: 8px; }
.clave .ver-clave:hover { color: var(--acento); }
.medidor { display: flex; gap: 4px; margin-top: 8px; }
.medidor span { flex: 1; height: 4px; border-radius: 4px; background: var(--borde); transition: background .2s; }
.medidor[data-nivel="1"] span:nth-child(-n+1) { background: var(--error); }
.medidor[data-nivel="2"] span:nth-child(-n+2) { background: var(--amarillo); }
.medidor[data-nivel="3"] span:nth-child(-n+3) { background: var(--exito); }
.medidor-texto { font-size: .8rem; color: var(--texto-3); margin-top: 4px; min-height: 1.3em; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; color: var(--texto-2); cursor: pointer; margin: 6px 0 18px; }
.check input { width: 17px; height: 17px; margin-top: 3px; accent-color: var(--amarillo); flex-shrink: 0; }
.mensaje { min-height: 1.4em; margin-top: 14px; font-size: .9rem; text-align: center; }
.mensaje.error { color: var(--error); }
.mensaje.exito { color: var(--exito); }
.mensaje.info { color: var(--texto-2); }
.enlaces { margin-top: 18px; text-align: center; font-size: .9rem; color: var(--texto-2); display: grid; gap: 10px; }
.enlaces a, .enlace-btn { color: var(--acento); text-decoration: none; font-weight: 600; background: none; border: 0; font: inherit; font-weight: 600; cursor: pointer; padding: 0; }
.enlaces a:hover, .enlace-btn:hover { text-decoration: underline; }
[data-theme="light"] .enlaces a, [data-theme="light"] .enlace-btn { text-decoration: underline; text-decoration-color: var(--amarillo); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.separador { border: 0; border-top: 1px solid var(--borde); margin: 22px 0; }

/* Ventanas emergentes */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.65); backdrop-filter: blur(6px); display: none; align-items: center; justify-content: center; z-index: 3000; padding: 20px; }
.modal-overlay.active { display: flex; }
.modal-box { position: relative; width: 100%; max-width: 440px; background: var(--modal); border: 1px solid var(--borde); border-radius: 18px; padding: 30px 28px; box-shadow: var(--sombra); }
.modal-box h3 { font-size: 1.25rem; }
.modal-box > p, .modal-box .modal-texto { color: var(--texto-2); font-size: .93rem; margin: 8px 0 20px; }
.modal-cerrar { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border: 0; background: none; color: var(--texto-3); cursor: pointer; border-radius: 8px; font-size: 1.1rem; }
.modal-cerrar:hover { color: var(--acento); }
.modal-ok { text-align: center; }
.modal-ok i { font-size: 2.6rem; color: var(--exito); }
.modal-ok h3 { margin-top: 12px; }
.modal-acciones { display: grid; gap: 10px; }

/* Páginas legales */
.legal { flex: 1; width: 100%; max-width: 860px; margin: 0 auto; padding: 56px 24px 80px; }
.legal h1 { font-size: clamp(1.8rem, 3.4vw, 2.4rem); font-weight: 700; margin-top: 10px; }
.legal .fecha { color: var(--texto-3); font-size: .88rem; margin-top: 8px; }
.legal .indice { background: var(--tarjeta); border: 1px solid var(--borde); border-radius: 14px; padding: 18px 22px; margin: 28px 0 8px; }
.legal .indice b { display: block; font-size: .85rem; margin-bottom: 8px; }
.legal .indice ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 28px; font-size: .9rem; }
.legal .indice a { color: var(--texto-2); text-decoration: none; }
.legal .indice a:hover { color: var(--acento); }
.legal h2 { font-size: 1.15rem; font-weight: 700; margin: 38px 0 10px; scroll-margin-top: 20px; }
.legal p, .legal li { color: var(--texto-2); font-size: .95rem; }
.legal p { margin-bottom: 12px; }
.legal ul { padding-left: 20px; margin: 0 0 12px; }
.legal li { margin-bottom: 6px; }
.legal strong { color: var(--texto); }
.legal table { width: 100%; border-collapse: collapse; margin: 6px 0 14px; font-size: .9rem; }
.legal th, .legal td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--borde); color: var(--texto-2); vertical-align: top; }
.legal th { color: var(--texto); font-weight: 600; }
.legal code { background: var(--tarjeta-2); border: 1px solid var(--borde); border-radius: 6px; padding: 1px 6px; font-size: .85em; }
.legal .nota { background: var(--acento-fondo); border-radius: 12px; padding: 14px 18px; color: var(--texto); font-size: .92rem; margin: 18px 0; }
.legal .tabla-scroll { overflow-x: auto; }

/* Pie */
.pub-pie { border-top: 1px solid var(--borde-suave); padding: 22px 32px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 20px; color: var(--texto-3); font-size: .82rem; }
.pub-pie nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.pub-pie a, .pub-pie button { color: var(--texto-3); text-decoration: none; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.pub-pie a:hover, .pub-pie button:hover { color: var(--acento); }

@media (max-width: 900px) {
    .auth { grid-template-columns: minmax(0, 1fr); }
    .auth-lado { display: none; }
    .auth-form { padding: 32px 18px 48px; align-items: flex-start; }
}
@media (max-width: 640px) {
    .pub-top { padding: 14px 18px; }
    .pub-logo img { height: 28px; }
    .pub-volver span { display: none; }
    .fila-2 { grid-template-columns: minmax(0, 1fr); }
    .campo input, .campo select { font-size: 16px; }
    .legal { padding: 36px 18px 64px; }
    .legal .indice ol { columns: 1; }
    .pub-pie { padding: 18px; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
