/* ============================================
   factux — login page (one-line per rule, CLAUDE.md §16)
   Tokens, fonts y componentes — copiados verbatim del manual de marca.
   ============================================ */

:root { --tinta: #15161A; --tinta-2: #2A2C34; --tinta-3: #4A4D58; --carbon: #6B6E7A; --niebla: #A8AAB3; --linea: #E4E4E7; --linea-warm: #DDD7C5; --papel: #FFFFFF; --papel-crema: #F4F0E6; --papel-soft: #F9F6EE; --cielo: #1B36E8; --cielo-hover: #1428C2; --cielo-glow: rgba(27, 54, 232, 0.15); --lima: #D9F25C; --rechazado: #B81F1F; --rechazado-bg: #F3D6D2; --aprobado: #1A8754; --sans: "Bricolage Grotesque", system-ui, sans-serif; --mono: "JetBrains Mono", monospace; --serif: "Newsreader", Georgia, serif; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: var(--sans); color: var(--tinta); background: var(--papel-crema); -webkit-font-smoothing: antialiased; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
input, button { font-family: inherit; }

/* ---- layout ---- */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 40% 60%; }

/* ---- LEFT — dark column ---- */
.login-left { background: var(--tinta); color: var(--papel); padding: 48px 56px; display: grid; grid-template-rows: auto 1fr auto; gap: 40px; position: relative; overflow: hidden; }
.login-left::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(circle, rgba(255,255,255,0.05) 1px, transparent 1.5px); background-size: 24px 24px; mask-image: radial-gradient(ellipse at 30% 40%, black 20%, transparent 80%); -webkit-mask-image: radial-gradient(ellipse at 30% 40%, black 20%, transparent 80%); pointer-events: none; }
.login-left::after { content: "x"; position: absolute; bottom: -120px; right: -60px; font-family: var(--serif); font-style: italic; font-size: 520px; font-weight: 400; line-height: 0.8; color: var(--cielo); opacity: 0.18; letter-spacing: -0.08em; pointer-events: none; user-select: none; }

.left-top { display: flex; justify-content: space-between; align-items: flex-start; position: relative; z-index: 1; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px 5px 9px; background: rgba(26,135,84,0.16); color: #6FD79A; border-radius: 999px; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; }
.status-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: #6FD79A; animation: pulse 2.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(0.85); } }
.left-meta { font-family: var(--mono); font-size: 10.5px; color: var(--carbon); letter-spacing: 0.05em; text-transform: uppercase; text-align: right; line-height: 1.7; }
.left-meta b { color: var(--papel); font-family: var(--sans); font-weight: 500; letter-spacing: -0.005em; text-transform: none; }

.left-main { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: center; gap: 32px; }
.logo { font-family: var(--sans); font-weight: 800; font-size: clamp(80px, 7.5vw, 116px); line-height: 0.9; letter-spacing: -0.06em; color: var(--papel); }
.logo .x { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--lima); letter-spacing: -0.09em; }

.tagline { font-size: 22px; line-height: 1.4; color: var(--niebla); max-width: 440px; text-wrap: pretty; }
.tagline em { font-family: var(--serif); font-style: italic; color: var(--papel); font-weight: 400; }

.benefits { list-style: none; display: grid; gap: 14px; margin-top: 8px; }
.benefits li { display: grid; grid-template-columns: 22px 1fr; align-items: center; gap: 14px; font-size: 16px; color: var(--papel); letter-spacing: -0.005em; }
.benefits .check { width: 22px; height: 22px; border-radius: 50%; background: var(--lima); color: var(--tinta); display: grid; place-items: center; font-size: 13px; font-weight: 700; font-family: var(--sans); line-height: 1; }
.benefits li b { font-weight: 500; }

.left-foot { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: center; padding-top: 32px; border-top: 1px solid var(--tinta-3); font-size: 14px; color: var(--niebla); flex-wrap: wrap; gap: 12px; }
.left-foot a { color: var(--papel); font-weight: 500; display: inline-flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--tinta-3); padding-bottom: 1px; transition: border-color 0.2s ease; }
.left-foot a:hover { border-bottom-color: var(--lima); }
.left-foot a .arr { font-family: var(--mono); color: var(--lima); font-weight: 500; }

/* ---- RIGHT — cream column ---- */
.login-right { background: var(--papel-crema); display: flex; align-items: center; justify-content: center; padding: 48px 56px; position: relative; }
.login-right::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(circle, rgba(0,0,0,0.04) 1px, transparent 1.5px); background-size: 22px 22px; mask-image: radial-gradient(ellipse at 50% 40%, transparent 30%, black 90%); -webkit-mask-image: radial-gradient(ellipse at 50% 40%, transparent 30%, black 90%); pointer-events: none; }

.login-card { width: 100%; max-width: 440px; position: relative; z-index: 1; }
.right-meta { font-family: var(--mono); font-size: 10.5px; color: var(--carbon); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 24px; display: flex; align-items: center; gap: 8px; }
.right-meta::before { content: ""; width: 24px; height: 1px; background: var(--linea-warm); }

