/* Helix · panel v5 · acceso: login y registro (helix-auth.js, mountLogin / mountRegistro), 24-09-2026.
   Escritorio: panel de marca a la izquierda (mascota de Helix Agent o la imagen de portada, titular y tres puntos) y
   tarjeta de cristal a la derecha. Móvil: una columna, mascota pequeña arriba y tarjeta a ancho completo.
   Vive fuera de .helix-app (no hay sesión): todo cuelga de html.hx-v5 y de .hx5a. El paywall y «confirmando pago»
   siguen con .helix-login (helix-material.css). */

html.hx-v5 .hx5a {
  --hx5a-btn: #D9362C; --hx5a-btn-2: #C62F26;            /* coral con texto blanco AA (4,7:1) en los dos temas */
  --hx5a-campo: rgba(255, 255, 255, .055); --hx5a-campo-2: rgba(255, 255, 255, .085);
  --hx5a-linea: rgba(255, 255, 255, .10); --hx5a-enlace: #FF8F87;
  --hx5a-err-bg: rgba(255, 69, 58, .13); --hx5a-err: #FFA59E;
  --hx5a-tarjeta: rgba(28, 26, 31, .80);
  --hx5a-panel: radial-gradient(62% 48% at 50% 44%, rgba(255, 94, 87, .30), transparent 72%),
                radial-gradient(90% 60% at 0% 100%, rgba(196, 70, 46, .30), transparent 70%),
                linear-gradient(162deg, rgba(44, 26, 22, .88), rgba(22, 18, 23, .90) 52%, rgba(34, 20, 17, .90));
  position: fixed; inset: 0; z-index: 1; overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch;
  color: var(--v5-t1); font-family: var(--v5-font); font-size: 14px; letter-spacing: -.006em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
html.hx-v5:not([data-theme="dark"]) .hx5a {
  --hx5a-campo: rgba(40, 20, 16, .045); --hx5a-campo-2: rgba(255, 255, 255, .95);
  --hx5a-linea: rgba(40, 20, 16, .10); --hx5a-enlace: #C62F26;
  --hx5a-err-bg: rgba(217, 54, 44, .09); --hx5a-err: #A8231B;
  --hx5a-tarjeta: rgba(255, 255, 255, .86);
  --hx5a-panel: radial-gradient(62% 48% at 50% 44%, rgba(255, 128, 100, .34), transparent 72%),
                radial-gradient(90% 60% at 0% 100%, rgba(255, 150, 120, .30), transparent 70%),
                linear-gradient(162deg, rgba(255, 255, 255, .80), rgba(255, 246, 242, .70) 55%, rgba(255, 240, 234, .76));
}
html.hx-v5 .hx5a *, html.hx-v5 .hx5a *::before, html.hx-v5 .hx5a *::after { box-sizing: border-box; }

html.hx-v5 .hx5a-marco {
  display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(440px, 1fr); gap: 20px;
  min-height: 100vh; min-height: 100dvh; padding: 20px;
}

/* ── Panel de marca ── */
html.hx-v5 .hx5a-marca {
  order: -1; position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; min-height: 0; padding: 30px 44px 44px;
  border-radius: 32px; background: var(--hx5a-panel);
  -webkit-backdrop-filter: blur(24px) saturate(1.4); backdrop-filter: blur(24px) saturate(1.4);
  box-shadow: var(--v5-sheetsh), 0 0 0 .5px var(--v5-edge);
  animation: hx5a-entra .7s var(--v5-eo) both;
}
html.hx-v5 .hx5a-logo { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
html.hx-v5 .hx5a-logo svg { width: 28px; height: 28px; flex: none; }
html.hx-v5 .hx5a-visual { position: relative; flex: 1; min-height: 260px; margin: 8px 0 24px; display: grid; place-items: center; }
html.hx-v5 .hx5a-portada { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 24px;
  box-shadow: 0 0 0 .5px var(--v5-edge), 0 18px 40px -22px rgba(0, 0, 0, .5); }
html.hx-v5 .hx5a-portada[hidden], html.hx-v5 .hx5a-marca.tiene-portada .hx5a-escena { display: none; }

/* Escena de la mascota: halo coral, dos órbitas que repiten el aro de la mascota y su sombra en el suelo. */
html.hx-v5 .hx5a-escena { position: relative; display: grid; place-items: center; width: 100%; height: 100%; }
html.hx-v5 .hx5a-escena::before { content: ""; position: absolute; left: 50%; top: 50%; width: min(520px, 92%); aspect-ratio: 1;
  transform: translate(-50%, -52%); border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--v5-acc) 30%, transparent) 0%, transparent 62%); filter: blur(10px); }
