/* =====================================================================
   GransoftWeb — Login único
   Base compartilhada: grade de duas colunas + coluna do formulário (direita).
   Usado por:
     - /login (Login.aspx)                       -> grade completa (banner + formulário)
     - /app/Autenticacao.aspx                    -> body.gl-standalone (só formulário)
     - /PainelProducao/Autenticacao.aspx         -> body.gl-standalone (só formulário)
   O estilo da coluna da ESQUERDA fica em assets/css/login/banner-{chave}.css,
   carregado conforme o banner do dia.
   ===================================================================== */

:root {
    --gl-navy: #16233F;
    --gl-navy-hover: #0F1A31;
    --gl-navy-deep: #0B1427;
    --gl-panel: #19233F;
    --gl-accent: #2FBF9B;
    --gl-teal: #3ABCAF;
    --gl-text: #16233F;
    --gl-muted: #4A5670;
    --gl-faint: #5A6680;
    --gl-border: #C5CCD8;
    --gl-soft: #F4F6F9;
    --gl-danger-bg: #FDECEC;
    --gl-danger: #B42318;
    --gl-ok-bg: #E7F7F2;
    --gl-ok: #146C55;
    --gl-radius: 10px;
    --gl-ease: cubic-bezier(.32,.72,0,1);
    --gl-font: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

html, body { margin: 0; min-height: 100%; }

body.gl-body {
    font-family: var(--gl-font);
    background: #FFFFFF;
    color: var(--gl-text);
    -webkit-font-smoothing: antialiased;
}

body.gl-body *, body.gl-body *::before, body.gl-body *::after { box-sizing: border-box; }

/* ---------- Grade ---------- */
.gl-grid {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    background: #FFFFFF;
}

/* Nenhum banner ativo: só o formulário */
.gl-grid.gl-solo { grid-template-columns: 1fr; }
.gl-grid.gl-solo .gl-mobile-logo { display: block; }

/* Coluna do banner: só a "moldura". Cor, fundo e conteúdo vêm do banner-{chave}.css */
.gl-banner {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    min-height: 100vh;
    min-height: 100dvh;
    color: #FFFFFF;
    background-color: var(--gl-panel);
}

/* ---------- Coluna do formulário ---------- */
.gl-form-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 56px 64px;
    background: #FFFFFF;
}

.gl-form-wrap {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Logo colorido: aparece só quando o banner está oculto (celular) e nas telas standalone */
.gl-mobile-logo { display: none; }
.gl-mobile-logo img { width: 180px; height: auto; display: block; }

.gl-head { display: flex; flex-direction: column; gap: 8px; }
.gl-head h1, .gl-head h2 { margin: 0; font-size: 30px; line-height: 1.2; font-weight: 700; color: var(--gl-text); }
.gl-head p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--gl-muted); }

.gl-eyebrow {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--gl-soft);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--gl-navy);
}
.gl-eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--gl-accent); }

.gl-form { display: flex; flex-direction: column; gap: 20px; margin: 0; }
.gl-field { display: flex; flex-direction: column; gap: 8px; }
.gl-field > label { font-size: 14px; font-weight: 500; color: var(--gl-text); }

.gl-input {
    width: 100%;
    height: 50px;
    padding: 0 16px;
    border-radius: var(--gl-radius);
    border: 1px solid var(--gl-border);
    background: #FFFFFF;
    color: var(--gl-text);
    font-family: var(--gl-font);
    font-size: 15px;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.gl-input::placeholder { color: #8E98A6; }
.gl-input:focus { outline: none; border-color: var(--gl-navy); box-shadow: 0 0 0 3px rgba(47,191,155,.45); }
.gl-input[aria-invalid="true"] { border-color: var(--gl-danger); }

.gl-pass { position: relative; }
.gl-pass .gl-input { padding-right: 52px; }
.gl-pass-toggle {
    position: absolute; right: 3px; top: 3px;
    width: 44px; height: 44px;
    border: 0; background: transparent; border-radius: 8px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    color: var(--gl-muted);
}
.gl-pass-toggle:hover { background: var(--gl-soft); }
.gl-pass-toggle:focus-visible { outline: 2px solid var(--gl-accent); outline-offset: 1px; }
.gl-pass-toggle .gl-ico-hide { display: none; }
.gl-pass-toggle[aria-pressed="true"] .gl-ico-show { display: none; }
.gl-pass-toggle[aria-pressed="true"] .gl-ico-hide { display: block; }

.gl-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.gl-check { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; color: var(--gl-text); cursor: pointer; }
.gl-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--gl-navy); }

