/* ═══════════════════════════════════════════════════════════════════
   Qorum — auth (registro, entrar, nueva clave, bienvenida)
   Mismo sistema que la landing (tokens en sistema.css): fondo claro frío,
   una tarjeta blanca para el formulario, campos con etiqueta arriba y un
   solo azul para la acción. Apple: respuesta al apretar, foco visible,
   reduced-motion / reduced-transparency / más contraste.
   ═══════════════════════════════════════════════════════════════════ */
* { margin: 0; padding: 0; box-sizing: border-box; }
body.auth {
  min-height: 100vh; font-family: var(--font); font-size: 17px; line-height: 1.5; letter-spacing: -0.005em;
  color: var(--tinta); background: var(--fondo); font-feature-settings: "ss01";
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  display: flex; flex-direction: column; padding: 14px var(--gutter) 32px; overflow-x: hidden;
}
a { color: inherit; }
h1, h2 { text-wrap: balance; font-weight: 600; }
p { text-wrap: pretty; }
::selection { background: var(--ciudad); color: #fff; }
:focus-visible { outline: 2.5px solid var(--accion); outline-offset: 3px; border-radius: 6px; }
input { caret-color: var(--accion); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ─── Marca: la Q de bancas, como en la landing ─── */
.auth-brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; align-self: flex-start; color: var(--tinta);
  margin-left: max(0px, calc((100vw - 2 * var(--gutter) - 1080px) / 2)); }
.auth-brand svg { width: 28px; height: 28px; overflow: visible; }
.auth-brand .ring circle { fill: var(--tinta); }
.auth-brand .tail circle { fill: var(--ciudad); }
.auth-brand b { font-size: 15px; letter-spacing: 0.16em; font-weight: 700; }

/* ─── Dos columnas: el porqué a la izquierda, el formulario a la derecha ─── */
.auth-shell {
  flex: 1; width: 100%; max-width: 1080px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 440px); gap: clamp(40px, 7vw, 104px);
  align-items: center; padding: clamp(24px, 6vh, 64px) 0;
}
.auth-aside h2 { font-size: clamp(40px, 4.6vw, 60px); line-height: 1.04; letter-spacing: -0.038em; max-width: 12ch; }
.auth-aside p { margin-top: 20px; font-size: 19px; line-height: 1.5; color: var(--tinta-2); max-width: 32em; }
.auth-valor { list-style: none; margin-top: 28px; display: flex; flex-direction: column; max-width: 32em; }
.auth-valor li { display: flex; gap: 14px; align-items: baseline; padding: 14px 0; border-top: 1px solid var(--regla); font-size: 15px; color: var(--tinta-2); }
.auth-valor li:last-child { border-bottom: 1px solid var(--regla); }
.auth-valor li b { color: var(--tinta); font-weight: 600; }
/* Tilde, no viñeta de color */
.auth-valor li i { flex: none; width: 11px; height: 6px; border-left: 2px solid var(--ciudad); border-bottom: 2px solid var(--ciudad); transform: translateY(-3px) rotate(-45deg); }
.auth-cifra { margin-top: 24px; display: inline-flex; align-items: baseline; gap: 8px; font-size: 15px; color: var(--tinta-3); }
.auth-cifra b { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 22px; letter-spacing: -0.02em; color: var(--tinta); }
/* La pregunta de ejemplo, con forma de mensaje del chat */
.auth-cita {
  display: inline-block; margin-top: 28px !important; max-width: 30em; padding: 11px 16px; border-radius: 18px 18px 6px 18px;
  background: var(--tinta); color: #fff !important; font-size: 15px !important; font-weight: 400; line-height: 1.45;
}

/* ─── La tarjeta ─── */
.login, .auth-card {
  width: 100%; background: var(--superficie); border-radius: 18px; padding: 34px clamp(24px, 4vw, 38px) 30px;
  box-shadow: var(--sombra-tarjeta);
}
.login-head { margin-bottom: 24px; }
.login h1, .ob-card h1 { font-size: 30px; letter-spacing: -0.03em; line-height: 1.1; }
.login h1 em, .ob-card h1 em { font-style: normal; }
.login-sub, .auth-sub { margin-top: 8px; font-size: 15px; line-height: 1.5; color: var(--tinta-3); }
.auth-sub strong { color: var(--tinta); }

/* ─── Campos: etiqueta arriba, borde fino, foco azul ─── */
.lf { position: relative; display: block; margin-bottom: 14px; }
.lf-main { display: block; }
.lf-label { display: block; margin: 0 2px 6px; font-size: 13.5px; font-weight: 400; color: var(--tinta-2); }
.lf input {
  width: 100%; height: 48px; padding: 0 14px; font: inherit; font-size: 17px; color: var(--tinta);
  background: var(--superficie); border: 1px solid var(--regla-2); border-radius: 12px; outline: none;
  transition: border-color 150ms var(--ease-out), box-shadow 150ms var(--ease-out);
}
.lf input:hover { border-color: var(--tinta-3); }
.lf input:focus { border-color: var(--accion); box-shadow: 0 0 0 4px var(--accion-velo); }
.lf input::placeholder { color: var(--placeholder); }
.lf-icon { display: none; }

