/* ================================================================
   Documentos úteis — materiais para enviar ao cliente e lâminas
   técnicas, com o visual de Reforma Tributária e Acompanhamentos.
   ================================================================ */

.dc-wrap,
.dc-toast,
.dc-viewer {
  --dc-gold: var(--accent-strong);
  --dc-warn: #a8701a;
  --dc-bad: #b4442f;
  --dc-ok: #1f8a5b;
  --dc-r: 12px;
  --dc-ease: cubic-bezier(.2, .8, .3, 1);
}
[data-theme="dark"] .dc-wrap,
[data-theme="dark"] .dc-toast,
[data-theme="dark"] .dc-viewer {
  --dc-warn: #e3b460;
  --dc-bad: #f08a74;
  --dc-ok: #5fd49a;
}
.dc-wrap { min-width: 0; }
.dc-page { width: 100%; max-width: 1440px; margin: 0 auto; padding: 28px 36px 64px; }

/* ── Cabeçalho ─────────────────────────────────────────────── */
.dc-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
}
.dc-eyebrow::before { content: ""; width: 18px; height: 1px; background: var(--gold-line); }
.dc-head { max-width: 760px; margin-bottom: 30px; }
.dc-title { margin: 10px 0 8px; font-family: var(--font-editorial); font-size: 2rem; font-weight: 300; line-height: 1.15; letter-spacing: -.01em; color: var(--ink); }
.dc-lead { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.6; }

/* ── Seções ────────────────────────────────────────────────── */
.dc-section { margin-bottom: 40px; }
.dc-section-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 16px; }
.dc-section-head h3 { display: flex; align-items: center; gap: 9px; margin: 0; font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; color: var(--ink); }
.dc-section-head h3 i { color: var(--dc-gold); }
.dc-section-head p { margin: 0; color: var(--muted); font-size: .82rem; }

/* ── Para enviar ao cliente ────────────────────────────────── */
.dc-feature-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.dc-feature {
  position: relative;
  display: flex;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--dc-r);
  background:
    radial-gradient(120% 140% at 0% 0%, oklch(from var(--accent) l c h / .10), transparent 55%),
    var(--surface);
  overflow: hidden;
}
.dc-feature::before { content: ""; position: absolute; inset: 0 0 auto; height: 2px; background: linear-gradient(90deg, var(--dc-gold), transparent 70%); }
.dc-feature-ico {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: var(--dc-r);
  background: oklch(from var(--accent) l c h / .14);
  color: var(--dc-gold);
  font-size: 1.3rem;
}
.dc-feature-body { min-width: 0; display: flex; flex-direction: column; }
.dc-feature h4 { margin: 4px 0 6px; font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; color: var(--ink); }
.dc-feature p { margin: 0 0 16px; color: var(--muted); font-size: .84rem; line-height: 1.55; }
.dc-feature .dc-actions { margin-top: auto; }

.dc-meta { font-size: .72rem; color: var(--muted); letter-spacing: .02em; }

/* ── Botões ────────────────────────────────────────────────── */
.dc-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dc-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--ink);
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .15s var(--dc-ease);
}
.dc-btn:hover { border-color: var(--dc-gold); }
.dc-btn:active { transform: scale(.97); }
.dc-btn.is-primary { background: var(--dc-gold); border-color: var(--dc-gold); color: var(--on-accent, #1b1b1b); }
.dc-btn.is-primary:hover { filter: brightness(1.06); }
.dc-btn.is-ghost { background: transparent; }
.dc-btn[aria-busy="true"] { opacity: .6; cursor: progress; }
.dc-btn[hidden] { display: none; }

/* ── Barra de busca e filtros ──────────────────────────────── */
.dc-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 18px; }
.dc-search {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 320px;
  max-width: 520px;
  height: 40px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-sunken);
  color: var(--muted);
}
.dc-search:focus-within { border-color: var(--dc-gold); }
.dc-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: .84rem; }
.dc-search input::placeholder { color: var(--muted); }
.dc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dc-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 600;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.dc-chip em { font-style: normal; font-weight: 500; opacity: .7; }
.dc-chip:hover { color: var(--ink); }
.dc-chip.is-active { color: var(--ink); border-color: var(--dc-gold); background: oklch(from var(--accent) l c h / .12); }

