/* Inicio de sesión · composición editorial con el lenguaje de la landing («Sala» clara y «Búnker» oscuro):
   Geist para el titular, Geist Mono para el microtexto, filetes en rejilla de 12 columnas, la R como pieza estructural
   cortada por el borde y el acceso directamente sobre la superficie: campos de línea numerados, sin tarjeta. */
@font-face { font-family: "Geist"; src: url("/landing/fonts/Geist-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/landing/fonts/GeistMono-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
:root {
    --lg-sans: "Geist", "Helvetica Neue", Helvetica, system-ui, sans-serif;
    --lg-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
    --lg-bg: #050506; --lg-fg: #F5F5F7; --lg-muted: #8A8A8F;
    --lg-linea: rgba(255, 255, 255, .08); --lg-linea-fuerte: rgba(255, 255, 255, .2);
    --lg-acento: #0A84FF; --lg-acento-texto: #4DA3FF; --lg-error: #FF6961;
    --lg-r: rgba(255, 255, 255, .22);
    --lg-ease: cubic-bezier(.22, 1, .36, 1);
    color-scheme: dark;
}
html[data-theme="light"] {
    --lg-bg: #FBFBFA; --lg-fg: #0B0B0C; --lg-muted: #6E6E73;
    --lg-linea: rgba(0, 0, 0, .07); --lg-linea-fuerte: rgba(0, 0, 0, .22);
    --lg-acento-texto: #0060C7; --lg-error: #D70015; --lg-r: rgba(0, 0, 0, .2);
    color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--lg-bg); }
body { color: var(--lg-fg); font-family: var(--lg-sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; transition: background-color .4s ease, color .4s ease; }
.lg-mono { font-family: var(--lg-mono); font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--lg-muted); }

/* Rejilla: 12 columnas; los filetes verticales marcan la composición (como la rejilla de la landing). */
.lg {
    --margen: clamp(20px, 3.4vw, 56px);
    position: relative; isolation: isolate; display: grid; min-height: 100vh; min-height: 100dvh; overflow: hidden;
    grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: auto auto 1fr auto; column-gap: 0;
    padding: max(18px, env(safe-area-inset-top)) var(--margen) max(18px, env(safe-area-inset-bottom));
}
.lg-rejilla { position: absolute; inset: 0 var(--margen); z-index: -1; display: grid; grid-template-columns: repeat(6, 1fr); pointer-events: none; }
.lg-rejilla i { border-left: 1px solid var(--lg-linea); }
.lg-rejilla i:last-child { border-right: 1px solid var(--lg-linea); }

/* La R: enorme, en trazo fino, cortada por el borde inferior izquierdo. Un barrido de luz azul la recorre despacio. */
.lg-r { position: absolute; z-index: -1; left: -10vw; bottom: -24vh; width: max(92vw, 1000px); height: auto; overflow: visible; pointer-events: none; transform: translate3d(var(--lg-px, 0px), var(--lg-py, 0px), 0); transition: transform 1.4s var(--lg-ease); }
.lg-r__trazo { fill: none; stroke: var(--lg-r); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.lg-r__barrido { fill: var(--lg-acento); opacity: .09; }
html[data-theme="light"] .lg-r__barrido { opacity: .07; }

/* Cabecera: marca y acciones, alineadas con la rejilla y separadas del cuerpo por un filete. */
.lg-cab { grid-row: 1; grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--lg-linea); }
.lg-marca { display: inline-flex; align-items: center; gap: 10px; color: var(--lg-fg); text-decoration: none; font-family: var(--lg-mono); font-size: 12px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; }
.lg-marca svg { width: 26px; height: auto; fill: currentColor; }
.lg-cab__acciones { display: flex; align-items: center; gap: 18px; }
.lg-tema { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid var(--lg-linea-fuerte); border-radius: 50%; background: none; color: var(--lg-fg); cursor: pointer; transition: border-color .2s ease, transform .3s var(--lg-ease); }
.lg-tema:hover { border-color: var(--lg-acento); transform: rotate(-12deg); }
.lg-tema svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
html[data-theme="dark"] .lg-tema__sol, html[data-theme="light"] .lg-tema__luna { display: none; }
.lg-volver { position: relative; color: var(--lg-muted); font-family: var(--lg-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; text-decoration: none; padding: 10px 0; transition: color .2s ease; }
.lg-volver:hover { color: var(--lg-fg); }
:is(.lg-volver, .lg-marca, .lg-tema):focus-visible { outline: 2px solid var(--lg-acento); outline-offset: 4px; border-radius: 4px; }
.beta-notice-host { grid-row: 2; grid-column: 1 / -1; }
.beta-notice-host:empty { display: none; }

/* Cuerpo: titular en las columnas 1-7, acceso en las 8-12, ambos apoyados en la misma línea base. */
.lg-main { grid-row: 3; grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: end; padding-block: clamp(40px, 9vh, 120px) clamp(32px, 7vh, 88px); }
.lg-titular { grid-column: 1 / 8; padding-right: var(--margen); }
.lg-titular h1 { margin: 22px 0 0; font-size: clamp(56px, 9.2vw, 168px); font-weight: 600; line-height: .86; letter-spacing: -.06em; }
.lg-titular h1 em { font-style: normal; color: var(--lg-acento-texto); }
.lg-bajada { max-width: 26ch; margin: clamp(20px, 3vh, 32px) 0 0; color: var(--lg-muted); font-size: clamp(16px, 1.25vw, 19px); line-height: 1.45; }
.lg-acceso { grid-column: 9 / 13; align-self: end; }

/* Campos de línea: etiqueta numerada en mono, texto grande, un filete que se ilumina en azul al enfocar. */
.lg-campo { position: relative; margin-bottom: 30px; }
.lg-campo label { display: flex; align-items: baseline; gap: 12px; color: var(--lg-muted); font-size: 13px; }
.lg-campo label .lg-mono { color: var(--lg-acento-texto); letter-spacing: .1em; }
.lg-campo input { width: 100%; height: 50px; padding: 0; border: 0; border-bottom: 1px solid var(--lg-linea-fuerte); border-radius: 0; outline: none; background: transparent; color: var(--lg-fg); font: 400 21px var(--lg-sans); letter-spacing: -.01em; caret-color: var(--lg-acento); }
.lg-campo input::placeholder { color: var(--lg-muted); opacity: .45; }
.lg-campo input:-webkit-autofill { -webkit-text-fill-color: var(--lg-fg); transition: background-color 9999s; }
.lg-campo__linea { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--lg-acento); transform: scaleX(0); transform-origin: 0 50%; transition: transform .6s var(--lg-ease); }
.lg-campo:focus-within .lg-campo__linea { transform: scaleX(1); }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 84px; }
.password-toggle { position: absolute; right: 0; bottom: 12px; padding: 4px 0; border: 0; background: none; color: var(--lg-muted); font-family: var(--lg-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; cursor: pointer; }
.password-toggle:hover, .password-toggle[aria-pressed="true"] { color: var(--lg-fg); }
.password-toggle:focus-visible { outline: 2px solid var(--lg-acento); outline-offset: 3px; }

/* Estados: error en línea y carga en el botón (el script alterna display y .loading). */
.error { display: none; margin: -10px 0 22px; padding-left: 12px; border-left: 2px solid var(--lg-error); color: var(--lg-error); font-size: 14px; line-height: 1.45; }
.submit { position: relative; display: block; width: 100%; height: 58px; padding: 0 22px; border: 0; border-radius: 999px; background: var(--lg-fg); color: var(--lg-bg); font: 600 16px var(--lg-sans); letter-spacing: -.01em; cursor: pointer; overflow: hidden; transition: transform .3s var(--lg-ease), background-color .3s ease, color .3s ease; }
.submit::before { content: ""; position: absolute; inset: 0; background: var(--lg-acento); transform: translateX(-101%); transition: transform .55s var(--lg-ease); }
.submit:hover::before, .submit:focus-visible::before, .submit.loading::before { transform: none; }
.submit:hover, .submit:focus-visible, .submit.loading { color: #FFFFFF; }
.submit:active { transform: scale(.985); }
.submit:focus-visible { outline: 2px solid var(--lg-acento); outline-offset: 4px; }
.submit:disabled { cursor: wait; }
.submit-content { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.submit-flecha { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .45s var(--lg-ease); }
.submit:hover .submit-flecha { transform: translateX(4px); }
.submit-spinner { display: none; width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #FFFFFF; border-radius: 50%; animation: lg-giro .75s linear infinite; }
.submit.loading .submit-spinner { display: inline-block; }
.submit.loading .submit-flecha { display: none; }
@keyframes lg-giro { to { transform: rotate(360deg); } }
.oauth-divider { display: flex; align-items: center; gap: 14px; margin: 22px 0 6px; }
.oauth-divider::before, .oauth-divider::after { content: ""; flex: 1; height: 1px; background: var(--lg-linea); }
/* Google como una línea más de la composición, no como otro botón-caja. */
.google-submit { display: flex; align-items: center; gap: 14px; width: 100%; height: 54px; padding: 0; border: 0; border-bottom: 1px solid var(--lg-linea-fuerte); background: none; color: var(--lg-fg); font: 500 16px var(--lg-sans); text-align: left; cursor: pointer; transition: border-color .3s ease, gap .4s var(--lg-ease); }
.google-submit::after { content: "→"; margin-left: auto; color: var(--lg-muted); transition: transform .4s var(--lg-ease), color .2s ease; }
.google-submit:hover:not(:disabled) { border-color: var(--lg-acento); gap: 18px; }
.google-submit:hover::after { transform: translateX(4px); color: var(--lg-fg); }
.google-submit:focus-visible { outline: 2px solid var(--lg-acento); outline-offset: 4px; }
.google-submit:disabled { cursor: not-allowed; opacity: .5; }
.google-icon { width: 18px; height: 18px; flex: 0 0 18px; }

.lg-pie { grid-row: 4; grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 16px; padding-top: 16px; border-top: 1px solid var(--lg-linea); }

/* Entrada: el titular sube por líneas y el acceso aparece después (solo opacidad y transform). */
@media (prefers-reduced-motion: no-preference) {
    .lg-titular > *, .lg-acceso, .lg-r { animation: lg-entra 1.1s var(--lg-ease) both; }
    .lg-titular h1 { animation-delay: .08s; }
    .lg-bajada { animation-delay: .16s; }
    .lg-acceso { animation-delay: .24s; }
    .lg-r { animation-name: lg-entra-r; animation-duration: 1.8s; }
}
@keyframes lg-entra { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes lg-entra-r { from { opacity: 0; } to { opacity: 1; } }

/* Tablet: el acceso ocupa más columnas. */
@media (max-width: 1100px) { .lg-titular { grid-column: 1 / 7; } .lg-acceso { grid-column: 7 / 13; } }
/* Móvil: la R sube y se corta por la derecha; titular arriba y el acceso a todo el ancho, sobre la misma superficie. */
@media (max-width: 760px) {
    .lg { grid-template-columns: minmax(0, 1fr); }
    .lg-rejilla { grid-template-columns: repeat(2, 1fr); }
    .lg-main { grid-template-columns: minmax(0, 1fr); align-content: space-between; padding-block: 36px 28px; row-gap: 48px; }
    .lg-titular, .lg-acceso { grid-column: 1; padding-right: 0; }
    .lg-titular h1 { font-size: clamp(56px, 17vw, 84px); }
    .lg-r { left: auto; right: -58vw; bottom: auto; top: 6vh; width: 165vw; }
    .lg-volver { font-size: 10px; }
    .lg-pie { flex-direction: column; gap: 4px; }
    .lg-campo input { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) { .lg-r, .lg-campo__linea, .submit, .submit::before, .google-submit { transition: none; } }