.login-card h1 { font-size: 44px; line-height: 1; letter-spacing: -0.035em; font-weight: 500; margin-bottom: 10px; text-wrap: balance; }
.login-card h1 em { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--cielo); }
.login-card .subtitle { font-size: 16px; color: #6B6E7A; margin-bottom: 36px; line-height: 1.45; }

/* ---- form ---- */
.login-form { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
.field label { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 500; letter-spacing: -0.005em; color: var(--tinta); }
.field label .forgot { font-size: 12px; font-weight: 400; color: var(--cielo); transition: opacity 0.2s ease; }
.field label .forgot:hover { opacity: 0.7; }

.input-wrap { position: relative; }
.field input[type="email"], .field input[type="password"], .field input[type="text"] { width: 100%; height: 48px; padding: 0 14px; background: var(--papel); border: 1px solid var(--linea-warm); border-radius: 7px; font-size: 15px; color: var(--tinta); font-family: var(--sans); letter-spacing: -0.005em; transition: border-color 0.15s ease, box-shadow 0.15s ease; outline: none; }
.field input::placeholder { color: #9B9991; font-family: var(--sans); }
.field input:hover { border-color: #C8C2AE; }
.field input:focus { border-color: var(--cielo); box-shadow: 0 0 0 4px var(--cielo-glow); }
.field input[type="password"] { padding-right: 44px; letter-spacing: 0.1em; }
.show-pass { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: transparent; border: none; width: 32px; height: 32px; border-radius: 5px; display: grid; place-items: center; color: var(--carbon); transition: color 0.15s ease, background 0.15s ease; }
.show-pass:hover { color: var(--tinta); background: rgba(0,0,0,0.04); }
.show-pass svg { width: 16px; height: 16px; }

/* ---- error state ---- */
.field.error input { border-color: var(--rechazado); background: #FDF5F4; }
.field.error input:focus { box-shadow: 0 0 0 4px rgba(184, 31, 31, 0.12); }
.error-msg { display: none; font-size: 12px; color: var(--rechazado); line-height: 1.4; margin-top: 2px; font-family: var(--sans); align-items: center; gap: 6px; }
.error-msg::before { content: "!"; display: inline-grid; place-items: center; width: 14px; height: 14px; background: var(--rechazado); color: var(--papel); border-radius: 50%; font-size: 10px; font-weight: 700; font-family: var(--sans); line-height: 1; }
.field.error .error-msg { display: inline-flex; }
.error-msg .code { font-family: var(--mono); color: var(--rechazado); background: var(--rechazado-bg); padding: 1px 5px; border-radius: 3px; font-size: 11px; margin-left: 4px; }

/* ---- checkbox ---- */
.remember { display: grid; grid-template-columns: 18px 1fr; gap: 10px; align-items: center; font-size: 13px; color: var(--tinta); cursor: pointer; user-select: none; margin: 4px 0 8px; }
.remember input { position: absolute; opacity: 0; pointer-events: none; }
.remember .chk { width: 18px; height: 18px; background: var(--papel); border: 1px solid var(--linea-warm); border-radius: 4px; display: grid; place-items: center; transition: all 0.15s ease; }
.remember .chk::after { content: ""; width: 9px; height: 5px; border-left: 1.5px solid var(--tinta); border-bottom: 1.5px solid var(--tinta); transform: rotate(-45deg) translate(1px, -1px); opacity: 0; transition: opacity 0.15s ease; }
.remember:hover .chk { border-color: #C8C2AE; }
.remember input:checked + .chk { background: var(--lima); border-color: var(--lima); }
.remember input:checked + .chk::after { opacity: 1; }
.remember input:focus-visible + .chk { box-shadow: 0 0 0 4px var(--cielo-glow); }

/* ---- submit button ---- */
.submit-btn { width: 100%; height: 50px; background: var(--cielo); color: var(--papel); border: none; border-radius: 7px; font-family: var(--sans); font-size: 15px; font-weight: 500; letter-spacing: -0.005em; display: inline-flex; align-items: center; justify-content: center; gap: 10px; transition: background 0.15s ease, transform 0.05s ease; margin-top: 4px; }
.submit-btn:hover { background: var(--cielo-hover); }
.submit-btn:active { transform: translateY(1px); }
.submit-btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--cielo-glow); }
.submit-btn .arr { font-family: var(--mono); transition: transform 0.15s ease; }
.submit-btn:hover .arr { transform: translateX(2px); }
.submit-btn[aria-busy="true"] { color: var(--niebla); background: var(--cielo-hover); cursor: progress; }
.submit-btn[aria-busy="true"] .arr { animation: spin 0.8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- divider + foot ---- */
.card-foot { margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--linea-warm); display: flex; justify-content: space-between; align-items: center; font-family: var(--mono); font-size: 10.5px; color: var(--carbon); letter-spacing: 0.04em; gap: 12px; flex-wrap: wrap; }
.card-foot .copy { letter-spacing: 0.04em; }
.card-foot .links { display: flex; gap: 14px; }
.card-foot .links a { color: var(--carbon); transition: color 0.15s ease; text-transform: uppercase; }
.card-foot .links a:hover { color: var(--tinta); }

/* ---- responsive ---- */
@media (max-width: 900px) { .login-page { grid-template-columns: 1fr; grid-template-rows: auto 1fr; } .login-left { padding: 24px 28px; gap: 20px; min-height: 0; } .login-left::after { bottom: auto; top: -160px; right: -80px; font-size: 360px; } .left-meta { display: none; } .left-main { gap: 16px; padding: 8px 0 12px; } .logo { font-size: 56px; } .tagline { font-size: 15px; max-width: none; } .benefits { display: none; } .left-foot { padding-top: 16px; font-size: 12px; } .login-right { padding: 36px 24px; } .login-card h1 { font-size: 34px; } .login-card .subtitle { margin-bottom: 28px; } }
@media (max-width: 480px) { .login-left { padding: 20px; gap: 14px; } .login-right { padding: 28px 20px; } .card-foot { flex-direction: column; align-items: flex-start; } }