.gl-link { color: var(--gl-navy); font-size: 14px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.gl-link:hover { color: var(--gl-navy-deep); }

.gl-btn {
    height: 52px;
    width: 100%;
    border: 0;
    border-radius: var(--gl-radius);
    background: var(--gl-navy);
    color: #FFFFFF;
    font-family: var(--gl-font);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    transition: background .2s ease, transform .2s var(--gl-ease);
}
.gl-btn:hover { background: var(--gl-navy-hover); }
.gl-btn:active { transform: scale(.99); }
.gl-btn:focus-visible { outline: 3px solid rgba(47,191,155,.6); outline-offset: 2px; }
.gl-btn[disabled] { opacity: .75; cursor: progress; }
.gl-btn svg { flex: none; }

.gl-spin {
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,.35);
    border-top-color: #FFFFFF;
    border-radius: 50%;
    animation: glSpin .7s linear infinite;
}
.gl-btn[aria-busy="true"] .gl-btn-ico { display: none; }
@keyframes glSpin { to { transform: rotate(360deg); } }

.gl-alert { margin: 0; padding: 12px 14px; border-radius: var(--gl-radius); font-size: 14px; line-height: 1.5; }
.gl-alert-erro { background: var(--gl-danger-bg); color: var(--gl-danger); }
.gl-alert-ok { background: var(--gl-ok-bg); color: var(--gl-ok); }
.gl-alert-aviso { background: #FFF6E5; color: #8A5A00; }

.gl-help {
    display: flex; align-items: center; gap: 12px;
    padding: 16px; border-radius: 12px;
    background: var(--gl-soft);
}
.gl-help svg { flex: none; }
.gl-help p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--gl-muted); }
.gl-help a { color: var(--gl-navy); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

.gl-foot { margin: 0; font-size: 12px; letter-spacing: .02em; color: var(--gl-faint); }
.gl-foot a { color: var(--gl-faint); }
.gl-foot a:hover { color: var(--gl-navy); }

[hidden] { display: none !important; }

/* ---------- Formulário de cadastro (modo criarconta) ---------- */
.gl-form-tight { gap: 16px; }
.gl-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: end; }
.gl-opt { font-weight: 400; color: var(--gl-faint); }

/* Honeypot anti-robô: fora da tela, sem foco e invisível para leitores de tela */
.gl-hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

.gl-legal { margin: 0; font-size: 12px; line-height: 1.6; color: var(--gl-faint); }
.gl-legal a { color: var(--gl-faint); text-decoration: underline; text-underline-offset: 2px; }
.gl-legal a:hover { color: var(--gl-navy); }

.gl-switch { margin: -8px 0 0; font-size: 14px; color: var(--gl-muted); }
.gl-switch a { color: var(--gl-navy); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* O aviso do reCAPTCHA já está no texto do formulário (permitido pelo Google) */
.grecaptcha-badge { visibility: hidden !important; }

/* ---------- Animação de entrada (disponível para os banners) ---------- */
@keyframes glRise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.gl-rise { animation: glRise .9s var(--gl-ease) both; }
.gl-d1 { animation-delay: .08s; } .gl-d2 { animation-delay: .16s; } .gl-d3 { animation-delay: .24s; }
.gl-d4 { animation-delay: .36s; } .gl-d5 { animation-delay: .46s; }

@media (prefers-reduced-motion: reduce) {
    .gl-rise, .gl-banner * { animation: none !important; transition: none !important; }
}

/* ---------- Telas standalone (App / Painel instalados): só o formulário ---------- */
body.gl-standalone { background: var(--gl-soft); }
body.gl-standalone .gl-form-col {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 40px 20px;
    background: var(--gl-soft);
}
body.gl-standalone .gl-form-wrap {
    background: #FFFFFF;
    padding: 40px 36px 32px;
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(22,35,63,.06), 0 12px 32px rgba(22,35,63,.08);
    gap: 28px;
}
body.gl-standalone .gl-mobile-logo { display: block; }

/* ---------- Tablet ---------- */
@media (max-width: 1100px) {
    .gl-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .gl-form-col { padding: 48px 40px; }
}

/* ---------- Smartphone: só o login, sem banner ---------- */
@media (max-width: 767.98px) {
    .gl-grid { grid-template-columns: 1fr; }
    /* !important: o banner-{chave}.css é carregado depois e define o display do próprio banner */
    .gl-grid > .gl-banner { display: none !important; }
    .gl-mobile-logo { display: block; }
    .gl-form-col { justify-content: flex-start; padding: 40px 20px 32px; }
    .gl-form-wrap { gap: 28px; }
    .gl-head h1, .gl-head h2 { font-size: 26px; }
    .gl-cols { grid-template-columns: 1fr; }

    body.gl-standalone .gl-form-col { justify-content: center; padding: 24px 16px; }
    body.gl-standalone .gl-form-wrap { padding: 32px 22px 26px; }
}
