/* Login NFS-e — tela dividida: passo a passo do credenciamento + formulário */

html, body.nf-login { overflow-x: clip; max-width: 100%; }
body.nf-login {
    margin: 0;
    background: var(--nf-surface);
}

.nf-split { position: relative; display: flex; flex-direction: column; }
.nf-split > * { min-width: 0; }

/* ======================= Painel esquerdo ======================= */
.nf-hero {
    position: relative; z-index: 3; overflow: hidden; color: #e9e8f8;
    padding: 32px 18px 28px; display: flex; flex-direction: column; background: var(--nf-bg);
    box-shadow: 0 -14px 36px -8px rgba(11, 16, 50, .35);
}
.nf-hero::before, .nf-hero::after { content: ""; position: absolute; border-radius: 50%; filter: blur(90px); pointer-events: none; }
.nf-hero::before { width: 420px; height: 420px; background: var(--nf-primary); opacity: .55; top: -140px; left: -120px; animation: nf-float 14s ease-in-out infinite; }
.nf-hero::after { width: 360px; height: 360px; background: var(--nf-accent); opacity: .6; bottom: -120px; right: -100px; animation: nf-float 18s ease-in-out infinite reverse; }
@keyframes nf-float { 50% { transform: translate(40px, 30px) scale(1.1); } }

