

.folha {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

.folha__veu {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .45);
}


.folha__painel {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    background: var(--bg-white);
    color: var(--text-primary);
    border-radius: var(--raio-cartao) var(--raio-cartao) 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.folha__puxador {
    flex: none;
    width: 34px;
    height: 4px;
    margin: 9px auto 0;
    border-radius: 2px;
    background: var(--border-input);
}

.folha__faixa {
    flex: none;
    height: 3px;
    margin: 8px auto 0;
    width: 56px;
    border-radius: 2px;
    background: transparent;
    transition: background-color var(--t-rapido) var(--ease-suave);
}

.folha__faixa.success { background: var(--success); }
.folha__faixa.error   { background: var(--error); }
.folha__faixa.custom  { background: var(--primary); }

.folha__fechar {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font: inherit;
    font-size: 24px;
    line-height: 1;
    color: var(--text-secondary);
    background: none;
    border: none;
    border-radius: var(--raio-campo);
    cursor: pointer;
}

.folha__fechar:hover { color: var(--text-primary); }

.folha__corpo {
    padding: 18px 20px 20px;
    text-align: center;
}


.folha__texto { margin: 0; }

.folha__titulo {
    margin: 6px 0 0;
    font-size: 17px;
    font-weight: 660;
    line-height: 1.3;
    letter-spacing: -.01em;
    color: var(--text-primary);
}

.folha__descricao {
    margin: 7px 0 0;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.folha__descricao a { color: var(--info); }

.folha__lista {
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 7px;
    text-align: left;
}

.folha__item {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13.5px;
    color: var(--text-secondary);
}

.folha__item::before {
    content: "";
    flex: none;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--text-muted);
}

.folha__nota {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 14px 0 0;
    font-size: 12.5px;
    color: var(--text-secondary);
}

.folha__corpo > .marca-caixa { margin: 6px auto 16px; }


.folha__campo {
    margin-top: 16px;
    text-align: left;
}

.folha__rotulo {
    display: block;
    margin-bottom: 6px;
    font-size: 12.5px;
    font-weight: 560;
    color: var(--text-secondary);
}

.folha__entrada {
    font: inherit;
    font-size: 15px;
    width: 100%;
    padding: 11px 13px;
    color: var(--text-primary);
    background: var(--bg-page);
    border: 1.5px solid transparent;
    border-radius: var(--raio-campo);
    transition: border-color var(--t-rapido) var(--ease-suave);
}

.folha__entrada:focus {
    outline: none;
    background: var(--bg-white);
    border-color: var(--primary);
}

.folha__entrada[readonly] {
    color: var(--text-secondary);
    font-size: 12.5px;
}


.folha__injecao { text-align: left; }
.folha__injecao:empty { display: none; }


.folha__rodape {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin-top: 18px;
}

.folha__botao {
    font: inherit;
    font-size: 14.5px;
    font-weight: 620;
    padding: 13px 16px;
    border: none;
    border-radius: var(--raio-campo);
    cursor: pointer;
    transition: filter var(--t-rapido) var(--ease-suave),
                border-color var(--t-rapido) var(--ease-suave);
}

.folha__botao--primaria {
    background: var(--primary);
    color: var(--bg-white);
}

.folha__botao--primaria:hover { filter: brightness(.94); }

.folha__botao--secundaria {
    background: none;
    color: var(--text-secondary);
    border: 1.5px solid var(--border-input);
}

.folha__botao--secundaria:hover {
    border-color: var(--text-muted);
    color: var(--text-primary);
}

.folha__botao--texto {
    background: none;
    color: var(--text-secondary);
}

.folha__botao--texto:hover { color: var(--text-primary); }


@keyframes folhaSubir {
    from { transform: translateY(14px); opacity: .4; }
      to { transform: translateY(0);    opacity: 1; }
}

@keyframes folhaVeuEntrar {
    from { opacity: 0; }
      to { opacity: 1; }
}

.folha--aberta .folha__painel {
    animation: folhaSubir var(--t-media) var(--ease-saida);
}

.folha--aberta .folha__veu {
    animation: folhaVeuEntrar var(--t-media) var(--ease-suave);
}

@media (prefers-reduced-motion: reduce) {
    .folha--aberta .folha__painel,
    .folha--aberta .folha__veu {
        animation: none;
    }
}


@media (min-width: 768px) {
    .folha { align-items: center; }

    .folha__painel {
        width: min(420px, 92vw);
        max-height: 88vh;
        border-radius: var(--raio-cartao);
        padding-bottom: 0;
    }

    .folha__puxador { display: none; }

    .folha__faixa { margin-top: 14px; }
}