html.hx-v5 .hx5a-orb { position: absolute; left: 50%; top: 50%; border-radius: 50%; pointer-events: none;
  border: 1px solid color-mix(in srgb, var(--v5-acc) 26%, transparent); transform: translate(-50%, -50%) rotate(-12deg); }
html.hx-v5 .hx5a-orb-1 { width: min(560px, 96%); height: 150px; }
html.hx-v5 .hx5a-orb-2 { width: min(400px, 70%); height: 104px; border-style: dashed; opacity: .7;
  animation: hx5a-orbita 38s linear infinite; }
html.hx-v5 .hx5a-orb-1::after { content: ""; position: absolute; top: 50%; right: -4px; width: 8px; height: 8px; margin-top: -4px;
  border-radius: 50%; background: var(--v5-acc); box-shadow: 0 0 12px 2px color-mix(in srgb, var(--v5-acc) 60%, transparent); }
html.hx-v5 .hx5a-masc { position: relative; z-index: 1; display: grid; place-items: center; line-height: 0; }
html.hx-v5 .hx5a-masc::after { content: ""; position: absolute; left: 50%; bottom: -8%; width: 58%; height: 14%; transform: translateX(-50%);
  border-radius: 50%; z-index: -1; background: radial-gradient(closest-side, rgba(0, 0, 0, .38), transparent); filter: blur(4px); }
html.hx-v5:not([data-theme="dark"]) .hx5a-masc::after { background: radial-gradient(closest-side, rgba(120, 50, 30, .22), transparent); }
html.hx-v5 .hx5a .hx5a-masc .hx5-rig { --s: clamp(170px, 30vh, 270px) !important; }
html.hx-v5 .hx5a-masc-img { width: clamp(170px, 30vh, 270px); height: auto; }
html.hx-v5 .hx5a-masc-img.is-b { display: none; }
html.hx-v5:not([data-theme="dark"]) .hx5a-masc-img.is-o { display: none; }
html.hx-v5:not([data-theme="dark"]) .hx5a-masc-img.is-b { display: block; }

html.hx-v5 .hx5a-lema h2 { margin: 0 0 20px; max-width: 15ch; font-size: clamp(30px, 3.1vw, 42px); font-weight: 700; line-height: 1.06;
  letter-spacing: -.035em; color: var(--v5-t1); text-wrap: balance; }
html.hx-v5 .hx5a-puntos { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; max-width: 540px; }
html.hx-v5 .hx5a-puntos li { display: flex; align-items: center; gap: 12px; font-size: 14.5px; line-height: 1.4; color: var(--v5-t2); }
html.hx-v5 .hx5a-punto-ico { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px;
  color: var(--hx5a-enlace); background: color-mix(in srgb, var(--v5-acc) 14%, transparent);
  box-shadow: inset 0 0 0 .5px color-mix(in srgb, var(--v5-acc) 30%, transparent); }

/* ── Tarjeta ── */
html.hx-v5 .hx5a-lado { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px 12px; }
html.hx-v5 .hx5a-tarjeta {
  width: min(100%, 404px); padding: 34px 32px 28px; border-radius: 28px; background: var(--hx5a-tarjeta);
  -webkit-backdrop-filter: blur(28px) saturate(1.6); backdrop-filter: blur(28px) saturate(1.6);
  box-shadow: var(--v5-sheetsh), 0 0 0 .5px var(--v5-edge);
  animation: hx5a-entra .7s var(--v5-eo) .06s both;
}
html.hx-v5 .hx5a-tarjeta h1 { margin: 0; font-size: 26px; font-weight: 700; line-height: 1.15; letter-spacing: -.028em; color: var(--v5-t1); }
html.hx-v5 .hx5a-sub { margin: 6px 0 0; font-size: 14px; line-height: 1.45; color: var(--v5-t2); }
html.hx-v5 .hx5a-form { display: flex; flex-direction: column; gap: 16px; margin-top: 26px; }
html.hx-v5 .hx5a-campo { display: flex; flex-direction: column; gap: 7px; }
html.hx-v5 .hx5a-campo > label { font-size: 13px; font-weight: 600; color: var(--v5-t1); }
html.hx-v5 .hx5a-control { position: relative; }
html.hx-v5 .hx5a-control > svg { position: absolute; left: 14px; top: 50%; margin-top: -9px; color: var(--v5-t3); pointer-events: none;
  transition: color .18s var(--v5-eo); }