.nf-grid {
    position: absolute; inset: 0; pointer-events: none; opacity: .5;
    background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: radial-gradient(circle at 30% 30%, #000, transparent 75%);
    mask-image: radial-gradient(circle at 30% 30%, #000, transparent 75%);
}
.nf-hero > *:not(.nf-scene):not(.nf-grid) { position: relative; z-index: 2; }

.nf-badge {
    align-self: flex-start; display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 14px; border-radius: 999px; font-size: var(--nf-text-sm); font-weight: var(--nf-weight-label); letter-spacing: .02em;
    background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); backdrop-filter: blur(8px);
}
.nf-badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--nf-highlight); box-shadow: 0 0 10px var(--nf-highlight); }
.nf-hero h2 { font-size: var(--nf-title); line-height: 1.15; font-weight: var(--nf-weight-heading); letter-spacing: -.02em; color: #fff; margin: 18px 0 8px; }
.nf-hero h2 span { background: linear-gradient(90deg, #fff, var(--nf-highlight)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nf-hero .lead { color: #c4c0ee; font-size: var(--nf-text); margin-bottom: 22px; max-width: 460px; }

/* ---------- Passos (item ativo expande a explicação) ---------- */
.nf-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.nf-steps li {
    position: relative; overflow: hidden; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 12px 14px;
    border-radius: 14px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .09);
    backdrop-filter: blur(10px); transition: transform .2s, background .2s, border-color .2s;
}
.nf-steps li::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--nf-highlight); opacity: 0; transition: opacity .25s; }
.nf-steps li:hover { transform: translateX(6px); background: rgba(255, 255, 255, .09); border-color: rgba(167, 157, 255, .55); }
.nf-steps li:focus-visible { outline: 2px solid var(--nf-highlight); outline-offset: 2px; }
.nf-steps li > div { flex: 1; min-width: 0; }
.nf-steps b { display: block; font-size: var(--nf-text-table); font-weight: var(--nf-weight-label); color: #fff; margin-bottom: 2px; }
.nf-steps small {
    display: block; max-height: 0; opacity: 0; overflow: hidden; margin: 0; font-size: var(--nf-text-sm); line-height: 1.35; color: #c4c0ee;
    transition: max-height .35s ease, opacity .3s ease, margin .3s;
}
.nf-n {
    flex: 0 0 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: var(--nf-weight-button); font-size: var(--nf-text-table);
    color: #2b2960; background: var(--nf-surface); box-shadow: 0 6px 18px rgba(0, 0, 0, .25); transition: background .25s, color .25s, transform .25s;
}
.nf-si { flex: 0 0 22px; width: 22px; height: 22px; color: var(--nf-highlight); opacity: .7; transition: transform .3s, opacity .3s; }

.nf-steps li.is-active { background: rgba(255, 255, 255, .13); border-color: rgba(167, 157, 255, .6); transform: translateX(6px); }
.nf-steps li.is-active::after { opacity: 1; }
.nf-steps li.is-active small { max-height: 110px; opacity: 1; margin-top: 4px; }
.nf-steps li.is-active .nf-n { background: var(--nf-highlight); color: #fff; transform: scale(1.08); }
.nf-steps li.is-active .nf-si { opacity: 1; color: #fff; transform: scale(1.15) rotate(-6deg); }

.nf-hero-foot { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.nf-ghost {
    display: inline-flex; align-items: center; gap: 10px; padding: 12px 20px; border-radius: var(--nf-radius); font-weight: var(--nf-weight-label); font-size: var(--nf-text-table);
    color: #fff !important; text-decoration: none !important; background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .3); backdrop-filter: blur(8px); transition: background .2s, transform .2s, border-color .2s;
}
.nf-ghost svg { width: 18px; height: 18px; flex: 0 0 18px; }
.nf-ghost:hover { background: rgba(255, 255, 255, .2); border-color: rgba(255, 255, 255, .55); transform: translateY(-2px); }

/* ======================= Cena 3D de NFS-e (fundo discreto) ======================= */
.nf-scene { position: absolute; inset: 0; z-index: 0; perspective: 1100px; perspective-origin: 60% 40%; pointer-events: none; overflow: hidden; opacity: .3; filter: blur(5px); }
.nf-scene::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(35, 42, 115, .85) 0%, rgba(35, 42, 115, .45) 55%, rgba(35, 42, 115, .15) 100%); }
.nf-doc { position: absolute; width: 140px; transform-style: preserve-3d; }
.nf-doc-in {
    padding: 14px; border-radius: var(--nf-radius); color: #2b2960; font-size: 11px; line-height: 1.2; backface-visibility: hidden;
    background: linear-gradient(160deg, rgba(255, 255, 255, .92), rgba(233, 232, 248, .82));
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255, 255, 255, .5);
}
.dh { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--nf-line); }
.dh b { font-size: 13px; color: var(--nf-accent); letter-spacing: .04em; }
.dh i { font-style: normal; font-size: 9px; color: var(--nf-muted); }
.dl { height: 6px; border-radius: 3px; background: #d9d6f0; margin-bottom: 7px; }
.w40 { width: 40%; } .w50 { width: 50%; } .w60 { width: 60%; } .w70 { width: 70%; } .w80 { width: 80%; } .w90 { width: 90%; }
.dq { float: right; width: 38px; height: 38px; margin: 4px 0 6px 8px; border-radius: 4px; opacity: .85;
    background: conic-gradient(#2b2960 25%, #fff 0 50%, #2b2960 0 75%, #fff 0) 0 0/10px 10px; }
.dv { clear: both; font-weight: var(--nf-weight-button); font-size: 14px; color: var(--nf-bg); margin-top: 6px; }
.dok { margin-top: 6px; display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 9px; font-weight: var(--nf-weight-button); color: var(--nf-accent); background: #e3e0f7; }

.d1 { top: 6%; right: 6%; animation: nf-d1 16s ease-in-out infinite; }
.d2 { top: 38%; right: -2%; animation: nf-d2 20s ease-in-out infinite; }
.d3 { bottom: 8%; right: 22%; animation: nf-d3 18s ease-in-out infinite; }
.d4 { top: 14%; left: 38%; animation: nf-d4 22s ease-in-out infinite; display: none; }
@keyframes nf-d1 { 0%, 100% { transform: translate3d(0, 0, 60px) rotateX(18deg) rotateY(-28deg) rotateZ(6deg); } 50% { transform: translate3d(-20px, 24px, 100px) rotateX(10deg) rotateY(-14deg) rotateZ(-2deg); } }
@keyframes nf-d2 { 0%, 100% { transform: translate3d(0, 0, -40px) rotateX(-12deg) rotateY(30deg) rotateZ(-8deg); } 50% { transform: translate3d(-30px, -26px, 10px) rotateX(-4deg) rotateY(18deg) rotateZ(-2deg); } }
@keyframes nf-d3 { 0%, 100% { transform: translate3d(0, 0, -120px) rotateX(20deg) rotateY(-34deg) rotateZ(10deg); } 50% { transform: translate3d(24px, -30px, -80px) rotateX(8deg) rotateY(-20deg) rotateZ(2deg); } }
@keyframes nf-d4 { 0%, 100% { transform: translate3d(0, 0, -220px) rotateX(14deg) rotateY(26deg) rotateZ(-6deg); } 50% { transform: translate3d(-18px, 30px, -180px) rotateX(24deg) rotateY(12deg) rotateZ(4deg); } }

.nf-coin {
    position: absolute; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-weight: var(--nf-weight-heading); font-size: 13px; color: #fff;
    background: radial-gradient(circle at 30% 25%, var(--nf-highlight), var(--nf-accent) 70%); box-shadow: 0 14px 28px -10px rgba(0, 0, 0, .6), inset 0 0 0 2px rgba(255, 255, 255, .25);
}
.c1 { top: 52%; left: 8%; animation: nf-coin 9s ease-in-out infinite; }
.c2 { top: 8%; right: 34%; width: 34px; height: 34px; font-size: 11px; opacity: .8; animation: nf-coin 11s ease-in-out -3s infinite; }
.c3 { bottom: 22%; right: 6%; width: 40px; height: 40px; font-size: 11px; opacity: .7; animation: nf-coin 13s ease-in-out -6s infinite; display: none; }
@keyframes nf-coin { 0%, 100% { transform: translateY(0) rotateY(0); } 50% { transform: translateY(-22px) rotateY(180deg); } }

/* ======================= Painel direito ======================= */
.nf-pane { position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 24px 14px 20px; background: var(--nf-canvas); }
.nf-box {
    --nf-h: var(--nf-control-height); --nf-lh: var(--nf-label-height); --nf-lm: var(--nf-label-gap);
    width: 100%; max-width: 520px; margin: 0 auto; padding: 30px 22px; background: var(--nf-surface); border: 1px solid var(--nf-line);
    border-radius: var(--nf-radius-card); box-shadow: var(--nf-shadow-card);
}
.nf-box, .nf-box * { box-sizing: border-box; }
.nf-box h1 { font-size: var(--nf-title); font-weight: var(--nf-weight-heading); letter-spacing: -.02em; margin: 0 0 4px; color: var(--nf-ink); }
.nf-box .sub { color: var(--nf-muted); font-size: var(--nf-text-table); line-height: 1.35; margin-bottom: 24px; }
.nf-box label { display: block; }
.nf-box .form-line > label:not(.error) { height: var(--nf-lh); line-height: var(--nf-lh); margin-bottom: var(--nf-lm); }
.nf-box .form-group { margin-bottom: var(--nf-space-4); }

/* campos (sobrescrevem o estilo global do tema) */
.nf-box .form-line { position: relative; display: block; width: 100%; padding: 0; }
.nf-box .form-line::before, .nf-box .form-line::after { display: none !important; }
.nf-box .form-line .form-control {
    display: block; margin: 0 !important; padding: 0 14px 0 44px !important; font-size: var(--nf-text); cursor: text;
}
.nf-box .form-line input.form-control,
.nf-box .form-line select.form-control { cursor: pointer; box-sizing: border-box !important; width: 100% !important; min-width: 0 !important; max-width: 100% !important; height: var(--nf-h) !important; }
.nf-box .form-line #password { padding-right: 46px !important; }
.nf-ico { position: absolute; left: 14px; top: calc(var(--nf-lh) + var(--nf-lm) + (var(--nf-h) - 18px) / 2); z-index: 2; width: 18px; height: 18px; color: #c4c0ee; pointer-events: none; transition: color .2s; }
.nf-box .form-line:focus-within .nf-ico { color: var(--nf-primary); }
.nf-eye { position: absolute; right: 8px; top: calc(var(--nf-lh) + var(--nf-lm) + (var(--nf-h) - 34px) / 2); width: 34px; height: 34px; border: 0; background: transparent; color: #c4c0ee; border-radius: var(--nf-radius-sm); cursor: pointer; }
.nf-eye:hover { color: var(--nf-primary); background: var(--nf-surface-hover); }
.nf-eye svg { width: 18px; height: 18px; }

/* opções (chips) + esqueceu a senha */
.nf-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 18px; }
.nf-box .nf-row label.nf-chip {
    position: relative !important; display: block !important; flex: 1 1 calc(50% - 4px); max-width: calc(50% - 4px);
    margin: 0 !important; padding: 0 !important; height: auto !important; min-height: 0 !important;
    font-size: var(--nf-text-sm) !important; line-height: 1.2 !important; cursor: pointer;
}
.nf-box .nf-row .nf-chip input[type="checkbox"] {
    -webkit-appearance: none !important; appearance: none !important; position: absolute !important; left: 0 !important; top: 0 !important;
    width: 1px !important; height: 1px !important; margin: 0 !important; padding: 0 !important; opacity: 0 !important;
    border: 0 !important; background: none !important; box-shadow: none !important; visibility: visible !important; pointer-events: none;
}
.nf-box .nf-row .nf-chip input[type="checkbox"]::before, .nf-box .nf-row .nf-chip input[type="checkbox"]::after { content: none !important; display: none !important; }
/* o tema desenha uma caixa de marcação em `checkbox + span`; aqui ela é anulada */
.nf-box .nf-row .nf-chip input[type="checkbox"] + span.nf-chip-ui::before,
.nf-box .nf-row .nf-chip input[type="checkbox"] + span.nf-chip-ui::after,
.nf-box .nf-row .nf-chip input[type="checkbox"]:checked + span.nf-chip-ui::before,
.nf-box .nf-row .nf-chip input[type="checkbox"]:checked + span.nf-chip-ui::after,
.nf-box .nf-row .nf-chip input[type="checkbox"]:not(.filled-in) + span:not(.lever)::before,
.nf-box .nf-row .nf-chip input[type="checkbox"]:not(.filled-in) + span:not(.lever)::after,
.nf-box .nf-row .nf-chip input[type="checkbox"]:checked:not(.filled-in) + span:not(.lever)::before,
.nf-box .nf-row .nf-chip input[type="checkbox"]:checked:not(.filled-in) + span:not(.lever)::after {
    content: none !important; display: none !important; width: 0 !important; height: 0 !important; border: 0 !important;
    background: none !important; transform: none !important; opacity: 0 !important;
}
.nf-box .nf-row .nf-chip .nf-chip-ui {
    display: flex !important; align-items: center !important; gap: 7px; width: 100%; min-height: 38px; padding: 9px 10px !important;
    position: static !important; height: auto !important; overflow: hidden; white-space: nowrap;
    font-size: var(--nf-text-sm) !important; font-weight: var(--nf-weight-label); line-height: 1.2 !important; color: var(--nf-muted);
    background: var(--nf-canvas); border: var(--nf-control-border) solid var(--nf-line); border-radius: 10px;
    transition: background .18s, border-color .18s, color .18s, box-shadow .18s;
}
.nf-box .nf-chip-ui > svg { width: 16px !important; height: 16px !important; flex: 0 0 16px !important; margin: 0 !important; }
.nf-box .nf-chip-ui i.nf-chip-ck {
    display: grid !important; place-items: center; flex: 0 0 18px !important; width: 18px !important; height: 18px !important;
    margin: 0 0 0 auto !important; padding: 0 !important; position: static !important; font-style: normal !important; font-size: 0 !important; line-height: 0 !important;
    color: transparent; background: var(--nf-surface); border: var(--nf-control-border) solid var(--nf-line); border-radius: 50%; transition: all .18s;
}
.nf-box .nf-chip-ck svg { width: 10px !important; height: 10px !important; margin: 0 !important; }
.nf-chip:hover .nf-chip-ui { border-color: var(--nf-line-strong); background: var(--nf-surface-hover); }
.nf-chip input:checked + .nf-chip-ui { background: var(--nf-selected); border-color: var(--nf-primary); color: var(--nf-accent); box-shadow: 0 0 0 3px rgba(98, 90, 202, .12); }
.nf-chip input:checked + .nf-chip-ui .nf-chip-ck { background: var(--nf-primary); border-color: var(--nf-primary); color: #fff; }
.nf-chip input:focus-visible + .nf-chip-ui { outline: 2px solid var(--nf-primary); outline-offset: 2px; }

.nf-forgot-wrap { display: flex; justify-content: flex-end; margin-top: 6px; }
.nf-forgot { display: inline-flex; align-items: center; gap: 5px; font-size: var(--nf-text-sm); font-weight: var(--nf-weight-label); color: var(--nf-primary); text-decoration: none; }
.nf-forgot:hover { color: var(--nf-accent); text-decoration: underline; }
.nf-forgot svg { width: 14px; height: 14px; }

/* credenciamento / documentação */
.nf-links { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--nf-line); }
.nf-link-card {
    display: flex; align-items: center; gap: 10px; padding: 12px; background: var(--nf-surface); border: var(--nf-control-border) solid var(--nf-line); border-radius: var(--nf-radius);
    color: var(--nf-ink) !important; text-decoration: none !important; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.nf-link-card:hover { border-color: var(--nf-primary); box-shadow: 0 6px 16px -8px rgba(98, 90, 202, .5); transform: translateY(-1px); }
.nf-link-card svg { flex: 0 0 36px; width: 36px; height: 36px; padding: 8px; border-radius: 10px; color: #fff; background: var(--nf-brand-gradient); }
.nf-link-card span { display: flex; flex-direction: column; min-width: 0; font-size: var(--nf-text-caption); line-height: 1.25; color: var(--nf-muted); }
.nf-link-card b { font-size: var(--nf-text-sm); font-weight: var(--nf-weight-button); color: var(--nf-ink); }

/* rodapé (neutraliza o posicionamento do tema) */
.nf-foot { width: 100%; max-width: 100%; margin-top: 24px; text-align: center; word-break: break-word; }
.nf-foot * { max-width: 100%; }
.nf-foot .footer { position: static !important; left: auto !important; right: auto !important; bottom: auto !important; width: 100% !important; height: auto !important; margin: 0 !important; padding: 0 !important; background: transparent !important; }
.nf-foot .container { width: 100% !important; max-width: 100% !important; padding: 0 8px !important; margin: 0 !important; }
.nf-foot .copyright { font-size: var(--nf-text-sm); line-height: 1.5; color: var(--nf-muted) !important; }
.nf-foot .copyright a { color: var(--nf-primary); }


/* ======================= Celular pequeno ======================= */
@media (max-width: 480px) {
    .nf-box { padding: 26px 18px; border-radius: var(--nf-radius-panel); }
}

@media (max-width: 380px) { .nf-box .nf-row label.nf-chip { flex-basis: 100%; max-width: 100%; } }

/* ======================= Desktop: sem rolagem, tudo escala pela altura ======================= */
@media (min-width: 961px) {
    html, body.nf-login { height: 100%; }
    .nf-split { display: grid; grid-template-columns: minmax(360px, 42%) 1fr; align-items: start; height: 100vh; height: 100dvh; }

    .nf-hero {
        position: sticky; top: 0; align-self: start; justify-content: center; height: 100vh; height: 100dvh; padding: 36px 48px 28px;
        box-shadow: 14px 0 40px -6px rgba(11, 16, 50, .45), 40px 0 90px -20px rgba(35, 42, 115, .35);
    }
    .nf-hero h2 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); }
    .nf-doc { width: 190px; }
    .d4, .c3 { display: block; }

    .nf-pane {
        align-self: stretch; height: 100vh; height: 100dvh; padding: clamp(8px, 2vh, 28px) 24px;
        overflow-x: hidden; overflow-y: auto; scrollbar-width: none;
    }
    .nf-pane::-webkit-scrollbar { display: none; }
    .nf-pane::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 70px; pointer-events: none; background: linear-gradient(90deg, rgba(35, 42, 115, .12), rgba(35, 42, 115, 0)); }

    .nf-box { --nf-h: clamp(36px, 5vh, var(--nf-control-height)); --nf-lm: 3px; max-width: 420px; padding: clamp(16px, 3.2vh, 38px) clamp(24px, 2.4vw, 36px); border-radius: clamp(16px, 2.4vh, var(--nf-radius-card)); }
    .nf-box h1 { font-size: clamp(20px, 3vh, var(--nf-title)); }
    .nf-box .sub { font-size: clamp(var(--nf-text-sm), 1.7vh, var(--nf-text-table)); margin-bottom: clamp(8px, 2.2vh, 24px); }
    .nf-box label { margin-bottom: 3px; font-size: clamp(var(--nf-text-caption), 1.5vh, var(--nf-text-sm)); }
    .nf-box .form-group { margin-bottom: clamp(7px, 1.7vh, 16px); }
    .nf-box .form-line .form-control { font-size: clamp(var(--nf-text-table), 1.9vh, var(--nf-text)); }
    .nf-row { margin-bottom: clamp(8px, 1.8vh, 18px); gap: 6px 8px; }
    .nf-box .nf-row .nf-chip .nf-chip-ui { min-height: clamp(30px, 4.4vh, 38px); padding: clamp(5px, 1.1vh, 9px) 10px !important; }
    .nf-btn { height: clamp(40px, 5.6vh, var(--nf-button-height)); }
    .nf-links { gap: 10px; margin-top: clamp(10px, 2.2vh, 22px); padding-top: clamp(10px, 2vh, 20px); }
    .nf-link-card { padding: clamp(7px, 1.3vh, 12px) 10px; }
    .nf-link-card svg { flex-basis: clamp(28px, 4vh, 36px); width: clamp(28px, 4vh, 36px); height: clamp(28px, 4vh, 36px); padding: 6px; }
    .nf-foot { margin-top: clamp(6px, 1.6vh, 20px); }
    .nf-foot .copyright { font-size: clamp(var(--nf-text-caption), 1.5vh, var(--nf-text-sm)); }
}
@media (min-width: 961px) and (max-height: 760px) {
    .nf-box .sub { display: none; }
    .nf-link-card span { font-size: var(--nf-text-caption); }
    .nf-link-card b { font-size: var(--nf-text-caption); }
}
@media (min-width: 961px) and (max-height: 700px) {
    .nf-hero { padding-top: 24px; padding-bottom: 18px; }
    .nf-hero .lead { margin-bottom: 14px; }
    .nf-steps { gap: 6px; }
    .nf-doc { width: 150px; }
}
@media (min-width: 961px) and (max-height: 620px) {
    .nf-link-card span { font-size: 0; }
}

/* Tablet/celular: formulário primeiro, painel de passos embaixo */
@media (max-width: 960px) {
    .nf-pane { order: -1; }
}

@media (prefers-reduced-motion: reduce) {
    .nf-login * { transition: none !important; }
    .nf-hero::before, .nf-hero::after, .nf-doc, .nf-coin { animation: none !important; }
}

/* ---------- Mensagens de erro (jQuery Validate) ---------- */
.nf-box .form-line label.error,
.nf-box .form-line .error:not(input):not(select) {
    display: block !important; position: static !important; height: auto !important; margin: 5px 0 0 !important; padding: 0 !important;
    font-size: var(--nf-text-caption) !important; font-weight: 500 !important; line-height: 1.3 !important; color: var(--nf-danger-solid) !important;
    background: none !important; border: 0 !important; box-shadow: none !important; transform: none !important;
}
.nf-box .form-line input.error,
.nf-box .form-line select.error,
.nf-box .form-line input.is-invalid { border-color: #e5484d !important; box-shadow: 0 0 0 3px rgba(229, 72, 77, .12) !important; }
.nf-box .form-line:has(.error) .nf-ico { color: #e5484d; }
.nf-box .invalid-feedback { margin-top: 5px; font-size: var(--nf-text-caption); font-weight: 500; color: var(--nf-danger-solid); }

/* ======================= Marca, aviso de erro e estado dos campos ======================= */
.nf-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.nf-brand-mark { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: var(--nf-brand-gradient); box-shadow: 0 6px 14px -6px rgba(62, 71, 171, .7); }
.nf-brand-mark svg { width: 19px; height: 19px; }
.nf-brand-text { display: flex; flex-direction: column; font-size: 16px; font-weight: var(--nf-weight-heading); letter-spacing: .01em; line-height: 1.1; color: var(--nf-bg); }

.nf-locked-area { transition: opacity .25s; }
.nf-locked-area.is-locked { opacity: .5; pointer-events: none; user-select: none; }

/* hierarquia: credenciamento (secundário) e documentação (discreta, no rodapé) */

@media (min-width: 961px) {
    .nf-brand { margin-bottom: clamp(6px, 1.6vh, 14px); }
    .nf-brand-mark { width: clamp(28px, 4vh, 34px); height: clamp(28px, 4vh, 34px); flex-basis: clamp(28px, 4vh, 34px); }
}


/* ======================= Painel lateral compacto ======================= */
.nf-expand {
    display: none; align-self: flex-start; align-items: center; gap: 8px; margin-top: 14px; padding: 9px 14px; border-radius: 10px; cursor: pointer;
    font-size: var(--nf-text-sm); font-weight: var(--nf-weight-label); color: #fff; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .28); transition: background .2s;
}
.nf-expand:hover { background: rgba(255, 255, 255, .2); }
.nf-expand svg { width: 16px; height: 16px; }
.nf-split.is-compact .nf-expand { display: inline-flex; }
.nf-split.is-compact .nf-steps, .nf-split.is-compact .nf-hero .lead, .nf-split.is-compact .nf-scene { display: none; }
.nf-split.is-compact .nf-hero h2 { font-size: 20px; }
@media (min-width: 961px) {
    .nf-split { transition: grid-template-columns .3s ease; }
    .nf-split.is-compact { grid-template-columns: minmax(280px, 26%) 1fr; }
    .nf-split.is-compact .nf-hero { padding-left: 28px; padding-right: 28px; }
}

/* ======================= Desempenho: modo leve e aba oculta ======================= */
.nf-lite .nf-scene { display: none; }
.nf-lite .nf-hero::before, .nf-lite .nf-hero::after { animation: none; filter: blur(60px); }
.nf-paused .nf-hero::before, .nf-paused .nf-hero::after, .nf-paused .nf-doc, .nf-paused .nf-coin { animation-play-state: paused; }

/* ======================= Select de prefeitura (Select2) ======================= */
.nf-box .form-line select.form-control.select2-hidden-accessible {
    position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important;
    border: 0 !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; opacity: 0 !important;
}
.nf-box .select2-container { display: block; width: 100% !important; }
.nf-box .select2-container--default .select2-selection--single {
    display: flex; align-items: center; height: var(--nf-h); border: var(--nf-control-border) solid var(--nf-line); border-radius: var(--nf-radius); background: var(--nf-surface); outline: 0; transition: border-color .2s, box-shadow .2s;
}
.nf-box .select2-container--default .select2-selection--single .select2-selection__rendered {
    width: 100%; padding: 0 38px 0 44px; line-height: normal; font-size: var(--nf-text); color: var(--nf-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nf-box .select2-container--default .select2-selection--single .select2-selection__placeholder { color: var(--nf-placeholder); }
.nf-box .select2-container--default .select2-selection--single .select2-selection__arrow { top: 0; right: 10px; height: 100%; }
.nf-box .select2-container--default.select2-container--focus .select2-selection--single,
.nf-box .select2-container--default.select2-container--open .select2-selection--single { border-color: var(--nf-primary); box-shadow: var(--nf-focus); }
@media (min-width: 961px) { .nf-box .select2-container--default .select2-selection--single .select2-selection__rendered { font-size: clamp(var(--nf-text-table), 1.9vh, var(--nf-text)); } }

/* Conteúdo mais alto que a janela: não corta o topo (centraliza só quando sobra espaço) */
@media (min-width: 961px) {
    .nf-pane { justify-content: flex-start; }
    .nf-box { margin-top: auto; }
    .nf-foot { margin-bottom: auto; }
}
@media (min-width: 961px) and (max-height: 820px) {
    .nf-brand { margin-bottom: 4px; }
    .nf-box { padding-top: 14px; padding-bottom: 14px; }
}

/* Marca e título na mesma linha */
.nf-brand h1 { margin: 0; padding-left: 12px; border-left: 2px solid var(--nf-line); font-size: var(--nf-title); line-height: 1.15; }
@media (min-width: 961px) { .nf-brand h1 { font-size: clamp(20px, 2.8vh, var(--nf-title)); } }

@media (max-width: 380px) { .nf-links { grid-template-columns: 1fr; } }

/* Preenchimento automático do navegador: mantém o visual do campo (sem fundo azul/amarelo) */
.nf-box input:-webkit-autofill,
.nf-box input:-webkit-autofill:hover,
.nf-box input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--nf-ink);
    -webkit-box-shadow: 0 0 0 1000px var(--nf-input) inset;
    box-shadow: 0 0 0 1000px var(--nf-input) inset;
    transition: background-color 9999s ease-out 0s;
}

/* ======================= Consulta de NFS-e ======================= */
/* indicador de carregamento do sistema: escondido até loader(true) */
body.nf-login .page-loader-wrapper { display: none; }

.nf-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; opacity: 0; }
/* vagas vazias que o validador do projeto usa (ele reescreve a próxima div irmã do campo) */
.nf-vslot { display: none !important; }

.nf-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 14px; padding: 4px; border-radius: var(--nf-radius); background: var(--nf-surface-hover); }
.nf-seg button { display: flex; align-items: center; justify-content: center; gap: 7px; height: 36px; border: 0; border-radius: 9px; cursor: pointer; font-size: var(--nf-text-table); font-weight: var(--nf-weight-button); color: var(--nf-muted); background: transparent; transition: background .2s, color .2s, box-shadow .2s; }
.nf-seg button:hover { color: var(--nf-primary); }
.nf-seg button.is-active { color: #fff; background: var(--nf-brand-gradient); box-shadow: 0 6px 14px -8px rgba(62, 71, 171, .8); }
.nf-seg button:focus-visible { outline: 2px solid var(--nf-primary); outline-offset: 2px; }

.nf-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 420px) { .nf-cols { grid-template-columns: 1fr; } }

@media (min-width: 961px) { .nf-seg { margin-bottom: clamp(8px, 1.8vh, 14px); } .nf-seg button { height: clamp(30px, 4.4vh, 36px); } }

/* ======================= Credenciamento ======================= */
@media (min-width: 961px) { .nf-box.nf-box-wide { max-width: 560px; } }

/* abas (Bootstrap tab) no formato do seletor segmentado */
.nf-seg.nav { flex-wrap: nowrap; }
.nf-seg .nav-link {
    display: flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0; border: 0; border-radius: 9px; cursor: pointer;
    font-size: var(--nf-text-table); font-weight: var(--nf-weight-button); color: var(--nf-muted); background: transparent; text-decoration: none; transition: background .2s, color .2s, box-shadow .2s;
}
.nf-seg .nav-link svg { width: 16px; height: 16px; }
.nf-seg .nav-link:hover { color: var(--nf-primary); }
.nf-seg .nav-link.active { color: #fff; background: var(--nf-brand-gradient); box-shadow: 0 6px 14px -8px rgba(62, 71, 171, .8); }
@media (min-width: 961px) { .nf-seg .nav-link { height: clamp(30px, 4.4vh, 36px); } }

.nf-note { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 12px; padding: 10px 12px; border-radius: var(--nf-radius); font-size: var(--nf-text-sm); line-height: 1.4; color: var(--nf-muted); background: var(--nf-canvas); border: 1px solid var(--nf-line); }
.nf-note svg { flex: 0 0 18px; width: 18px; height: 18px; margin-top: 1px; color: var(--nf-primary); }

.nf-add {
    display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 42px; border-radius: var(--nf-radius); cursor: pointer;
    font-size: var(--nf-text-table); font-weight: var(--nf-weight-button); color: var(--nf-primary); background: var(--nf-surface); border: var(--nf-control-border) dashed var(--nf-line-strong); transition: background .2s, border-color .2s;
}
.nf-add:hover { background: var(--nf-surface-hover); border-color: var(--nf-primary); }
.nf-add svg { width: 18px; height: 18px; }
.nf-empty { margin: 0; padding: 14px 0 6px; text-align: center; font-size: var(--nf-text-sm); color: var(--nf-muted); }
.nf-anexos:has(#body-anexos tr) .nf-empty { display: none; }

/* tabela de anexos vira lista de cartões */
.nf-tabela, .nf-tabela tbody, .nf-tabela tr, .nf-tabela td { display: block; width: 100%; padding: 0; border: 0; }
.nf-tabela { margin: 0; }
.nf-tabela tr {
    display: grid; grid-template-columns: 1fr auto; grid-template-areas: "file del" "desc desc"; gap: 8px; align-items: center;
    margin-top: 10px; padding: 12px; background: var(--nf-surface); border: var(--nf-control-border) solid var(--nf-line) !important; border-radius: var(--nf-radius);
}
.nf-tabela td:nth-child(1) { grid-area: file; min-width: 0; }
.nf-tabela td:nth-child(2) { grid-area: desc; }
.nf-tabela td:nth-child(3) { grid-area: del; width: auto; }
.nf-tabela input.form-control {
    width: 100% !important; height: 40px !important; margin: 0 !important; padding: 0 12px !important; box-sizing: border-box !important;
    font-size: var(--nf-text-table); border: var(--nf-control-border) solid var(--nf-line) !important; border-radius: 10px !important; background: var(--nf-surface) !important; box-shadow: none !important;
}
.nf-tabela input.form-control:focus { border-color: var(--nf-primary) !important; box-shadow: var(--nf-focus) !important; outline: 0; }



.btn-excluir-anexo { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border-radius: 10px; cursor: pointer; color: var(--nf-danger-solid); background: var(--nf-surface); border: var(--nf-control-border) solid var(--nf-danger-line); transition: background .2s; }
.btn-excluir-anexo:hover { background: #fdeeee; }
.btn-excluir-anexo svg { width: 18px; height: 18px; }

/* erro de validação no select pesquisável (cargo) */
.nf-box .select2-container--default .select2-selection--single.is-invalid { border-color: #e5484d; box-shadow: 0 0 0 3px rgba(229, 72, 77, .12); }

/* seletor CNPJ/CPF (consulta): ícone ao lado do texto */
.nf-seg button svg { width: 16px; height: 16px; flex: 0 0 16px; }
