/* Shared access surface: initial login and in-place session recovery. */
.login-page { min-height: 100svh; display: flex; flex-direction: column; }
.login-layout { min-height: 0; flex: 1; width: 100%; margin: 0; padding: 64px 24px 40px; display: grid; place-items: center; }
.login-card { width: min(100%, 25rem); min-width: 0; }
.login-header { display: flex; justify-content: center; margin-bottom: 40px; }
.login-header .brand { padding: 0; gap: 14px; font-size: 2rem; min-height: 48px; }
.login-header .brand img { width: 48px; height: 48px; }
.login-card .auth-heading { text-align: center; }
.login-card .auth-heading h1 { font-stretch: 100%; font-weight: 650; font-size: 1.75rem; letter-spacing: -.035em; }
.login-card .auth-heading p { max-width: 28ch; margin-inline: auto; font-size: .9375rem; }
.auth-heading h1 { margin: 0 0 .75rem; font-size: 2rem; letter-spacing: -.02em; font-weight: 750; line-height: 1.15; text-wrap: balance; }
.auth-heading p { color: var(--muted); margin: 0; line-height: 1.6; font-size: .875rem; }
.auth-form { margin-top: 2rem; min-width: 0; }
.auth-form .field { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1rem; min-width: 0; }
.auth-form label { font-size: .875rem; font-weight: 600; }
.auth-form input { min-height: 50px; height: auto; padding: .875rem; width: 100%; min-width: 0; font-size: 1rem; line-height: 1.25; caret-color: var(--primary); scroll-margin-block: 2rem; }
.auth-form input[aria-invalid="true"] { border-color: var(--danger); }
.auth-form input[readonly] { color: var(--muted); }
.password-field { display: flex; align-items: stretch; flex-wrap: wrap; gap: 4px; min-width: 0; }
.password-field input { flex: 1 1 9rem; width: 0; max-width: 100%; }
.password-toggle { flex: 0 0 auto; min-width: 4.75rem; min-height: 44px; padding: .5rem; font-size: .8125rem; color: var(--muted); border-radius: .5rem; }
.password-toggle:active { background: var(--raised); }
.auth-field-error, .auth-caps { margin: 0; font-size: .8125rem; line-height: 1.5; overflow-wrap: anywhere; }
.auth-field-error { color: var(--danger); min-height: 1.25rem; }
.auth-password-feedback { min-height: 1.25rem; }
.auth-password-feedback .auth-field-error:empty { display: none; }
.auth-caps { color: var(--muted); }
.auth-error { color: var(--danger); font-size: .875rem; line-height: 1.5; margin: 0 0 1rem; padding: .875rem; background: var(--raised); border-radius: .5rem; overflow-wrap: anywhere; scroll-margin-block: 1rem; }
.auth-form [hidden] { display: none; }
.auth-submit { width: 100%; min-height: 50px; display: flex; justify-content: center; white-space: normal; text-align: center; font-size: .9375rem; transform: none !important; transition: none !important; }
.auth-submit:disabled { opacity: 1; background: var(--primary); color: var(--background); cursor: wait; }
.auth-help { color: var(--muted); text-align: center; font-size: .8125rem; line-height: 1.6; margin: 1.5rem 0 0; }
.login-footer { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 24px 20px max(24px, env(safe-area-inset-bottom)); color: var(--muted); font-size: .8125rem; }
.login-footer svg { flex-shrink: 0; }
/* The initial access form reads as one column, with an integrated password control. */
.login-card .auth-form { margin-top: 32px; }
.login-card .auth-form input { min-height: 54px; background: var(--surface); border-color: var(--border); border-radius: 10px; }
.login-card .password-field { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); gap: 0; }
.login-card .password-field input { border: 0; background: transparent; min-height: 52px; }
.login-card .password-field:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }
.login-card .password-field input:focus-visible { outline: none; }
.login-card .password-field:has([aria-invalid="true"]) { border-color: var(--danger); }
.login-card .password-toggle { min-width: 4.75rem; padding-inline: 12px; }
.login-card .auth-submit { min-height: 54px; border-radius: 10px; font-weight: 650; }
.login-card .auth-help { max-width: 33ch; margin-inline: auto; }
dialog.auth-recovery { width: min(28rem, calc(100% - 2rem)); max-height: calc(100svh - 2rem); padding: 2rem; border-top: 2px solid var(--primary); overflow: auto; }
.auth-recovery::backdrop { background: var(--background); }
.session-exit { font-size: .8125rem; min-height: 44px; padding: .5rem .75rem; border: 1px solid var(--border); border-radius: .5rem; }
.session-exit:active { background: var(--border); }
@media (hover: hover) and (pointer: fine) {
  .password-toggle:hover, .session-exit:hover { color: var(--text); background: var(--raised); }
}
@media (max-width: 480px) {
  .login-layout { padding: 40px 24px 24px; align-items: start; }
  .login-header { margin-bottom: 32px; }
  .login-header .brand { font-size: 1.875rem; }
  .login-card .auth-heading h1 { font-size: 1.625rem; }
  dialog.auth-recovery { padding: 24px 20px; }
}
@media (max-height: 620px) {
  .login-layout { padding-block: 24px; }
  .login-header { margin-bottom: 24px; }
}
@media (prefers-reduced-motion: no-preference) {
  .login-header { animation: login-arrive 180ms cubic-bezier(.23, 1, .32, 1); }
}
@keyframes login-arrive { from { opacity: .6; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .login-page *, .auth-recovery * { animation: none !important; transition: none !important; }
}

.login-page > .skip-link:not(:focus) { clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; padding: 0; }
#login-form { min-height: 26rem; }
.auth-error:focus-visible { outline: 2px solid var(--danger); outline-offset: 3px; }
/* Mesa · entrada e fontes */
html:not(#_) body.login-page { --background: #111315; --surface: #191c1f; --raised: #22262a; --border: #343a40; --text: #eef0f2; --muted: #a9afb7; --primary: #ff803e; --ink: #201309; --display: "Sora", system-ui, sans-serif; font-family: "Onest", system-ui, sans-serif; }
html:not(#_) body.login-page { background: radial-gradient(70% 55% at 15% 0%, rgb(255 128 62 / .16), transparent 70%), var(--background); color: var(--text); }
html:not(#_) body.login-page .login-layout { background: transparent; }
html:not(#_) body.login-page .login-card { background: linear-gradient(180deg, #1d2125, #191c1f); border: 1px solid var(--border); border-radius: 28px; box-shadow: 0 40px 80px -40px #000; }
html:not(#_) body.login-page .login-header .brand { font-family: var(--display); font-weight: 600; letter-spacing: -.03em; color: var(--text); }
html:not(#_) body.login-page .login-footer, html:not(#_) body.login-page .login-card p, html:not(#_) body.login-page small { color: var(--muted); }
html:not(#_) body.login-page button[type="submit"], html:not(#_) body.login-page .btn.primary { background: var(--primary); color: var(--ink); border: 0; border-radius: 999px; font-weight: 650; }
html:not(#_) body.login-page a { color: var(--primary); }
html:not(#_) body.login-page .login-card { width: 100%; max-width: 448px; padding: 36px 32px 28px; }
html:not(#_) body.login-page .login-header { margin-bottom: 28px; }
html:not(#_) body.login-page input { background: var(--raised); border: 1px solid transparent; border-radius: 14px; color: var(--text); }
html:not(#_) body.login-page .password-field { background: var(--raised); border: 1px solid transparent; border-radius: 14px; }
html:not(#_) body.login-page .password-field input { background: transparent; border: 0; box-shadow: none; }
html:not(#_) body.login-page input:focus, html:not(#_) body.login-page .password-field:focus-within { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgb(255 128 62 / .18); }
html:not(#_) body.login-page .password-field input:focus { box-shadow: none; }
html:not(#_) body.login-page input:-webkit-autofill, html:not(#_) body.login-page input:-webkit-autofill:hover, html:not(#_) body.login-page input:-webkit-autofill:focus { -webkit-text-fill-color: var(--text); caret-color: var(--text); box-shadow: 0 0 0 1000px var(--raised) inset; }
html:not(#_) body.login-page .password-toggle { margin-right: 6px; }
html:not(#_) body.login-page .auth-submit { min-height: 52px; }
@media screen and (max-width: 480px) {
  html:not(#_) body.login-page .login-card { padding: 28px 20px 22px; }
}

/* ═════════ Entrada no padrão Kairo (mesma linguagem da apresentação e do painel) ═════════
   Só a página /login usa body.kl-page; a recuperação de sessão da versão anterior continua com as regras acima. */
@font-face { font-family: "Archivo"; src: url(/assets/Archivo-Variable.ttf) format("truetype"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: "Onest"; src: url(/assets/Onest.ttf) format("truetype"); font-weight: 100 900; font-display: swap; }
.kl-page { --fg: 255 255 255; --bg: #060505; --card: #0e0d0c; --card2: #141210; --raise: #1a1816; --text: #f5f5f7; --muted: #a19b95; --dim: #8c867f; --line: rgb(var(--fg) / .07); --line2: rgb(var(--fg) / .13); --accent: #ff803e; --accent-hi: #ff9a5e; --accent2: #ffb37a; --ink: #17120f; --rose: #ff6f93; --ease: cubic-bezier(.2, .7, .1, 1); --display: "Archivo", system-ui, sans-serif; --font: "Onest", system-ui, sans-serif;
  margin: 0; min-height: 100svh; display: flex; flex-direction: column; background: var(--bg); color: var(--text); font: 400 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; color-scheme: dark; position: relative; overflow-x: hidden; }
.kl-page *, .kl-page *::before, .kl-page *::after { box-sizing: border-box; }
.kl-page svg { display: block; }
.kl-page a { color: inherit; text-decoration: none; }
.kl-page :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 10px; }
.kl-skip { position: fixed; left: 12px; top: -60px; z-index: 10; background: #fff; color: #000 !important; padding: 10px 14px; border-radius: 10px; font-weight: 600; }
.kl-skip:focus { top: 12px; }
.kl-page .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.kl-ground { position: absolute; inset: 0 0 auto 0; height: 760px; pointer-events: none; overflow: hidden; z-index: 0; }
.kl-grid { position: absolute; inset: 0; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 72px 72px; -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 10%, #000 15%, transparent 75%); mask-image: radial-gradient(ellipse 70% 70% at 50% 10%, #000 15%, transparent 75%); }
.kl-orb { position: absolute; width: 1000px; height: 700px; left: 50%; top: -420px; transform: translateX(-60%); border-radius: 50%; background: radial-gradient(closest-side, rgb(255 128 62 / .28), rgb(255 128 62 / .08) 55%, transparent); }
.kl-orb2 { width: 700px; height: 560px; left: auto; right: -220px; top: -260px; transform: none; background: radial-gradient(closest-side, rgb(157 140 255 / .1), transparent); }
.kl-top { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: max(22px, env(safe-area-inset-top)) clamp(20px, 4vw, 48px) 0; }
.kl-brand { display: flex; align-items: center; gap: 10px; font: 700 19px var(--display); letter-spacing: -.03em; }
.kl-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); display: grid; place-items: center; box-shadow: inset 0 1px 0 rgb(255 255 255 / .3), 0 8px 24px -10px var(--accent); }
.kl-mark svg { width: 62%; height: 62%; }
.kl-back { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line2); color: var(--muted); font-size: 14px; font-weight: 600; transition: color .2s, background .2s; }
.kl-back svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.kl-back:hover { color: var(--text); background: rgb(var(--fg) / .05); }
.kl-main { position: relative; z-index: 1; flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: clamp(32px, 6vh, 72px) clamp(20px, 4vw, 48px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: clamp(32px, 6vw, 96px); align-items: center; }
.kl-eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 600 11.5px/1 var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 8px 12px; border: 1px solid var(--line2); border-radius: 999px; background: rgb(var(--fg) / .02); }
.kl-eyebrow i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.kl-pitch h2 { font: 700 clamp(48px, 5vw, 84px)/.92 var(--display); letter-spacing: -.055em; margin: 22px 0 18px; }
.kl-pitch h2 span { color: var(--accent); }
.kl-pitch > p { color: var(--muted); font-size: 18px; max-width: 30ch; margin: 0 0 26px; }
.kl-pitch ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.kl-pitch li { display: flex; align-items: center; gap: 12px; color: var(--text-soft, #d8d3cf); font-size: 15px; }
.kl-pitch li svg { width: 22px; height: 22px; padding: 4px; border-radius: 8px; background: rgb(255 128 62 / .14); fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.kl-card { position: relative; padding: 34px 32px 28px; border-radius: 28px; border: 1px solid var(--line2); background: radial-gradient(520px circle at 50% -30%, rgb(255 128 62 / .12), transparent 55%), linear-gradient(180deg, var(--card2), var(--card)); box-shadow: inset 0 1px 0 rgb(var(--fg) / .05), 0 40px 90px -40px #000; }
.kl-card #login-form { min-height: 0; outline: none; }
.kl-page .auth-heading { text-align: left; }
.kl-page .auth-heading h1 { font: 700 34px/1 var(--display); letter-spacing: -.045em; margin: 0 0 10px; }
.kl-page .auth-heading p { color: var(--muted); margin: 0; font-size: 15px; line-height: 1.5; max-width: none; }
.kl-page .auth-form { margin-top: 26px; }
.kl-page .auth-form .field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.kl-page .auth-form label { font-size: 13px; font-weight: 600; color: var(--muted); }
.kl-page .auth-form input { width: 100%; min-height: 52px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--line2); background: rgb(var(--fg) / .03); color: var(--text); font: inherit; font-size: 16px; caret-color: var(--accent); outline: none; transition: border-color .2s, box-shadow .2s, background .2s; }
.kl-page .auth-form input:focus { border-color: rgb(255 128 62 / .6); box-shadow: 0 0 0 4px rgb(255 128 62 / .12); background: rgb(var(--fg) / .05); }
.kl-page .auth-form input[aria-invalid="true"] { border-color: rgb(255 111 147 / .7); }
.kl-page .auth-form input:-webkit-autofill, .kl-page .auth-form input:-webkit-autofill:focus { -webkit-text-fill-color: var(--text); -webkit-box-shadow: 0 0 0 40px var(--raise) inset; caret-color: var(--accent); }
.kl-page .password-field { display: flex; align-items: center; gap: 0; border: 1px solid var(--line2); border-radius: 14px; background: rgb(var(--fg) / .03); transition: border-color .2s, box-shadow .2s; }
.kl-page .password-field:focus-within { border-color: rgb(255 128 62 / .6); box-shadow: 0 0 0 4px rgb(255 128 62 / .12); }
.kl-page .password-field:has([aria-invalid="true"]) { border-color: rgb(255 111 147 / .7); }
.kl-page .password-field input, .kl-page .password-field input:focus { border: 0; box-shadow: none; background: transparent; flex: 1; width: 0; }
.kl-page .password-toggle { flex: none; margin-right: 6px; height: 40px; padding: 0 14px; border: 0; border-radius: 10px; background: none; color: var(--muted); font: 600 13px var(--font); cursor: pointer; }
.kl-page .password-toggle:hover { color: var(--text); background: rgb(var(--fg) / .06); }
.kl-page .auth-field-error, .kl-page .auth-caps { margin: 0; font-size: 13px; line-height: 1.5; }
.kl-page .auth-field-error { color: var(--rose); min-height: 0; }
.kl-page .auth-field-error:empty { display: none; }
.kl-page .auth-caps { color: var(--accent2); }
.kl-page .auth-error { color: var(--rose-soft, #ffc2d1); background: rgb(255 111 147 / .08); border: 1px solid rgb(255 111 147 / .3); border-radius: 14px; padding: 12px 14px; margin: 0 0 14px; font-size: 14px; }
.kl-page .auth-form [hidden] { display: none; }
.kl-page .auth-submit { width: 100%; height: 54px; margin-top: 8px; border: 0; border-radius: 999px; display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; font: 700 15.5px var(--font); color: var(--ink); background: linear-gradient(180deg, var(--accent-hi), var(--accent)); box-shadow: inset 0 1px 0 rgb(255 255 255 / .35), 0 14px 34px -12px var(--accent); transition: transform .25s var(--ease), box-shadow .25s; }
.kl-page .auth-submit::after { content: "→"; font-size: 17px; transition: transform .25s var(--ease); }
@media (hover: hover) { .kl-page .auth-submit:hover { transform: translateY(-2px); box-shadow: inset 0 1px 0 rgb(255 255 255 / .35), 0 20px 44px -12px var(--accent); } .kl-page .auth-submit:hover::after { transform: translateX(3px); } }
.kl-page .auth-submit:disabled { cursor: wait; opacity: .8; transform: none; }
.kl-page .auth-help { color: var(--dim); text-align: left; font-size: 13px; line-height: 1.6; margin: 18px 0 0; max-width: none; }
.kl-foot { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 20px 20px max(22px, env(safe-area-inset-bottom)); color: var(--dim); font-size: 13px; }
.kl-foot svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
@keyframes kl-in { from { opacity: 0; transform: translateY(14px); } }
@media (prefers-reduced-motion: no-preference) { .kl-pitch { animation: kl-in .6s var(--ease) both; } .kl-card { animation: kl-in .6s .08s var(--ease) both; } }
@media (max-width: 900px) {
  .kl-main { grid-template-columns: minmax(0, 1fr); max-width: 520px; padding-top: 28px; gap: 24px; align-content: start; }
  .kl-pitch ul { display: none; }
  .kl-pitch h2 { font-size: clamp(40px, 11vw, 56px); margin: 16px 0 10px; }
  .kl-pitch > p { font-size: 16px; margin: 0; }
}
@media (max-width: 480px) {
  .kl-back { height: 36px; padding: 0 12px; font-size: 13px; }
  .kl-card { padding: 26px 20px 22px; border-radius: 24px; }
  .kl-page .auth-heading h1 { font-size: 28px; }
}
.kl-page { --primary: var(--accent); --background: var(--bg); --danger: var(--rose); --raised: var(--raise); --surface: var(--card2); --border: var(--line2); }
.kl-page .auth-submit { transition: transform .25s var(--ease), box-shadow .25s !important; }
@media (hover: hover) { .kl-page .auth-submit:hover:not(:disabled) { transform: translateY(-2px) !important; } }

/* Modo claro (o mesmo escolhido no painel, guardado neste navegador). */
html[data-theme="light"] .kl-page { --fg: 52 36 24; --bg: #f6f3ef; --card: #ffffff; --card2: #fcfaf7; --raise: #f0ebe5; --text: #1c1511; --muted: #5f564e; --dim: #7a7066;
  --line: rgb(52 36 24 / .1); --line2: rgb(52 36 24 / .17); --accent: #f26a24; --accent-hi: #ff8340; --accent2: #c2541b; --rose: #d93a66; color-scheme: light; }
html[data-theme="light"] .kl-card { box-shadow: inset 0 1px 0 rgb(255 255 255 / .6), 0 40px 90px -40px rgb(70 45 25 / .3); }
html[data-theme="light"] .kl-page { --text-soft: #3a312b; --rose-soft: #b42550; }