html.hx-v5 .hx5a-input {
  display: block; width: 100%; height: 48px; margin: 0; padding: 0 14px 0 42px; border: 0; border-radius: 14px;
  font: inherit; font-size: 15px; color: var(--v5-t1); background: var(--hx5a-campo); box-shadow: inset 0 0 0 1px var(--hx5a-linea);
  -webkit-appearance: none; appearance: none; outline: 0;
  transition: box-shadow .18s var(--v5-eo), background .18s var(--v5-eo);
}
html.hx-v5 .hx5a-input.con-ojo { padding-right: 50px; }
html.hx-v5 .hx5a-input::placeholder { color: var(--v5-t3); opacity: 1; }
html.hx-v5 .hx5a-input:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--v5-t1) 22%, transparent); }
html.hx-v5 .hx5a-input:focus { background: var(--hx5a-campo-2);
  box-shadow: inset 0 0 0 1.5px var(--v5-acc), 0 0 0 4px color-mix(in srgb, var(--v5-acc) 20%, transparent); }
html.hx-v5 .hx5a-control:focus-within > svg { color: var(--v5-acc); }
html.hx-v5 .hx5a-input[aria-invalid="true"] { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, #FF453A 75%, transparent); }
html.hx-v5 .hx5a-input[aria-invalid="true"]:focus { box-shadow: inset 0 0 0 1.5px #FF453A, 0 0 0 4px rgba(255, 69, 58, .18); }
html.hx-v5 .hx5a-input:-webkit-autofill { -webkit-text-fill-color: var(--v5-t1); caret-color: var(--v5-t1);
  -webkit-box-shadow: inset 0 0 0 1px var(--hx5a-linea), inset 0 0 0 60px color-mix(in srgb, var(--v5-acc) 9%, var(--v5-card)); }
html.hx-v5 .hx5a-ojo {
  position: absolute; right: 6px; top: 50%; width: 38px; height: 38px; margin-top: -19px; padding: 0; border: 0; border-radius: 11px;
  display: grid; place-items: center; color: var(--v5-t3); background: none; cursor: pointer;
  transition: color .16s var(--v5-eo), background .16s var(--v5-eo);
}
html.hx-v5 .hx5a-ojo:hover { color: var(--v5-t1); background: var(--hx5a-campo); }
html.hx-v5 .hx5a-ojo[aria-pressed="true"] { color: var(--hx5a-enlace); }
html.hx-v5 .hx5a-ayuda { margin: 0; font-size: 12.5px; color: var(--v5-t2); }

html.hx-v5 .hx5a-check { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; line-height: 1.45; color: var(--v5-t2); cursor: pointer; }
html.hx-v5 .hx5a-check input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--hx5a-btn); cursor: pointer; }
html.hx-v5 .hx5a-check input[aria-invalid="true"] { outline: 2px solid #FF453A; outline-offset: 2px; border-radius: 4px; }

/* Error inline: vacío no ocupa sitio; con texto, aviso coral con icono (el texto lo pone el JS con textContent). */
html.hx-v5 .hx5a-error { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 11px 14px; border-radius: 14px;
  font-size: 13.5px; font-weight: 500; line-height: 1.4; color: var(--hx5a-err); background: var(--hx5a-err-bg);
  box-shadow: inset 0 0 0 .5px color-mix(in srgb, #FF453A 30%, transparent); animation: hx5a-aviso .32s var(--v5-eo) both; }
html.hx-v5 .hx5a-error::before { content: ""; flex: none; width: 18px; height: 18px; margin-top: -1px; background: currentColor;
  -webkit-mask: var(--hx5a-ico-alerta) center / 18px no-repeat; mask: var(--hx5a-ico-alerta) center / 18px no-repeat; }
html.hx-v5 .hx5a-error:empty { display: none; }
html.hx-v5 .hx5a { --hx5a-ico-alerta: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='M12 7.5v5.2M12 16.3v.2'/%3E%3C/svg%3E"); }

/* Botón: coral sólido v5 (sin el filo de cristal del acceso de antes) con su estado de carga. */
html.hx-v5 .hx5a-btn {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 50px; margin: 6px 0 0;
  padding: 0 20px; border: 0; border-radius: 999px; font: inherit; font-size: 15px; font-weight: 600; letter-spacing: -.01em;
  color: #fff; background: var(--hx5a-btn); cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .20), 0 12px 26px -12px color-mix(in srgb, var(--v5-acc) 80%, transparent);
  transition: background .18s var(--v5-eo), transform .12s var(--v5-eo), box-shadow .2s var(--v5-eo);
}
html.hx-v5 .hx5a-btn:hover { background: var(--hx5a-btn-2); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .20), 0 16px 30px -12px color-mix(in srgb, var(--v5-acc) 90%, transparent); }
html.hx-v5 .hx5a-btn:active { transform: scale(.98); }
html.hx-v5 .hx5a-btn:disabled { cursor: default; transform: none; }
html.hx-v5 .hx5a-btn:disabled:not(.is-cargando) { opacity: .6; }
html.hx-v5 .hx5a-btn.is-cargando { cursor: progress; }
html.hx-v5 .hx5a-spin { display: none; width: 17px; height: 17px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff; animation: hx5a-gira .7s linear infinite; }
html.hx-v5 .hx5a-btn.is-cargando .hx5a-spin { display: block; }

html.hx-v5 .hx5a-pie { margin: 22px 0 0; text-align: center; font-size: 14px; color: var(--v5-t2); }
html.hx-v5 .hx5a a { color: var(--hx5a-enlace); font-weight: 600; text-decoration: none; border-radius: 4px; }
html.hx-v5 .hx5a a:hover { text-decoration: underline; text-underline-offset: 3px; }
html.hx-v5 .hx5a-check a { font-weight: 500; text-decoration: underline; text-underline-offset: 2px;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
html.hx-v5 .hx5a-legal { margin: 0; font-size: 12px; color: var(--v5-t2); }
html.hx-v5 .hx5a-legal a { color: inherit; font-weight: 500; }
html.hx-v5 .hx5a-legal span { margin: 0 6px; }

/* Foco visible: anillo coral en todo lo que se pulsa (los campos ya llevan el suyo). */
html.hx-v5 .hx5a :is(a, button, input[type="checkbox"]):focus-visible { outline: 2px solid var(--v5-acc); outline-offset: 2px; }
html.hx-v5 .hx5a-btn:focus-visible { outline-offset: 3px; }

@keyframes hx5a-entra { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes hx5a-aviso { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes hx5a-gira { to { transform: rotate(360deg); } }
@keyframes hx5a-orbita { to { transform: translate(-50%, -50%) rotate(348deg); } }

/* ── Tableta y móvil: una columna, la mascota arriba y la tarjeta debajo ── */
@media (max-width: 959px) {
  html.hx-v5 .hx5a-marco { grid-template-columns: minmax(0, 1fr); align-content: safe center; justify-items: center; gap: 4px;
    padding: max(20px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom)); }
  html.hx-v5 .hx5a-marca { width: 100%; padding: 0; border-radius: 0; overflow: visible; background: none; box-shadow: none;
    -webkit-backdrop-filter: none; backdrop-filter: none; align-items: center; }
  html.hx-v5 .hx5a-logo, html.hx-v5 .hx5a-lema, html.hx-v5 .hx5a-portada, html.hx-v5 .hx5a-orb-2 { display: none; }
  html.hx-v5 .hx5a-marca.tiene-portada .hx5a-escena { display: grid; }
  html.hx-v5 .hx5a-visual { flex: none; min-height: 0; width: 100%; height: 132px; margin: 0; }
  html.hx-v5 .hx5a-orb-1 { width: 250px; height: 62px; }
  html.hx-v5 .hx5a-escena::before { width: 230px; }
  html.hx-v5 .hx5a .hx5a-masc .hx5-rig { --s: 104px !important; }
  html.hx-v5 .hx5a-masc-img { width: 104px; }
  html.hx-v5 .hx5a-lado { width: 100%; padding: 0; justify-content: flex-start; }
  html.hx-v5 .hx5a-tarjeta { width: min(100%, 440px); }
}
/* Teclado abierto (clase is-teclado desde visualViewport en iOS; alto corto en Android, que redimensiona): la
   mascota se recoge y el formulario sube para que el botón quede a la vista. */
@media (max-width: 959px) and (max-height: 600px) {
  html.hx-v5 .hx5a-marco { align-content: start; }
  html.hx-v5 .hx5a-marca { display: none; }
}
@media (max-width: 959px) {
  html.hx-v5 .hx5a.is-teclado .hx5a-marco { align-content: start; }
  html.hx-v5 .hx5a.is-teclado .hx5a-marca { display: none; }
}
@media (max-width: 599px) {
  html.hx-v5 .hx5a-tarjeta { width: 100%; padding: 26px 20px 22px; border-radius: 26px; }
  html.hx-v5 .hx5a-tarjeta h1 { font-size: 24px; }
  html.hx-v5 .hx5a-form { margin-top: 22px; }
  html.hx-v5 .hx5a-input { font-size: 16px; }                 /* 16 px: iOS no hace zoom al enfocar */
}
@media (max-height: 700px) and (min-width: 960px) {
  html.hx-v5 .hx5a-marca { padding-bottom: 32px; }
  html.hx-v5 .hx5a-puntos { gap: 8px; }
  html.hx-v5 .hx5a-lema h2 { margin-bottom: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  html.hx-v5 .hx5a-marca, html.hx-v5 .hx5a-tarjeta, html.hx-v5 .hx5a-error, html.hx-v5 .hx5a-orb-2 { animation: none; }
  html.hx-v5 .hx5a-spin { animation-duration: 1.6s; }
}
