/* Tela de acesso da Consulta de Lote.
   Mesmo padrão do login do Tickets: foto da fábrica, card #5e5555, laranja #ff7505. */

:root {
    --laranja: #ff7505;
    --amarelo: #f7b030;
    --card: #5e5555;
    --campo: #e6e2e1;
    --escuro: #343a40;
    --texto-fraco: #cfc8c7;
    --erro: #dc3545;
    --ok: #2fa56a;
}

* { box-sizing: border-box; }

html { height: 100%; }

body {
    margin: 0; min-height: 100vh; min-height: 100dvh;
    font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    color: #fff; background: #2b2626; overflow-x: hidden;
}

[hidden] { display: none !important; }

.ic { width: 1.1em; height: 1.1em; flex-shrink: 0; vertical-align: -0.18em; }

/* ── Fundo: foto parada (o movimento dava vertigem) ── */
.fundo {
    position: fixed; inset: 0; z-index: -2;
    background: url("../img/login_velaplast-01.jpg") center/cover no-repeat;
}
.fundo-veu {
    position: fixed; inset: 0; z-index: -1;
    background:
        radial-gradient(60vmax 60vmax at 50% 45%, rgba(20, 16, 16, .05), rgba(20, 16, 16, .55)),
        linear-gradient(180deg, rgba(255, 117, 5, .08), rgba(0, 0, 0, .18));
}

/* ── Palco e card ── */
.palco {
    min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center;
    padding: 1.2rem 1rem 4.4rem;
}

.login-card {
    position: relative; width: 410px; max-width: 100%;
    background: var(--card); border-radius: 14px; padding: 38px 35px 26px; text-align: center;
    box-shadow:
        0 16px 42px rgba(0, 0, 0, .42),
        -26px 0 50px -22px rgba(0, 0, 0, .34),
        26px 0 50px -22px rgba(0, 0, 0, .34);
    animation: entrar .7s cubic-bezier(.2, .8, .2, 1) both;
    overflow: hidden;
}
/* Faixa de luz que corre no topo do card */
.login-card::before {
    content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px;
    background: linear-gradient(90deg, var(--laranja), var(--amarelo), var(--laranja), var(--amarelo), var(--laranja));
    background-size: 200% 100%;
    animation: correr 6s linear infinite;
}
@keyframes correr { to { background-position: -200% 0; } }
@keyframes entrar {
    from { opacity: 0; transform: translateY(26px) scale(.97); }
    to   { opacity: 1; transform: none; }
}
.login-card.tremer { animation: tremer .42s; }
@keyframes tremer {
    20%, 60% { transform: translateX(-7px); }
    40%, 80% { transform: translateX(7px); }
}

.logo { width: 220px; max-width: 78%; height: auto; display: block; margin: 0 auto 10px; }
.selo {
    display: inline-block; margin: 0 0 18px; padding: 4px 12px; border-radius: 999px;
    font-size: .7rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
    color: var(--amarelo); background: rgba(0, 0, 0, .2); border: 1px solid rgba(247, 176, 48, .35);
}
.sub { margin: 0 0 18px; font-size: .9rem; line-height: 1.45; color: var(--texto-fraco); }

/* ── Troca de telas dentro do card ── */
.views { position: relative; transition: height .38s cubic-bezier(.3, .8, .3, 1); }
.view { animation: surgir .38s ease both; }
.view.volta { animation-name: surgir-volta; }
@keyframes surgir { from { opacity: 0; transform: translateX(22px); } to { opacity: 1; transform: none; } }
@keyframes surgir-volta { from { opacity: 0; transform: translateX(-22px); } to { opacity: 1; transform: none; } }