.auth-extra { text-align: right; margin: -4px 2px 14px; }
.auth-extra a { font-size: 13.5px; color: var(--accion); text-decoration: none; }
.auth-extra a:hover { text-decoration: underline; text-underline-offset: 3px; }

.auth-msg { min-height: 20px; margin: 2px 2px 12px; font-size: 13.5px; color: var(--tinta-2); }
.auth-msg:empty { min-height: 0; margin: 0; }
.auth-msg.err { padding: 10px 12px; border-radius: 8px; background: var(--error-velo); color: var(--error); }

/* ─── Botón: el único azul ─── */
.btn-auth {
  width: 100%; min-height: 48px; padding: 14px 18px; border: 0; border-radius: 999px; cursor: pointer; touch-action: manipulation;
  font: 600 16px/1.2 var(--font); letter-spacing: -0.01em; color: #fff; background: var(--accion);
  transition: transform 120ms ease-out, background-color 160ms var(--ease-out);
}
.btn-auth:hover { background: var(--accion-2); }
.btn-auth:active { transform: scale(0.97); transition-duration: 40ms; }
.btn-auth:disabled { opacity: 0.55; cursor: default; }

/* ─── Separador y accesos sociales (todavía no habilitados) ─── */
.auth-sep { display: flex; align-items: center; gap: 14px; margin: 22px 0 14px; font-size: 13.5px; color: var(--tinta-3); }
.auth-sep::before, .auth-sep::after { content: ''; flex: 1; height: 1px; background: var(--regla); }
.social-row { display: flex; gap: 10px; }
.btn-social {
  flex: 1; min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 9px; padding: 10px;
  font: 400 15px var(--font); color: var(--tinta); background: var(--superficie); cursor: pointer;
  border: 1px solid var(--regla-2); border-radius: 999px;
  transition: border-color 160ms var(--ease-out), transform 120ms ease-out;
}
.btn-social:hover:not(.soon) { border-color: var(--tinta); }
.btn-social:active:not(.soon) { transform: scale(0.97); }
.btn-social svg { width: 18px; height: 18px; }
.btn-social.soon { opacity: 0.5; cursor: not-allowed; }
.btn-social.soon svg path { fill: currentColor; }

.auth-switch { margin-top: 24px; text-align: center; font-size: 15px; color: var(--tinta-3); }
.auth-switch a { color: var(--accion); font-weight: 600; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; text-underline-offset: 3px; }
.auth-fine { margin-top: 16px; font-size: 13.5px; line-height: 1.55; color: var(--tinta-3); }
.auth-fine a { color: var(--tinta-2); text-decoration: underline; text-underline-offset: 2px; }

/* ═══ Bienvenida (/onboarding): la Q se arma banca por banca, saludo y primera pregunta ═══ */
.bv { flex: 1; width: 100%; max-width: 640px; margin: 0 auto; padding: clamp(28px, 9vh, 96px) 0 24px;
  display: flex; flex-direction: column; align-items: center; text-align: center; }