/* ── Lâminas ───────────────────────────────────────────────── */
.dc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.dc-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--dc-r);
  background: var(--surface);
  overflow: hidden;
  transition: border-color .2s, transform .2s var(--dc-ease), box-shadow .2s;
}
.dc-card:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow); }
.dc-card[hidden] { display: none; }
.dc-cover {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 0;
  background: var(--bg-sunken);
  overflow: hidden;
  cursor: zoom-in;
}
.dc-cover img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform .4s var(--dc-ease); }
.dc-card:hover .dc-cover img { transform: scale(1.04); }
.dc-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, .55)); }
.dc-cover-hint {
  position: absolute;
  right: 12px;
  bottom: 10px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  font-size: .74rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .2s, transform .2s var(--dc-ease);
}
.dc-card:hover .dc-cover-hint,
.dc-cover:focus-visible .dc-cover-hint { opacity: 1; transform: none; }
.dc-card-body { display: flex; flex-direction: column; flex: 1; padding: 16px 18px 18px; }
.dc-card h4 { margin: 8px 0 6px; font-family: var(--font-display); font-size: .98rem; font-weight: 600; line-height: 1.3; color: var(--ink); }
.dc-card-body > p { margin: 0 0 10px; color: var(--muted); font-size: .8rem; line-height: 1.55; }
.dc-card-body > .dc-publico { display: flex; gap: 8px; margin-bottom: 14px; color: var(--ink-2, var(--ink)); font-size: .76rem; line-height: 1.45; }
.dc-publico i { margin-top: 1px; color: var(--dc-gold); }
.dc-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--hairline); }

.dc-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.dc-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: oklch(from var(--accent) l c h / .12);
  color: var(--dc-gold);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .02em;
}
.dc-tag.is-warn { background: color-mix(in srgb, var(--dc-warn) 16%, transparent); color: var(--dc-warn); }
.dc-tag.is-bad { background: color-mix(in srgb, var(--dc-bad) 16%, transparent); color: var(--dc-bad); }
.dc-card.is-interno { border-style: dashed; }

.dc-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 48px 16px; color: var(--muted); text-align: center; }
.dc-empty i { font-size: 1.6rem; }
.dc-empty p { margin: 0; font-size: .86rem; }
.dc-empty[hidden] { display: none; }

.dc-note { display: flex; gap: 8px; max-width: 900px; margin: 0; color: var(--muted); font-size: .76rem; line-height: 1.55; }

/* ── Visualizador ──────────────────────────────────────────── */
.dc-viewer {
  position: fixed;
  inset: 0;
  z-index: 1060;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8, 12, 11, .72);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .18s;
}
.dc-viewer[hidden] { display: none; }
.dc-viewer.is-open { opacity: 1; }
.dc-viewer-box {
  display: flex;
  flex-direction: column;
  width: min(1100px, 100%);
  height: min(92vh, 100%);
  border: 1px solid var(--border-strong);
  border-radius: var(--dc-r);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: translateY(8px) scale(.99);
  transition: transform .2s var(--dc-ease);
}
.dc-viewer.is-open .dc-viewer-box { transform: none; }
.dc-viewer-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 20px; border-bottom: 1px solid var(--hairline); background: var(--surface-2); }
.dc-viewer-head h3 { flex: 1; min-width: 0; margin: 0; overflow: hidden; font-family: var(--font-display); font-size: .95rem; font-weight: 600; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; }
.dc-viewer-tools { display: flex; align-items: center; gap: 8px; }
.dc-viewer-x { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.dc-viewer-x:hover { background: var(--bg-sunken); color: var(--ink); }
.dc-viewer-body { position: relative; flex: 1; min-height: 0; background: var(--bg-sunken); }
.dc-frame { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.dc-loading { display: flex; align-items: center; justify-content: center; gap: 10px; height: 100%; color: var(--muted); font-size: .86rem; }
.dc-loading.is-error { color: var(--dc-bad); }
.dc-spin { width: 18px; height: 18px; border: 2px solid var(--border-strong); border-top-color: var(--dc-gold); border-radius: 50%; animation: dcSpin .8s linear infinite; }
@keyframes dcSpin { to { transform: rotate(360deg); } }
body.dc-lock { overflow: hidden; }

/* ── Aviso ─────────────────────────────────────────────────── */
.dc-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 1080;
  max-width: calc(100vw - 32px);
  padding: 11px 18px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--ink);
  font-size: .82rem;
  box-shadow: var(--shadow-lg);
  transform: translateX(-50%);
}
.dc-toast.is-error { border-color: var(--dc-bad); color: var(--dc-bad); }
.dc-toast[hidden] { display: none; }

/* ── Responsivo ────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .dc-feature-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .dc-page { padding: 20px 16px 96px; }
  .dc-title { font-size: 1.5rem; }
  .dc-feature { flex-direction: column; gap: 12px; padding: 18px; }
  .dc-grid { grid-template-columns: 1fr; }
  .dc-search { max-width: none; }
  .dc-viewer { padding: 0; }
  .dc-viewer-box { width: 100%; height: 100%; border-radius: 0; }
  .dc-viewer-tools .dc-btn span, .dc-viewer-tools .dc-btn { font-size: 0; gap: 0; padding: 0 10px; }
  .dc-viewer-tools .dc-btn i { font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .dc-card, .dc-cover img, .dc-viewer, .dc-viewer-box { transition: none; }
}
