/* ============================================================
   Recibo Online (DecoderX)
   Complementa o decoderx.css e o portal.css (cores, cabeçalho, .btn-dx).
   ============================================================ */

.rco-pagina { display: flex; flex-direction: column; min-height: 100vh; }
.rco-pagina main { flex: 1; }

.site-header .container { display: flex; align-items: center; justify-content: space-between; }
.rco-nav-link { color: #cbd5e1; text-decoration: none; font-weight: 600; font-size: .95rem; }
.rco-nav-link:hover { color: var(--secondary); }

/* ── Topo ─────────────────────────────────────────────────── */
.rco-hero { padding: 2.6rem 0 2.3rem; }
.rco-hero h1 { font-size: 2.1rem; }
.rco-hero-sub { max-width: 720px; margin: .6rem auto 0; font-size: 1.05rem; color: #cbd5e1 !important; }
.rco-hero.hero-compacto { padding: 1.6rem 0 1.5rem; }
.rco-hero.hero-compacto h1 { margin-bottom: .35rem; }
.rco-migalha { font-size: .82rem; color: #8aa5bf; margin-bottom: .4rem; }
.rco-migalha a { color: #cbd5e1; }
.rco-migalha span { margin: 0 .3rem; }

.rco-conteudo { padding: 2.2rem 0 3rem; }
.card-rco {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(13,31,51,.08);
    padding: 1.8rem;
}

/* ── Escolha do modelo ─────────────────────────────────── */
.rco-titulo-modelos { text-align: center; font-size: 1.35rem; font-weight: 700; color: var(--primary); margin-bottom: 1.4rem; }
.rco-modelo {
    display: flex; flex-direction: column; height: 100%;
    text-decoration: none; color: inherit;
    border: 2px solid transparent;
    transition: border-color .15s, transform .15s;
}
.rco-modelo:hover { border-color: var(--secondary); transform: translateY(-2px); color: inherit; }
.rco-modelo h3 { font-size: 1.15rem; font-weight: 700; color: var(--primary); margin: 1.1rem 0 .4rem; }
.rco-modelo p { color: var(--text-muted); font-size: .93rem; flex: 1; }

/* Miniatura desenhada em CSS, sem imagem para carregar */
.rco-modelo-miniatura {
    border: 1px solid #d7dee7; border-radius: 8px; background: #fbfcfd;
    padding: 1rem 1.1rem; height: 150px; display: flex; flex-direction: column; gap: .45rem;
}
.mini-topo { display: flex; align-items: center; gap: .6rem; margin-bottom: .3rem; }
.mini-titulo { font-weight: 800; letter-spacing: .12em; color: var(--primary); font-size: .85rem; }
.mini-valor { margin-left: auto; border: 1.5px solid var(--primary); border-radius: 4px; padding: .1rem .45rem; font-size: .75rem; font-weight: 700; color: var(--primary); }
.mini-logo { background: var(--secondary); color: #fff; font-size: .62rem; font-weight: 800; border-radius: 4px; padding: .25rem .45rem; }
.mini-linha { height: 7px; background: #e2e8f0; border-radius: 4px; }
.mini-linha.curta { width: 60%; }
.mini-assinatura { margin: auto 0 0 auto; width: 45%; border-top: 1.5px solid #94a3b8; height: 10px; }

/* ── Texto de conteúdo ─────────────────────────────────── */
.rco-texto h2 { font-size: 1.3rem; font-weight: 700; color: var(--primary); margin: 1.8rem 0 .7rem; }
.rco-texto h2:first-child { margin-top: 0; }
.rco-texto h3 { font-size: 1.05rem; font-weight: 700; color: var(--primary); margin: 1.3rem 0 .5rem; }
.rco-texto p, .rco-texto li { line-height: 1.7; }
.rco-texto a { color: var(--primary); font-weight: 600; }
.rco-faq details { border-bottom: 1px solid #e2e8f0; padding: .8rem 0; }
.rco-faq summary { font-weight: 600; cursor: pointer; color: var(--primary); }
.rco-faq details p { margin: .6rem 0 0; }

/* ── Formulário ────────────────────────────────────────── */
.rco-bloco { border: 0; margin: 0 0 1.6rem; padding: 0; }
.rco-bloco legend {
    font-size: 1rem; font-weight: 700; color: var(--primary);
    border-bottom: 2px solid #eef2f6; padding-bottom: .45rem; margin-bottom: 1rem; width: 100%;
}
.rco-form .form-label { font-weight: 600; font-size: .9rem; margin-bottom: .3rem; }
.opcional { font-weight: 400; color: var(--text-muted); font-size: .82rem; }
.rco-prep { display: flex; gap: .35rem; margin-bottom: .5rem; }
.rco-prep .btn { min-width: 2.8rem; }
.rco-formas { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .4rem 1rem; }
#valor-extenso, #referente-previa { color: #475569; font-style: italic; }
.rco-acoes { display: flex; justify-content: flex-end; gap: .75rem; border-top: 1px solid #eef2f6; padding-top: 1.3rem; }
.rco-aviso-privacidade { font-size: .78rem; color: var(--text-muted); text-align: right; margin: .8rem 0 0; }
.rco-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.rco-logo-area { display: flex; gap: 1.2rem; align-items: flex-start; }
.rco-logo-preview {
    width: 200px; height: 90px; flex-shrink: 0;
    border: 2px dashed #cbd5e1; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    background: repeating-conic-gradient(#f1f5f9 0% 25%, #fff 0% 50%) 50% / 16px 16px;
    color: var(--text-muted); font-size: .8rem; text-align: center; padding: .4rem;
}
.rco-logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }

@media (max-width: 575.98px) {
    .card-rco { padding: 1.2rem; }
    .rco-hero h1 { font-size: 1.6rem; }
    .rco-logo-area { flex-direction: column; }
    .rco-logo-preview { width: 100%; }
    .rco-acoes { flex-direction: column-reverse; }
    .rco-acoes .btn { width: 100%; }
    .rco-aviso-privacidade { text-align: left; }
}

/* ── Página de impressão ──────────────────────────────── */
.rco-impressao { background: #e2e8f0; }
.rco-barra { background: var(--bg-dark); padding: .9rem 0; }
.rco-barra .container { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.rco-barra-dica { color: #8aa5bf; font-size: .8rem; margin: 0; flex-basis: 100%; }
.rco-anuncio:empty { display: none; }
.rco-anuncio { max-width: 210mm; margin: 1rem auto; text-align: center; }

/* A folha na tela imita um A4 */
.rco-folha {
    background: #fff;
    width: 210mm; max-width: calc(100% - 24px);
    min-height: 140mm;
    margin: 1.5rem auto 2.5rem;
    padding: 12mm;
    box-shadow: 0 6px 30px rgba(0,0,0,.18);
    color: #111;
    font-family: Georgia, 'Times New Roman', serif;
}

.rco-recibo {
    border: 1.5px solid #1f2937;
    border-radius: 3mm;
    padding: 7mm 8mm 6mm;
    font-size: 11.5pt;
    line-height: 1.6;
    page-break-inside: avoid;
    break-inside: avoid;
}
.rco-recibo-topo {
    display: flex; align-items: center; gap: 6mm;
    border-bottom: 1px solid #9ca3af; padding-bottom: 4mm; margin-bottom: 5mm;
}
.rco-recibo-logo { max-width: 60mm; max-height: 20mm; width: auto; height: auto; object-fit: contain; }
.rco-recibo-titulo h2 {
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 20pt; font-weight: 800; letter-spacing: .18em; text-transform: uppercase;
    margin: 0; color: #111;
}
.rco-recibo-numero, .rco-recibo-via { font-family: 'Segoe UI', Arial, sans-serif; font-size: 9.5pt; color: #374151; }
.rco-recibo-valor {
    margin-left: auto;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 15pt; font-weight: 700;
    border: 2px solid #111; border-radius: 2mm;
    padding: 2mm 5mm; white-space: nowrap;
}
.rco-recibo-texto { text-align: justify; margin: 0 0 3mm; }
.rco-recibo-local { text-align: right; margin: 6mm 0 12mm; }
.rco-recibo-assinatura { width: 95mm; max-width: 100%; margin-left: auto; text-align: center; }
.rco-linha { border-top: 1px solid #111; margin-bottom: 1.5mm; }
.rco-assinatura-nome { font-weight: 700; }
.rco-assinatura-doc { font-size: 9.5pt; color: #374151; }

.rco-corte {
    border-top: 1.5px dashed #6b7280;
    margin: 9mm -4mm;
    position: relative; text-align: center;
}
.rco-corte span {
    position: relative; top: -.75em;
    background: #fff; padding: 0 3mm;
    font-family: 'Segoe UI', Arial, sans-serif; font-size: 8pt; color: #6b7280;
}

@media (max-width: 700px) {
    .rco-folha { padding: 5mm; }
    .rco-recibo { padding: 5mm; font-size: 10.5pt; }
    .rco-recibo-topo { flex-wrap: wrap; }
    .rco-recibo-valor { margin-left: 0; }
}

@page { size: A4; margin: 12mm; }

@media print {
    .no-print, .adsbygoogle, ins.adsbygoogle, iframe { display: none !important; }
    html, body, .rco-impressao { background: #fff !important; }
    .rco-folha {
        width: auto; max-width: none; min-height: 0;
        margin: 0; padding: 0; box-shadow: none;
    }
    .rco-recibo { font-size: 11.5pt; }
    .rco-recibo-topo { flex-wrap: nowrap; }
    .rco-recibo-valor { margin-left: auto; }
}