.bv > * { animation: bv-entra 520ms var(--ease-out) both; }
.bv > :nth-child(2) { animation-delay: 380ms; } .bv > :nth-child(3) { animation-delay: 440ms; }
.bv > :nth-child(4) { animation-delay: 500ms; } .bv > :nth-child(5) { animation-delay: 540ms; }
.bv > :nth-child(6) { animation-delay: 580ms; } .bv > :nth-child(7) { animation-delay: 620ms; }
.bv > :nth-child(8) { animation-delay: 660ms; }
@keyframes bv-entra { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.bv-sello { width: 88px; height: 88px; margin-bottom: 28px; animation: none !important; }
.bv-sello svg { width: 100%; height: 100%; overflow: visible; }
.bv-sello circle { opacity: 0.12; animation: bv-banca 480ms calc(120ms + var(--i) * 60ms) var(--ease-out) forwards; transform-box: fill-box; transform-origin: center; }
.bv-anillo circle { fill: var(--tinta); }
.bv-cola circle { fill: var(--ciudad); }
@keyframes bv-banca { 0% { opacity: 0.12; transform: scale(0.7); } 100% { opacity: 1; transform: scale(1); } }

.bv-titulo { font-size: clamp(44px, 6vw, 64px); line-height: 1.04; letter-spacing: -0.038em; }
.bv-titulo em { font-style: normal; }
.bv-sub { margin-top: 14px; max-width: 32em; font-size: 19px; line-height: 1.5; color: var(--tinta-2); }
.bv-sub b { color: var(--tinta); font-weight: 600; }

.bv-aviso { width: 100%; margin-top: 26px; display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px; text-align: left;
  border-radius: 18px; background: var(--superficie); box-shadow: inset 0 0 0 1px var(--regla); font-size: 15px; line-height: 1.5; color: var(--tinta-2); }
.bv-aviso[hidden] { display: none; }
.bv-aviso svg { flex: 0 0 20px; width: 20px; height: 20px; margin-top: 2px; color: var(--accion); }
.bv-aviso b { color: var(--tinta); word-break: break-all; }
.bv-aviso button { font: inherit; font-weight: 600; color: var(--accion); background: none; border: none; padding: 0; cursor: pointer; }
.bv-aviso button:hover { text-decoration: underline; text-underline-offset: 3px; }
.bv-aviso button:disabled { cursor: default; text-decoration: none; color: var(--tinta-3); }

/* La caja de pregunta: la misma del chat */
.bv-preguntar { width: 100%; margin-top: 36px; display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 22px;
  border-radius: 999px; background: var(--superficie); box-shadow: inset 0 0 0 1px var(--regla-2), var(--sombra-vidrio);
  transition: box-shadow 160ms var(--ease-out); }
.bv-preguntar:focus-within { box-shadow: inset 0 0 0 1.5px var(--accion), 0 0 0 4px var(--accion-velo), var(--sombra-vidrio); }
.bv-preguntar input { flex: 1; min-width: 0; padding: 12px 0; font: inherit; font-size: 17px; color: var(--tinta); background: none; border: none; outline: none; }
.bv-preguntar input::placeholder { color: var(--placeholder); }
.bv-preguntar button { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border: none; border-radius: 50%; cursor: pointer;
  background: var(--accion); color: #fff; transition: transform 120ms ease-out, background-color 160ms var(--ease-out); }
.bv-preguntar button:hover { background: var(--accion-2); }
.bv-preguntar button:active { transform: scale(0.92); transition-duration: 40ms; }
.bv-preguntar button svg { width: 20px; height: 20px; }

.bv-chips { margin-top: 14px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.bv-chips button { font: 400 15px/1.2 var(--font); color: var(--accion); background: var(--accion-velo); border: 0; border-radius: 999px;
  padding: 9px 14px; cursor: pointer; transition: background-color 150ms var(--ease-out), transform 120ms ease-out; }
.bv-chips button:hover { background: rgba(0, 98, 230, 0.14); }
.bv-chips button:active { transform: scale(0.96); transition-duration: 40ms; }

.bv-claves { list-style: none; width: 100%; margin-top: 48px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; text-align: left; }
.bv-claves li { padding-top: 14px; border-top: 1px solid var(--regla-2); font-size: 15px; line-height: 1.5; color: var(--tinta-3); }
.bv-claves b { display: block; margin-bottom: 2px; color: var(--tinta); font-weight: 600; }

.bv-panel { margin-top: 40px; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 11px 22px; border-radius: 999px;
  text-decoration: none; font-size: 16px; font-weight: 600; color: var(--tinta); border: 1.5px solid rgba(11, 13, 17, 0.22);
  transition: border-color 160ms var(--ease-out), transform 120ms ease-out; }
.bv-panel:hover { border-color: var(--tinta); }
.bv-panel:active { transform: scale(0.97); transition-duration: 40ms; }
.bv-panel svg { width: 18px; height: 18px; }

/* ─── Preferencias ─── */
@media (prefers-reduced-motion: reduce) {
  .btn-auth, .btn-social, .lf input { transition: none; }
  .bv > * { animation: none; }
  .bv-sello circle { animation: none; opacity: 1; }
}
@media (prefers-contrast: more) {
  .login, .auth-card { box-shadow: inset 0 0 0 1.5px var(--tinta); }
  .lf input { border-color: var(--tinta-2); }
}

/* ─── Responsive ─── */
@media (max-width: 860px) {
  .auth-shell { grid-template-columns: 1fr; max-width: 480px; gap: 24px; padding-top: 16px; align-items: start; }
  .auth-aside h2 { font-size: 36px; line-height: 1.08; letter-spacing: -0.03em; max-width: none; }
  .auth-aside p { margin-top: 12px; font-size: 17px; }
  .auth-valor, .auth-cita, .auth-cifra { display: none; }
}
@media (max-width: 640px) {
  .bv { padding-top: 32px; }
  .bv-titulo { font-size: 40px; }
  .bv-sub { font-size: 17px; }
  .bv-claves { grid-template-columns: 1fr; gap: 14px; margin-top: 36px; }
}
@media (max-width: 420px) {
  body.auth { padding: 10px 24px 28px; }
  .login, .auth-card { padding: 26px 20px 24px; border-radius: 18px; }
  .login h1 { font-size: 26px; }
}
