/* ============================================================
   Login — Tela de autenticação do Caixa NFC-e
   gerpay-caixa-nfce
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --login-ink:        #102a43;
    --login-ink-soft:   #526b84;
    --login-muted:      #7890a8;
    --login-blue:       #2563eb;
    --login-navy:       #0e2a4b;
    --login-bg:         #edf4fb;
    --login-border:     #dbe6f2;
    --login-input:      #f8fbff;
    --login-danger:     #c2413a;
    --login-danger-bg:  #fff3f1;
}

body.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at 9% 14%, rgba(96, 165, 250, .20), transparent 28%),
        radial-gradient(circle at 93% 87%, rgba(37, 99, 235, .14), transparent 30%),
        var(--login-bg);
    color: var(--login-ink);
    font-family: "Segoe UI", Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ---- Layout ---- */
.login-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1080px;
    min-height: 600px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(420px, .92fr);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .78);
    border-radius: 28px;
    background: #fff;
    box-shadow: 0 30px 80px rgba(24, 61, 97, .16), 0 5px 18px rgba(24, 61, 97, .06);
}

/* ---- Brand panel ---- */
.login-brand-panel {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    min-width: 0;
    padding: 48px 54px 38px;
    color: #fff;
    background: linear-gradient(145deg, #0c2748 0%, #123b68 54%, #1d5ca4 100%);
}

.login-brand-panel::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    opacity: .45;
    background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
    background-size: 38px 38px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,.8), transparent 85%);
}

.brand-orb {
    position: absolute;
    z-index: -1;
    display: block;
    border-radius: 50%;
    pointer-events: none;
}

.brand-orb-one {
    width: 370px;
    height: 370px;
    right: -150px;
    top: -108px;
    background: radial-gradient(circle at 32% 65%, rgba(96, 165, 250, .42), rgba(96, 165, 250, 0) 68%);
}

.brand-orb-two {
    width: 430px;
    height: 430px;
    left: -260px;
    bottom: -260px;
    background: radial-gradient(circle at 70% 30%, rgba(45, 212, 191, .18), rgba(45, 212, 191, 0) 68%);
}

.brand-content,
.brand-footer {
    position: relative;
    z-index: 1;
}

.brand-mark,
.login-logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    border-radius: 17px;
}

.brand-mark {
    margin-bottom: 34px;
    color: #d9ecff;
    background: rgba(255, 255, 255, .13);
    border: 1px solid rgba(255, 255, 255, .22);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 12px 28px rgba(0,0,0,.12);
}

.brand-mark i { font-size: 1.55rem; }

.brand-kicker,
.login-kicker {
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.brand-kicker {
    margin-bottom: 18px;
    color: #a8d3ff;
}

.brand-content h1 {
    max-width: 410px;
    font-size: clamp(2.8rem, 4.8vw, 4.2rem);
    line-height: .98;
    letter-spacing: -.065em;
    font-weight: 750;
}

.brand-content h1 strong {
    color: #8cc5ff;
    font-weight: 750;
}

.brand-description {
    max-width: 370px;
    margin-top: 25px;
    color: rgba(239, 247, 255, .76);
    font-size: 1rem;
    line-height: 1.7;
}

.brand-features {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 32px;
}

.brand-features span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    color: rgba(255,255,255,.84);
    background: rgba(255,255,255,.09);
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 650;
}

.brand-features i { color: #92d6ff; font-size: .75rem; }

.brand-footer {
    display: flex;
    align-items: center;
    gap: 9px;
    color: rgba(232, 244, 255, .62);
    font-size: .75rem;
    letter-spacing: .01em;
}

.brand-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #5eead4;
    box-shadow: 0 0 0 4px rgba(94, 234, 212, .12);
}

/* ---- Login card ---- */
.login-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 56px 58px;
    background: #fff;
}

.login-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 42px;
}

.login-kicker { color: var(--login-blue); }

.login-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    color: #16806b;
    background: #ecfdf8;
    border: 1px solid #c9f3e6;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 750;
}

.login-status i { font-size: .67rem; }

.login-logo {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 17px;
}

.login-logo-mark {
    flex: 0 0 auto;
    color: var(--login-blue);
    background: #edf5ff;
    border: 1px solid #d8e8ff;
    box-shadow: 0 8px 18px rgba(37, 99, 235, .10);
}

.login-logo-mark i { font-size: 1.35rem; }

.login-logo h2 {
    color: var(--login-ink);
    font-size: 1.65rem;
    line-height: 1.1;
    letter-spacing: -.035em;
    font-weight: 750;
}

