/* ════════════════════════════════════════════════════════════════
   Dadge CV Pro — estilos dos documentos (pré-visualização, PDF e impressão)
   Regras: sem media queries, sem clip-path/filter/color-mix (compatível com a captura em PDF).
   ════════════════════════════════════════════════════════════════ */
.doc { --acc: #1dbf73; --acc-soft: #e6f8ef; --acc-dark: #148651; position: relative; background: #fff; color: #1f2937; font-family: 'Inter', Arial, sans-serif;
  text-align: left; line-height: 1.45; -webkit-font-smoothing: antialiased; font-size: 12px; }
.doc *, .doc *::before, .doc *::after { box-sizing: border-box; }
.doc h1, .doc h2, .doc h3, .doc h4, .doc p, .doc ul, .doc ol { margin: 0; }
.doc img { max-width: none; }
.doc i[class*="fa-"] { font-style: normal; }
.doc-a4 { width: 210mm; min-height: 297mm; overflow: hidden; }
.doc .muted { color: #64748b; }
/* ═════════ CARTAS ═════════ */
.letter { display: flex; flex-direction: column; font-size: 12px; line-height: 1.65; color: #1f2937; }
.lt-pad { flex: 1; padding: 46px 58px 40px; }
.lt-kind { font-size: 10px; text-transform: uppercase; letter-spacing: 3px; font-weight: 800; color: var(--acc); margin-bottom: 16px; }
.lt-date { font-size: 11.5px; color: #4b5563; }
.lt-recipient { margin-bottom: 22px; }
.lt-recipient span { display: block; font-size: 11.5px; color: #4b5563; }
.lt-recipient strong { display: block; font-size: 13px; color: #111827; }
.lt-subject { margin: 4px 0 22px; font-size: 13px; color: #111827; font-weight: 600; }
.lt-subject strong { color: var(--acc-dark); }
.lt-body { font-size: 12px; color: #374151; overflow-wrap: break-word; }
.lt-body p, .lt-body div { margin: 0 0 12px; text-align: justify; }
.lt-body ul, .lt-body ol { margin: 4px 0 12px; padding-left: 22px; }
.lt-body li { margin-bottom: 4px; }
.lt-body b, .lt-body strong { font-weight: 700; color: #111; }
.lt-body i, .lt-body em { font-style: italic; }
.lt-body u { text-decoration: underline; }
.lt-body h3, .lt-body h4 { margin: 10px 0 6px; font-size: 13px; }
.lt-body blockquote { margin: 0 0 12px; padding-left: 12px; border-left: 3px solid var(--acc-soft); color: #4b5563; }
.lt-sign { margin-top: 30px; }
.lt-sign img { display: block; max-height: 62px; max-width: 210px; margin-bottom: 2px; }
.lt-line { width: 190px; height: 1px; background: #9ca3af; margin-bottom: 7px; }
.lt-sign strong { display: block; font-size: 13px; color: #111827; }
.lt-sign span { display: block; font-size: 11px; color: #6b7280; }
/* ═════════ CARTÕES DE VISITA ═════════ */
.doc-cards { display: flex; flex-direction: column; gap: 22px; background: transparent; }
.face-wrap { display: flex; flex-direction: column; gap: 8px; }
.face-label { align-self: flex-start; font-size: 11px; font-weight: 600; color: #475569; background: rgba(255,255,255,.85); padding: 4px 10px; border-radius: 999px; }
.face-label i { color: #1dbf73; margin-right: 4px; }
.bc-face { position: relative; overflow: hidden; width: var(--w); height: var(--h); background: #fff; color: #1f2937; border-radius: 8px; box-shadow: 0 12px 34px rgba(15,23,42,.2), 0 2px 6px rgba(15,23,42,.1); }
.export-host .bc-face, .export-host .ps-face { border-radius: 0; box-shadow: none; }
.bc-face > i { position: absolute; display: block; }
.bc-logo { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; overflow: hidden; background: var(--c1); color: #fff; font-family: 'Montserrat', sans-serif; font-weight: 800; font-size: 11px; flex-shrink: 0; }
.bc-logo.img { background: transparent; }
.bc-logo img { width: 100%; height: 100%; object-fit: contain; }
.bc-logo.xl { width: 56px; height: 56px; border-radius: 13px; font-size: 20px; }
.bc-contacts { list-style: none; padding: 0; }
.bc-contacts li { display: flex; align-items: center; gap: 6px; font-size: 7.3px; line-height: 11px; color: #374151; margin-bottom: 2px; min-width: 0; }
.bc-contacts li:last-child { margin-bottom: 0; }
.bc-contacts li span { overflow-wrap: anywhere; }
.bc-contacts i { width: 10px; text-align: center; font-size: 6.5px; line-height: 11px; color: var(--c2); flex-shrink: 0; }
.bc-qr { background: #fff; padding: 2px; border-radius: 3px; }
.bc-qr img { display: block; width: 100%; height: 100%; }
.bc-qr.corner { position: absolute; right: 9px; bottom: 9px; width: 40px; height: 40px; z-index: 2; }
.bc-back-center { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 0 20px; }
.bc-back-center h3 { font-family: 'Montserrat', sans-serif; font-size: 12px; font-weight: 800; letter-spacing: 1.6px; text-transform: uppercase; }
.bc-back-center p { font-size: 7.6px; font-style: italic; opacity: .85; }
.bc-back-foot { position: absolute; z-index: 1; left: 0; right: 0; bottom: 10px; text-align: center; font-size: 6.8px; letter-spacing: 1px; }
.bc-rule { display: block; width: 26px; height: 2px; background: var(--c1); margin: 9px 0; }
/* ═════════ PASSES ═════════
   Grelha comum: margem de segurança de 20px, colunas flexíveis, código sempre por baixo do QR. */
.doc-pass { background: transparent; }
.ps-face { position: relative; overflow: hidden; width: var(--w); height: var(--h); background: #fff; color: #0f172a; border-radius: 12px; box-shadow: 0 14px 40px rgba(15,23,42,.22), 0 2px 6px rgba(15,23,42,.1); }
.ps-o-v .ps-face { display: flex; flex-direction: column; }
.ps-logo { width: 36px; height: 36px; border-radius: 9px; overflow: hidden; display: grid; place-items: center; background: #fff; flex-shrink: 0; }
.ps-logo img { width: 100%; height: 100%; object-fit: contain; }
.ps-logo.mono { background: var(--c1); color: #fff; font-family: 'Montserrat', sans-serif; font-weight: 800; font-size: 12px; }
.ps-photo { width: 92px; height: 92px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--c1-soft); color: var(--c1); font-family: 'Montserrat', sans-serif; font-size: 30px; font-weight: 800; border: 4px solid #fff; box-shadow: 0 6px 18px rgba(15,23,42,.15); flex-shrink: 0; }
.ps-photo img { width: 100%; height: 100%; object-fit: cover; }
.ps-qr { background: #fff; padding: 3px; border-radius: 6px; flex-shrink: 0; }
.ps-qr img { display: block; width: 100%; height: 100%; }
.ps-code { display: flex; flex-direction: column; align-items: center; gap: 5px; flex-shrink: 0; }
.ps-code small { display: block; font-family: 'Space Grotesk', monospace; font-size: 7.5px; line-height: 1; letter-spacing: 1px; text-align: center; white-space: nowrap; }
.ps-kv span { display: block; font-size: 7.5px; line-height: 1.2; text-transform: uppercase; letter-spacing: 1px; color: #64748b; font-weight: 700; margin-bottom: 2px; }
.ps-kv strong { display: block; font-size: 12px; line-height: 1.2; }
.ps-role { font-size: 11.5px; color: var(--c1-dark); font-weight: 700; margin-top: 5px; }
.ps-org { font-size: 10.5px; color: #64748b; margin-top: 2px; }
.ps-meta { display: flex; flex-direction: column; gap: 5px; font-size: 9.5px; line-height: 1.3; color: #475569; }
.ps-meta i { color: var(--c1); width: 12px; margin-right: 4px; text-align: center; }
.ps-slot { position: absolute; z-index: 3; top: 12px; left: 50%; width: 58px; height: 10px; margin-left: -29px; border-radius: 999px; background: #e2e8f0; box-shadow: inset 0 1px 2px rgba(0,0,0,.25); }
.ps-cat { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 0 20px; color: #fff; }
.ps-perf { position: relative; width: 0; border-left: 2px dashed #cbd5e1; flex-shrink: 0; }
.ps-perf i { position: absolute; left: -12px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: inset 0 1px 3px rgba(0,0,0,.15); }
.ps-perf i:first-child { top: -11px; }
.ps-perf i:last-child { bottom: -11px; }
/* ═════════ CÓDIGO QR ═════════ */
.doc-qr { background: transparent; width: 360px; }
.qr-stage { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 360px; }
.qr-type { font-size: 12px; font-weight: 700; color: #475569; background: #fff; padding: 6px 14px; border-radius: 999px; box-shadow: 0 2px 8px rgba(15,23,42,.08); }
.qr-type i { color: #1dbf73; margin-right: 4px; }
.qr-art { width: 300px; border-radius: 18px; overflow: hidden; background: #fff; box-shadow: 0 22px 50px rgba(15,23,42,.16); }
.qr-art svg { display: block; width: 100%; height: auto; }
.qr-err { min-height: 300px; display: grid; place-items: center; align-content: center; gap: 10px; padding: 30px; text-align: center; color: #64748b; font-size: 13px; }
.qr-err i { font-size: 28px; color: #94a3b8; }
.qr-warn { width: 100%; font-size: 12px; color: #92400e; background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; padding: 8px 12px; line-height: 1.45; }
.qr-warn i { margin-right: 6px; }
.qr-quick { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.qr-payload { width: 100%; font-size: 12px; }
.qr-payload summary { cursor: pointer; text-align: center; color: #475569; font-weight: 600; padding: 4px; }
.qr-payload pre { white-space: pre-wrap; word-break: break-all; background: #fff; padding: 10px 12px; border-radius: 10px; border: 1px solid #e2e8f0; max-height: 160px; overflow: auto; font-size: 11px; margin: 8px 0 0; }
.qr-tip { font-size: 12px; color: #64748b; text-align: center; }
.qr-tip i { color: #1dbf73; margin-right: 4px; }
/* Página QR: telemóvel simulado + código */
.doc-qr-page { width: 690px; }
.qrp { display: flex; align-items: flex-start; gap: 30px; }
.phone { position: relative; flex-shrink: 0; width: 300px; height: 610px; border-radius: 44px; padding: 12px; background: #0f172a; box-shadow: 0 30px 60px rgba(15,23,42,.3), inset 0 0 0 2px #334155; }
.phone-notch { position: absolute; z-index: 3; top: 12px; left: 50%; width: 110px; height: 24px; margin-left: -55px; border-radius: 0 0 16px 16px; background: #0f172a; }
.phone-screen { height: 100%; border-radius: 33px; overflow-x: hidden; overflow-y: auto; background: #f4f6f9; scrollbar-width: none; }
.phone-screen::-webkit-scrollbar { display: none; }
.phone-screen .lp { font-size: 14px; min-height: 100%; }
.phone-screen .lp-hero { padding-top: 40px; }
.phone-screen .lp-hero.has-cover { padding-top: 0; }
.doc-qr-page .qr-stage { width: 360px; padding-top: 20px; }
.qr-art { position: relative; }
.qr-art.is-draft svg { opacity: .22; }
.qr-draft { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; padding: 20px; color: #0f172a; }
.qr-draft i { font-size: 26px; color: #1dbf73; margin-bottom: 4px; }
.qr-draft strong { font-size: 16px; }
.qr-draft span { font-size: 13px; color: #475569; }
.qr-pub-btn { width: 100%; }
.qr-live { width: 100%; text-align: center; font-size: 12px; background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 12px; padding: 10px; }
.qr-live span { display: block; color: #12834f; font-weight: 700; margin-bottom: 2px; }
.qr-live span i { font-size: 8px; vertical-align: middle; margin-right: 4px; }
.qr-live a { color: #0f172a; font-weight: 600; word-break: break-all; text-decoration: none; }
/* ═════════ Logótipos carregados: proporção natural, nunca deformados ═════════ */
.bc-logo.img { width: auto; max-width: 96px; background: none; border: 0; padding: 0; border-radius: 0; overflow: visible; }
.bc-logo.img img { width: auto; height: 100%; max-width: 100%; object-fit: contain; }
.bc-logo.xl.img { height: 56px; max-width: 160px; }
.ps-logo.img { width: auto; max-width: 120px; padding: 4px 7px; background: #fff; border-radius: 8px; box-sizing: content-box; height: 30px; }
.ps-logo.img img { width: auto; height: 100%; max-width: 100%; object-fit: contain; }
.doc-pass .face-wrap { display: flex; flex-direction: column; gap: 8px; }
.tmpl-thumb .face-label, .gal-thumb .face-label { display: none; }
.qr-draft .btn { margin-top: 8px; pointer-events: auto; }