/* ── Campos ── */
.campo { position: relative; display: block; margin-bottom: 14px; }
.campo-ic {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    color: var(--laranja); font-size: 1.05rem; display: flex; pointer-events: none;
    transition: transform .2s ease;
}
.campo input {
    width: 100%; height: 46px; padding: 0 42px; font: inherit; font-size: 16px; border-radius: 8px;
    background: var(--campo); border: 1px solid #ccc; color: #1f2937;
    transition: box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.campo input::placeholder { color: #7b7473; }
.campo input:focus { outline: 0; border-color: var(--laranja); background: #fff; box-shadow: 0 0 0 3px rgba(255, 117, 5, .38); }
.campo:focus-within .campo-ic { transform: translateY(-50%) scale(1.15); }
.campo.invalido input { border-color: var(--erro); box-shadow: 0 0 0 3px rgba(220, 53, 69, .35); }

.campo-ok {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%) scale(0);
    color: var(--ok); display: flex; font-size: 1.1rem; transition: transform .25s cubic-bezier(.3, 1.6, .5, 1);
}
.campo.valido .campo-ok { transform: translateY(-50%) scale(1); }

.ver-senha {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    background: none; border: 0; color: #6b7280; cursor: pointer; font-size: 1.1rem; padding: 7px; display: flex; border-radius: 6px;
}
.ver-senha:hover, .ver-senha:focus-visible { color: var(--laranja); outline: 0; }
.ver-senha .ic-olho-fechado, .ver-senha.aberta .ic-olho { display: none; }
.ver-senha.aberta .ic-olho-fechado { display: block; }

.caps { margin: -6px 0 12px; font-size: .78rem; color: var(--amarelo); text-align: left; }

/* Medidor de força da senha */
.forca { display: flex; align-items: center; gap: 5px; margin: -6px 0 14px; height: 14px; }
.forca i { flex: 1; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .16); transition: background .25s ease; }
.forca span { width: 62px; text-align: right; font-size: .72rem; color: var(--texto-fraco); }
.forca[data-nivel="1"] i:nth-child(-n+1) { background: var(--erro); }
.forca[data-nivel="2"] i:nth-child(-n+2) { background: var(--amarelo); }
.forca[data-nivel="3"] i:nth-child(-n+3) { background: #9bc53d; }
.forca[data-nivel="4"] i:nth-child(-n+4) { background: var(--ok); }

/* Aceite da política */
.aceite { display: flex; align-items: flex-start; gap: 9px; margin: 4px 0 14px; text-align: left; font-size: .9rem; cursor: pointer; line-height: 1.4; color: #eee; cursor: pointer; }
.aceite input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.caixa {
    width: 20px; height: 20px; flex-shrink: 0; border-radius: 5px; border: 2px solid var(--texto-fraco);
    display: flex; align-items: center; justify-content: center; color: transparent; font-size: .8rem;
    transition: background .18s ease, border-color .18s ease, color .18s ease;
}
.aceite input:checked + .caixa { background: var(--laranja); border-color: var(--laranja); color: #fff; }
.aceite input:focus-visible + .caixa { box-shadow: 0 0 0 3px rgba(255, 117, 5, .45); }

/* ── Botões e links ── */
.btn-login {
    position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    min-width: 60%; padding: 11px 22px; font: inherit; font-size: 16px; font-weight: 600; border-radius: 10px;
    background: var(--laranja); border: 0; color: #fff; cursor: pointer; text-decoration: none; overflow: hidden;
    transition: filter .15s ease, transform .15s ease, box-shadow .15s ease;
}
.btn-login::after {
    content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .35), transparent);
    transform: skewX(-20deg); transition: left .55s ease;
}
.btn-login:hover:not(:disabled) { filter: brightness(1.05); transform: translateY(-1px); box-shadow: 0 8px 18px rgba(255, 117, 5, .35); }
.btn-login:hover:not(:disabled)::after { left: 120%; }
.btn-login:active:not(:disabled) { transform: none; }
.btn-login:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.btn-login:disabled { opacity: .5; cursor: not-allowed; }
.btn-login.carregando { color: transparent; pointer-events: none; }
.btn-login.carregando::before {
    content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, .4); border-top-color: #fff; animation: girar .7s linear infinite;
}
@keyframes girar { to { transform: rotate(360deg); } }

.dupla { display: flex; gap: 10px; }
.dupla .btn-login { flex: 1; min-width: 0; }
.btn-sec {
    width: 46px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .3); background: transparent; color: #fff;
    cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
    transition: background .15s ease;
}
.btn-sec:hover, .btn-sec:focus-visible { background: rgba(255, 255, 255, .12); outline: 0; }

.atalhos { margin-top: 16px; font-size: .86rem; display: flex; justify-content: center; gap: .6rem; color: var(--texto-fraco); }
.atalhos a, .link-texto, .link-ajuda {
    color: #fff; background: none; border: 0; padding: 0; font: inherit; cursor: pointer;
    text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .35); text-underline-offset: 3px;
    transition: color .15s ease, text-decoration-color .15s ease;
}
.atalhos a:hover, .link-texto:hover, .link-ajuda:hover,
.atalhos a:focus-visible, .link-texto:focus-visible, .link-ajuda:focus-visible {
    color: var(--amarelo); text-decoration-color: var(--amarelo); outline: 0;
}
.link-ajuda { display: flex; align-items: center; gap: .4rem; margin: 0 auto 16px; font-size: .84rem; color: var(--amarelo); text-decoration: none; }

.lock-note {
    margin: 20px 0 0; font-size: .76rem; color: var(--texto-fraco);
    display: flex; align-items: center; justify-content: center; gap: .35rem;
}