.login-logo p {
    margin-top: 5px;
    color: var(--login-muted);
    font-size: .84rem;
    font-weight: 600;
}

.login-helper {
    margin-bottom: 32px;
    color: var(--login-ink-soft);
    font-size: .9rem;
    line-height: 1.55;
}

/* ---- Alertas ---- */
.login-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
    padding: 12px 14px;
    color: var(--login-danger);
    background: var(--login-danger-bg);
    border: 1px solid #ffd8d3;
    border-radius: 12px;
    font-size: .84rem;
    line-height: 1.45;
}

.login-alert i { flex-shrink: 0; margin-top: 2px; }

/* ---- Formulário ---- */
.form-group { margin-bottom: 18px; }

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--login-ink);
    font-size: .79rem;
    font-weight: 750;
    letter-spacing: .01em;
}

.input-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon > i:first-child {
    position: absolute;
    left: 16px;
    z-index: 1;
    color: #8aa2ba;
    font-size: .9rem;
    pointer-events: none;
}

.input-icon input {
    width: 100%;
    height: 54px;
    padding: 0 45px 0 45px;
    color: var(--login-ink);
    background: var(--login-input);
    border: 1px solid var(--login-border);
    border-radius: 13px;
    outline: none;
    font: inherit;
    font-size: .92rem;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.input-icon input::placeholder { color: #9aaec1; }
.input-icon input:hover { border-color: #c3d5e8; }

.input-icon input:focus {
    background: #fff;
    border-color: var(--login-blue);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}

.toggle-senha {
    position: absolute;
    right: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    color: #8aa2ba;
    background: transparent;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font-size: .88rem;
    transition: color .2s ease, background .2s ease;
}

.toggle-senha:hover,
.toggle-senha:focus-visible {
    color: var(--login-blue);
    background: #eaf3ff;
    outline: none;
}

.login-form-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 5px 0 20px;
    color: var(--login-muted);
    font-size: .75rem;
}

.login-form-meta i { color: #38a98c; font-size: .78rem; }

/* ---- Botão ---- */
.btn-login {
    width: 100%;
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 0 18px;
    color: #fff;
    background: linear-gradient(135deg, var(--login-blue), #4f46e5);
    border: 0;
    border-radius: 13px;
    box-shadow: 0 12px 22px rgba(37, 99, 235, .22);
    cursor: pointer;
    font: inherit;
    font-size: .91rem;
    font-weight: 750;
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.btn-login:hover:not(:disabled) {
    filter: brightness(1.04);
    transform: translateY(-2px);
    box-shadow: 0 16px 28px rgba(37, 99, 235, .28);
}

.btn-login:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 8px 16px rgba(37, 99, 235, .2);
}

.btn-login:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .22);
    outline-offset: 3px;
}

.btn-login:disabled { opacity: .7; cursor: not-allowed; }

.btn-text,
.btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Mantidos para compatibilidade com eventuais estados alternativos do login. */
.btn-google,
.login-divider { display: none; }

@media (max-width: 820px) {
    body.login-body { padding: 20px; }

    .login-shell {
        grid-template-columns: 1fr;
        max-width: 520px;
        min-height: 0;
    }

    .login-brand-panel { min-height: 290px; padding: 34px 32px 27px; }
    .brand-mark { margin-bottom: 22px; }
    .brand-content h1 { font-size: 2.75rem; }
    .brand-description { max-width: 470px; margin-top: 16px; }
    .brand-features { margin-top: 20px; }
    .brand-footer { margin-top: 30px; }
    .login-card { padding: 38px 32px 42px; }
    .login-card-top { margin-bottom: 32px; }
}

@media (max-width: 480px) {
    body.login-body { align-items: flex-start; padding: 12px; }
    .login-shell { border-radius: 21px; }
    .login-brand-panel { min-height: 258px; padding: 28px 24px 23px; }
    .brand-mark { width: 48px; height: 48px; margin-bottom: 17px; border-radius: 14px; }
    .brand-mark i { font-size: 1.25rem; }
    .brand-kicker { margin-bottom: 12px; font-size: .65rem; }
    .brand-content h1 { font-size: 2.35rem; }
    .brand-description { margin-top: 13px; font-size: .86rem; line-height: 1.5; }
    .brand-features { display: none; }
    .brand-footer { margin-top: 26px; font-size: .68rem; }
    .login-card { padding: 30px 22px 32px; }
    .login-card-top { margin-bottom: 28px; }
    .login-status { padding: 6px 8px; font-size: .65rem; }
    .login-logo h2 { font-size: 1.45rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
