/* ============================================================================
   SynX Economy — Página de entrada (/entrar), UX-044
   Conceito "01 · Fita de seda verde" da galeria, escolhido pelo dono em
   2026-10-26: o formulário limpo no centro e, nos cantos, dezenas de linhas
   finas verdes ondulando devagar (desenhadas pelo login.js).
   Prefixo `lg-`. A página NÃO carrega o login.css (que segue servindo as
   páginas irmãs): ele tem regras sem prefixo (.form-group, .input-wrapper,
   .btn-submit) que vazariam aqui.
   ============================================================================ */

.lg-page {
    margin: 0;
    background: var(--color-bg-primary, #0A0A0C);
    color: var(--color-text-primary, #FFFFFF);
    font-family: var(--font-family-base, 'Inter', system-ui, sans-serif);
    -webkit-font-smoothing: antialiased;
}

.lg-page [hidden] { display: none !important; }

.lg-shell {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
}

/* a fita: ocupa a tela toda, atrás de tudo */
.lg-ribbon {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.lg-ribbon path { fill: none; stroke-width: 1; }

.lg-mark {
    position: absolute;
    top: 32px;
    left: 40px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--color-text-primary, #FFFFFF);
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -.03em;
    text-decoration: none;
}

.lg-mark:focus-visible { outline: 2px solid var(--color-neon-green, #00FF41); outline-offset: 4px; border-radius: 6px; }

.lg-main {
    position: relative;
    z-index: 1;
    flex: 1;
    width: 100%;
    display: grid;
    place-items: center;
    padding: 104px 20px 40px;
}

.lg-foot {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 24px;
    /* o aviso de cookies publica a própria altura: o rodapé não fica por baixo dele */
    padding: 0 20px calc(28px + var(--synx-cn-height, 0px));
    font-size: 13px;
}

.lg-foot a { color: var(--color-text-tertiary, #939398); text-decoration: none; transition: color .15s ease; }
.lg-foot a:hover { color: var(--color-text-primary, #FFFFFF); }

/* ─── formulário ──────────────────────────────────────────────────────── */
.lg-form { width: 100%; max-width: 400px; }

.lg-h {
    margin: 0 0 10px;
    font-size: 34px;
    line-height: 1.08;
    font-weight: 800;
    letter-spacing: -.035em;
    text-wrap: balance;
}

.lg-sub {
    margin: 0 0 32px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--color-text-secondary, #A0A0A5);
}

.lg-sub b { color: var(--color-text-primary, #FFFFFF); font-weight: 500; }

.lg-field { margin-bottom: 18px; }

.lg-field > label,
.lg-labelrow label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary, #A0A0A5);
}

.lg-field > label strong { color: var(--color-text-primary, #FFFFFF); font-weight: 600; }

.lg-labelrow { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }

.lg-input {
    width: 100%;
    height: 50px;
    padding: 0 16px;
    background: rgba(15, 15, 18, .9);
    border: 1px solid var(--color-field-border, #6B6B70);
    border-radius: 10px;
    color: var(--color-text-primary, #FFFFFF);
    font: inherit;
    font-size: 15px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.lg-input::placeholder { color: var(--color-text-muted, #87878D); }
.lg-input:hover { border-color: var(--color-field-border-hover, #87878D); }
.lg-input:focus { outline: none; border-color: var(--color-neon-green, #00FF41); box-shadow: 0 0 0 4px rgba(0, 255, 65, .12); }
.lg-mono { font-family: var(--font-family-mono, 'JetBrains Mono', monospace); letter-spacing: .08em; }

/* o preenchimento automático do navegador pintava o campo de claro no tema escuro */
.lg-input:-webkit-autofill,
.lg-input:-webkit-autofill:hover,
.lg-input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--color-text-primary, #FFFFFF);
    caret-color: var(--color-text-primary, #FFFFFF);
    -webkit-box-shadow: 0 0 0 1000px #0F0F12 inset;
    transition: background-color 9999s ease 0s;
}

/* erro no próprio campo (o login.js põe `error` no .input-wrapper e a frase no .lg-error) */
.input-wrapper.error .lg-input { border-color: var(--color-error, #FF4757); }
.input-wrapper.error .lg-input:focus { box-shadow: 0 0 0 4px rgba(255, 71, 87, .14); }
.lg-error { margin: 8px 0 0; font-size: 13px; line-height: 1.45; color: var(--color-error, #FF4757); }

.lg-pass { position: relative; }
.lg-pass .lg-input { padding-right: 50px; }

.lg-eye {
    position: absolute;
    right: 7px;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--color-text-tertiary, #939398);
    cursor: pointer;
    transition: color .15s ease, background-color .15s ease;
}

.lg-eye:hover { color: var(--color-text-primary, #FFFFFF); background: #151518; }
.lg-eye:focus-visible { outline: 2px solid var(--color-neon-green, #00FF41); outline-offset: 1px; }

.lg-link { color: var(--color-neon-green, #00FF41); font-size: 13px; text-decoration: none; }
.lg-link:hover { text-decoration: underline; }
.lg-quiet { color: var(--color-text-secondary, #A0A0A5); font-size: 13px; text-decoration: none; }
.lg-quiet:hover { color: var(--color-text-primary, #FFFFFF); }

.lg-keep { margin: 6px 0 4px; align-items: flex-start; }

/* PROD-119: Pedir acesso */
.lg-optional { color: var(--color-text-tertiary, #939398); font-weight: 400; }
.lg-input.lg-textarea { display: block; height: auto; min-height: 96px; padding: 12px 16px; line-height: 1.5; resize: vertical; }
.lg-honey { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.lg-fine { margin: 16px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--color-text-tertiary, #939398); text-align: center; }
.lg-fine .lg-link { font-size: inherit; }
.lg-keep span { line-height: 1.5; }

.lg-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 52px;
    margin-top: 24px;
    border: 0;
    border-radius: 10px;
    background: var(--color-neon-green, #00FF41);
    color: var(--color-onyx, #0F0F12);
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color .15s ease, opacity .15s ease;
}

.lg-btn:hover { background: var(--color-neon-green-dim, #00CC34); }
.lg-btn:focus-visible { outline: 2px solid var(--color-text-primary, #FFFFFF); outline-offset: 3px; }
.lg-btn:disabled { opacity: .55; cursor: not-allowed; }
.lg-btn.loading span { opacity: 0; }
.lg-btn.loading { position: relative; }
.lg-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(15, 15, 18, .25);
    border-top-color: var(--color-onyx, #0F0F12);
    border-radius: 50%;
    animation: lg-spin .7s linear infinite;
}

@keyframes lg-spin { to { transform: rotate(360deg); } }

a.lg-btn { text-decoration: none; }

/* botão secundário (contorno) e a fila de ações das páginas irmãs */
.lg-btn--ghost { background: transparent; color: var(--color-text-primary, #FFFFFF); border: 1px solid var(--color-border, #2A2A2F); }
.lg-btn--ghost:hover { background: #151518; border-color: #3A3A40; }
.lg-actions { display: flex; gap: 10px; margin-top: 24px; }
.lg-actions .lg-btn { margin-top: 0; }

/* carregando: a frase com um aro girando ao lado */
.lg-loading { display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--color-text-secondary, #A0A0A5); }
.lg-loading::before {
    content: '';
    flex: none;
    width: 18px;
    height: 18px;
    border: 2px solid #26262C;
    border-top-color: var(--color-neon-green, #00FF41);
    border-radius: 50%;
    animation: lg-spin .8s linear infinite;
}

/* dados do convite, um embaixo do outro */
.lg-facts { display: grid; gap: 10px; margin: 0 0 4px; }
.lg-facts div { display: flex; justify-content: space-between; gap: 16px; font-size: 14px; }
.lg-facts dt { color: var(--color-text-tertiary, #939398); }
.lg-facts dd { margin: 0; text-align: right; color: var(--color-text-primary, #FFFFFF); font-weight: 500; overflow-wrap: anywhere; }
.lg-facts { margin-bottom: 28px; }

/* frase que explica o próximo passo, logo acima dos botões */
/* o quadrinho de verificação (SEC-022): ocupa a largura do formulário e reserva a altura dele */
.lg-turnstile { min-height: 65px; }
.lg-turnstile iframe { max-width: 100%; }
.lg-captcha .lg-error { margin-top: 8px; }

.lg-sub.lg-note { margin: 0; font-size: 14px; }
.lg-sub.lg-note b { color: var(--color-text-primary, #FFFFFF); font-weight: 600; overflow-wrap: anywhere; }
.lg-note + .lg-actions { margin-top: 16px; }
.lg-actions .lg-btn--ghost { flex: 0 0 auto; width: auto; padding: 0 22px; }

.lg-alt { margin: 22px 0 0; font-size: 14px; color: var(--color-text-secondary, #A0A0A5); }
.lg-alt .lg-link { font-size: 14px; font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; } /* no meio da frase: não só pela cor (WCAG 1.4.1) */

/* força da senha: quatro traços que acendem com a senha */
.lg-strength { display: flex; align-items: center; gap: 5px; margin-top: 10px; }
.lg-strength i { width: 40px; height: 4px; border-radius: 99px; background: #1F1F24; transition: background-color .2s ease; }
.lg-strength span { margin-left: 8px; font-size: 12px; color: var(--color-text-tertiary, #939398); }
.lg-strength[data-strength="weak"] i:nth-child(-n+1) { background: var(--color-error, #FF4757); }
.lg-strength[data-strength="medium"] i:nth-child(-n+2) { background: var(--color-warning, #FFA502); }
.lg-strength[data-strength="strong"] i:nth-child(-n+3),
.lg-strength[data-strength="very-strong"] i { background: var(--color-neon-green, #00FF41); }

/* código de duas etapas: as seis casas do componente, maiores */
.lg-otp { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin: 0; }
.lg-otp .otp-input { width: 100%; height: 62px; font-size: 26px; font-weight: 700; background: rgba(15, 15, 18, .9); border-width: 1px; border-radius: 12px; }

.lg-code-alts { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 16px; margin-top: 20px; }

/* ─── aviso de documentos legais (bloqueante) — na casca dos modais do sistema ─── */
.legal-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(5, 5, 8, .82);
}

.legal-modal__card {
    width: 100%;
    max-width: 460px;
    padding: 28px;
    background: var(--color-bg-primary, #0A0A0C);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 12px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, .55);
}

.legal-modal__card h2 { margin: 0 0 8px; font-size: 18px; font-weight: 600; }
.legal-modal__text { margin: 0 0 18px; font-size: 14px; line-height: 1.6; color: var(--color-text-secondary, #A0A0A5); }
.legal-modal__links { display: grid; gap: 8px; margin-bottom: 18px; }

.legal-modal__links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 15px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, .1);
    color: var(--color-text-primary, #FFFFFF);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: border-color .15s ease;
}

.legal-modal__links a:hover { border-color: var(--color-neon-green, #00FF41); }
.legal-modal__links a i { font-size: 12px; color: var(--color-neon-green, #00FF41); }
.legal-modal__check { margin-bottom: 4px; }
.legal-modal__actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.legal-modal__actions .lg-btn { width: auto; min-width: 170px; height: 46px; padding: 0 22px; }

.legal-modal__logout {
    padding: 10px 4px;
    margin-top: 24px;
    border: 0;
    background: none;
    color: var(--color-text-secondary, #A0A0A5);
    font: inherit;
    font-size: 14px;
    cursor: pointer;
}

.legal-modal__logout:hover { color: var(--color-text-primary, #FFFFFF); }

/* ─── Autorizar aplicativo (/autorizar, OAuth — ADR-176; conceito "12", escolha do dono em 2026-11-16) ─── */
select.lg-input { cursor: pointer; }
select.lg-input:disabled { cursor: not-allowed; opacity: .6; }
.lg-h2 { margin: 24px 0 10px; font-size: 13px; font-weight: 600; color: var(--color-text-tertiary, #939398); }
.lg-field + .lg-h2 { margin-top: 6px; }
.lg-h2 + .lg-facts { margin-bottom: 14px; }
.lg-more { margin: 0 0 20px; font-size: 14px; color: var(--color-text-secondary, #A0A0A5); }
.lg-more summary { cursor: pointer; color: var(--color-neon-green, #00FF41); font-weight: 600; width: max-content; }
.lg-more summary:focus-visible { outline: 2px solid var(--color-text-primary, #FFFFFF); outline-offset: 3px; border-radius: 4px; }
.lg-perms { margin: 12px 0 0; padding: 0 0 0 18px; display: grid; gap: 6px; font-size: 14px; color: var(--color-text-secondary, #A0A0A5); }
.lg-notes:empty { display: none; }
.lg-notes { display: grid; gap: 10px; margin: 0 0 16px; }
.lg-notes .lg-link { font-size: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.lg-terms { margin: 4px 0 0; font-size: 14px; color: var(--color-text-secondary, #A0A0A5); }
.lg-terms .lg-link { font-size: inherit; text-decoration: underline; text-underline-offset: 2px; }
.lg-terms[hidden] { display: none; }

/* ─── celular ─────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
    .lg-mark { top: 22px; left: 16px; }
    .lg-main { place-items: start center; padding: 84px 16px 28px; }
    .lg-h { font-size: 28px; }
    .lg-sub { margin-bottom: 26px; }
    .lg-strength i { width: 26px; }
    .lg-otp { gap: 6px; }
    .lg-otp .otp-input { height: 54px; font-size: 22px; }
    .lg-code-alts { flex-direction: column; }
    .lg-ribbon { opacity: .6; }
    .legal-modal__actions { flex-direction: column-reverse; align-items: stretch; }
    .legal-modal__actions .lg-btn { width: 100%; }
    .legal-modal__logout { margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .lg-btn.loading::after { animation-duration: 1.6s; }
}