/* Passos do cadastro */
.passos { list-style: none; display: flex; gap: 8px; margin: 0 0 16px; padding: 0; font-size: .78rem; color: var(--texto-fraco); }
.passos li {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: .45rem; padding-bottom: 8px;
    border-bottom: 3px solid rgba(255, 255, 255, .16); transition: border-color .3s ease, color .3s ease;
}
.passos b {
    width: 20px; height: 20px; border-radius: 50%; background: rgba(255, 255, 255, .16); color: #fff;
    display: inline-flex; align-items: center; justify-content: center; font-size: .72rem; transition: background .3s ease;
}
.passos li.ativo, .passos li.feito { color: #fff; border-color: var(--laranja); }
.passos li.ativo b, .passos li.feito b { background: var(--laranja); }
.passo { animation: surgir .32s ease both; }
.passo.volta { animation-name: surgir-volta; }

/* Tela de resultado */
.feito-ic {
    width: 66px; height: 66px; margin: 4px auto 14px; border-radius: 50%; background: var(--ok); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 2rem;
    animation: pular .5s cubic-bezier(.3, 1.6, .5, 1) both;
}
.feito-ic .ic polyline { stroke-dasharray: 30; stroke-dashoffset: 30; animation: tracar .45s .25s ease forwards; }
@keyframes pular { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes tracar { to { stroke-dashoffset: 0; } }
.feito-titulo { margin: 0 0 8px; font-size: 1.15rem; }

/* ── Aviso no topo (padrão do Tickets) ── */
.top-alert {
    position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
    color: #fff; padding: 12px 20px; border-radius: 8px; font-size: 15px; font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .3); z-index: 3000; max-width: 92%; text-align: center;
    background: var(--escuro); animation: descer .3s ease both;
}
.top-alert.erro { background: var(--erro); }
.top-alert.ok { background: var(--ok); }
.top-alert.saindo { opacity: 0; transition: opacity .3s ease; }
@keyframes descer { from { opacity: 0; transform: translate(-50%, -14px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ── Rodapé fixo (padrão do Tickets) ── */
.rodape {
    position: fixed; left: 0; right: 0; bottom: 0; min-height: 40px; z-index: 1500;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0 1rem;
    background: var(--escuro); color: #fff; font-size: .85rem; box-shadow: 0 -2px 6px rgba(0, 0, 0, .08);
}
.rodape a, .rodape .link-texto { color: var(--laranja); text-decoration: none; }
.rodape a:hover, .rodape .link-texto:hover { text-decoration: underline; color: var(--laranja); }

/* ── Janelas (modal no padrão do site, sem alert nativo) ── */
.modal {
    position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 1rem;
    background: rgba(20, 16, 16, .62); backdrop-filter: blur(3px); animation: clarear .2s ease both;
}
@keyframes clarear { from { opacity: 0; } to { opacity: 1; } }
.modal-caixa {
    width: 480px; max-width: 100%; max-height: calc(100dvh - 2rem); display: flex; flex-direction: column;
    background: #fff; color: #1f2937; border-radius: 12px; overflow: hidden; box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
    animation: entrar .32s cubic-bezier(.2, .8, .2, 1) both;
}
.modal-larga { width: 860px; }
.modal-topo { display: flex; align-items: center; gap: .6rem; padding: 12px 16px; background: var(--card); color: #fff; border-bottom: 3px solid var(--laranja); }
.modal-topo h2 { margin: 0; font-size: 1.05rem; font-weight: 600; flex: 1; text-align: left; }
.modal-x { background: none; border: 0; color: #fff; cursor: pointer; font-size: 1.2rem; padding: 6px; display: flex; border-radius: 6px; }
.modal-x:hover, .modal-x:focus-visible { background: rgba(255, 255, 255, .16); outline: 0; }
.modal-corpo { padding: 18px 20px; overflow-y: auto; text-align: left; font-size: .93rem; line-height: 1.55; }
.modal-pe { display: flex; align-items: center; justify-content: flex-end; gap: 1rem; padding: 12px 16px; background: #f3f1f0; border-top: 1px solid #e2dedd; }
.modal-pe .btn-login { min-width: 140px; }
.modal-pe .link-texto { color: #4b5563; text-decoration-color: #9ca3af; margin-right: auto; }
.modal-pe .link-texto:hover { color: var(--laranja); }

/* Ajuda: nota fiscal de exemplo + passos */
.ajuda { display: grid; grid-template-columns: 1.15fr 1fr; gap: 18px 22px; overflow-x: hidden; }
.ajuda > * { min-width: 0; }
.ajuda-legenda { margin: 0 0 10px; color: #4b5563; }
.danfe { overflow: hidden; border: 1.5px solid #374151; border-radius: 8px; padding: 8px; background: #fbfaf9; font-size: .68rem; color: #374151; }
.d-linha { display: flex; gap: 6px; margin-bottom: 6px; }
.d-caixa { border: 1px solid #9ca3af; border-radius: 5px; padding: 5px 7px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.d-caixa small { font-size: .58rem; color: #6b7280; text-transform: lowercase; }
.d-caixa b { font-size: .64rem; }
.d-cresce, .d-emit { flex: 1; }
.d-num { align-items: center; text-align: center; }
.d-barras { width: 26%; justify-content: flex-end; }
.d-barras i { display: block; height: 22px; background: repeating-linear-gradient(90deg, #111 0 2px, transparent 2px 4px, #111 4px 5px, transparent 5px 8px); }
.d-titulo { margin: 2px 0 4px; font-size: .58rem; font-weight: 700; text-transform: lowercase; }
.d-vazia .d-caixa { height: 24px; }
.d-vazia:last-child { margin-bottom: 0; }
.d-alvo {
    align-self: flex-start; padding: 2px 5px; border-radius: 4px; font-weight: 700; font-size: .72rem; white-space: nowrap;
    border: 1.5px dashed var(--laranja); color: #1f2937; transition: background .25s ease, box-shadow .25s ease, transform .25s ease;
}
.d-num .d-alvo { align-self: center; }
.d-alvo.aceso { background: #ffe3cc; box-shadow: 0 0 0 4px rgba(255, 117, 5, .3); transform: scale(1.06); border-style: solid; }

.ajuda-passos { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ajuda-passos li {
    display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 8px; border: 1px solid transparent;
    cursor: default; transition: background .25s ease, border-color .25s ease;
}
.ajuda-passos li.aceso { background: #fff3e8; border-color: #ffc999; }
.ajuda-passos b {
    width: 24px; height: 24px; flex-shrink: 0; border-radius: 50%; background: var(--laranja); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: .8rem;
}
.ajuda-passos strong { display: block; }
.ajuda-passos div { font-size: .86rem; color: #4b5563; }
.ajuda-passos strong { color: #1f2937; font-size: .92rem; }
.ajuda-obs {
    grid-column: 1 / -1; margin: 0; padding: 12px 14px 12px 30px; border-radius: 8px;
    background: #f3f1f0; border-left: 4px solid var(--laranja); font-size: .85rem; color: #4b5563;
}
.ajuda-obs li + li { margin-top: 4px; }
.ajuda-obs a, .politica a { color: #c85a00; }

/* Política de privacidade (janela e página) */
.politica h3 { margin: 20px 0 6px; font-size: 1rem; color: #1f2937; }
.politica p, .politica ul { margin: 0 0 10px; }
.politica ul { padding-left: 20px; }
.politica li + li { margin-top: 4px; }
.pol-data { font-size: .8rem; color: #6b7280; }

.pagina-texto .palco { align-items: flex-start; padding-top: 2rem; }
.folha {
    width: 820px; max-width: 100%; background: #fff; color: #1f2937; border-radius: 14px; overflow: hidden;
    box-shadow: 0 16px 42px rgba(0, 0, 0, .42); animation: entrar .6s cubic-bezier(.2, .8, .2, 1) both;
}
.folha-topo { background: var(--card); color: #fff; text-align: center; padding: 26px 20px 20px; border-bottom: 4px solid var(--laranja); }
.folha-topo img { display: block; margin: 0 auto 10px; height: auto; }
.folha-topo .selo { margin-bottom: 10px; }
.folha-topo h1 { margin: 0; font-size: 1.5rem; font-weight: 600; }
.folha-corpo { padding: 24px 32px 8px; font-size: .96rem; line-height: 1.6; }
.folha-pe { padding: 16px 32px 28px; text-align: center; }
.folha-pe .btn-login { min-width: 200px; }

/* ── Telas pequenas ── */
@media (max-width: 760px) {
    .ajuda { grid-template-columns: 1fr; }
    .folha-corpo { padding: 20px 20px 4px; }
}
@media (max-width: 480px) {
    .palco { padding: .8rem .8rem 4.2rem; }
    .login-card { padding: 28px 22px 20px; }
    .logo { width: 175px; }
    .campo input { height: 44px; }
    .rodape { font-size: .74rem; gap: .5rem; padding: 0 .65rem; }
    .rodape span { display: none; }
    .rodape { justify-content: space-around; }
    .modal { padding: .5rem; }
    .modal-corpo { padding: 14px; }
}

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

/* Recuperação: e-mail sem cadastro */
.sem-cadastro { margin: 14px 0 0; padding: 10px 12px; border-radius: 8px; font-size: .86rem; color: #fff;
    background: rgba(0, 0, 0, .22); border: 1px solid rgba(247, 176, 48, .45); animation: surgir .3s ease both; }
.sem-cadastro a { color: var(--amarelo); font-weight: 600; margin-left: .3rem; }
