/* ============================================================
   CONVERSOR DE WORD — PREFIXO .cw-
   ============================================================ */

/* CARD */
.cw-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  width: clamp(120px,30vw,148px); aspect-ratio: 1/1.15;
  background: linear-gradient(160deg,#ffffff 70%,#f0fdf4);
  border: 2px solid #b7e4c7; border-radius: 18px; cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  padding: 20px 14px 16px; box-shadow: 0 3px 12px rgba(45,106,79,.10);
  font-family: 'DM Sans', sans-serif; outline: none;
}
.cw-card:hover { transform: translateY(-4px) scale(1.03); box-shadow: 0 16px 32px rgba(45,106,79,.22); border-color: #52B788; }
.cw-card:active { transform: translateY(-1px); }
.cw-circle {
  width: 68px; height: 68px; border-radius: 50%;
  background: linear-gradient(135deg,#d8f3dc,#95d5b2);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(82,183,136,.30); transition: transform .2s ease;
}
.cw-card:hover .cw-circle { transform: scale(1.08); }
.cw-circle svg { width: 58%; height: 58%; }
.cw-label {
  font-size: clamp(11px,1.1vw,13.5px); font-weight: 700;
  color: #1a5c3a; text-align: center; line-height: 1.3;
}

/* BACKDROP */
.cw-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(10,20,40,.45); z-index: 1000;
  align-items: center; justify-content: center; padding: 20px;
}
.cw-backdrop.open { display: flex; animation: cwFade .2s ease; }
@keyframes cwFade  { from{opacity:0} to{opacity:1} }
@keyframes cwPop   { from{opacity:0;transform:scale(.95) translateY(12px)} to{opacity:1;transform:scale(1) translateY(0)} }
@keyframes cwSpin  { from{transform:rotate(0)} to{transform:rotate(360deg)} }
@keyframes cwPulse { 0%,100%{opacity:1} 50%{opacity:.35} }
@keyframes cwSlide { from{opacity:0;transform:translateX(16px)} to{opacity:1;transform:translateX(0)} }

/* MODAL DESKTOP */
.cw-modal {
  background: #fff;
  width: 95vw; max-width: 1270px; height: 90vh;
  border-radius: 16px; display: flex; flex-direction: column;
  overflow: hidden; box-shadow: 0 24px 64px rgba(0,0,0,.22);
  animation: cwPop .22s ease; margin: auto; position: relative;
}

/* MODAL MOBILE */
@media (max-width: 768px) {
  .cw-backdrop { padding: 0; align-items: flex-end; }
  .cw-modal {
    width: 100%; max-width: 100%; height: 85vh;
    margin: 0; border-radius: 20px 20px 0 0;
    position: fixed; bottom: 0; left: 0; right: 0;
    font-size: 11px; padding: 10px 5px;
  }
}

/* TOPBAR */
.cw-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px 12px; flex-shrink: 0;
  border-bottom: 1.5px solid #f1f5f9;
}
.cw-topbar-left { display: flex; align-items: center; gap: 12px; }
.cw-topbar-ico {
  width: 40px; height: 40px; border-radius: 11px;
  background: linear-gradient(135deg,#2D6A4F,#52B788);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(45,106,79,.25);
}
.cw-topbar-ico svg { width: 22px; height: 22px; }
.cw-topbar-titulo { font-size: 18px; font-weight: 700; color: #1e293b; font-family: 'DM Sans',sans-serif; margin-bottom: 1px; }
.cw-topbar-sub { font-size: 12.5px; color: #94a3b8; }
.cw-btn-x {
  width: 32px; height: 32px; border: none; background: none; cursor: pointer;
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  color: #64748b; font-size: 20px; transition: all .15s;
}
.cw-btn-x:hover { background: #fef2f2; color: #dc2626; }

/* LAYOUT PRINCIPAL — 2 colunas */
.cw-layout {
  flex: 1; display: grid; grid-template-columns: 1fr;
  overflow: hidden;
}

/* COLUNA ESQUERDA — HISTÓRICO */
.cw-col-hist {
  display: flex; flex-direction: column;
  border-right: none; overflow: hidden;
}
.cw-hist-header {
  padding: 14px 20px 10px; border-bottom: 1px solid #f1f5f9; flex-shrink: 0;
}
.cw-hist-titulo { font-size: 12.5px; font-weight: 700; color: #2D6A4F; text-transform: uppercase; letter-spacing: .7px; margin-bottom: 10px; display: flex; align-items: center; gap: 7px; }
.cw-hist-titulo span { font-size: 11px; font-weight: 500; color: #94a3b8; text-transform: none; letter-spacing: 0; }

/* BUSCA E FILTROS */
.cw-busca-row { display: flex; gap: 8px; margin-bottom: 10px; }
.cw-busca-inp {
  flex: 1; border: 1.5px solid #e2e8f0; border-radius: 9px; padding: 8px 12px;
  font-size: 13.5px; font-family: 'DM Sans',sans-serif; color: #1e293b;
  background: #fff; outline: none; transition: border-color .2s;
}
.cw-busca-inp:focus { border-color: #2D6A4F; }
.cw-busca-inp::placeholder { color: #cbd5e1; }

.cw-filtros { display: flex; gap: 6px; flex-wrap: wrap; }
.cw-chip {
  padding: 4px 12px; border: 1.5px solid #e2e8f0; border-radius: 20px;
  font-size: 11.5px; font-weight: 600; color: #64748b; cursor: pointer;
  font-family: 'DM Sans',sans-serif; transition: all .15s;
}
.cw-chip:hover { border-color: #52B788; color: #2D6A4F; }
.cw-chip.ativo { border-color: #2D6A4F; background: #f0fdf4; color: #2D6A4F; }

/* LISTA DE PROVAS */
.cw-lista { flex: 1; overflow-y: auto; padding: 10px 16px; display: flex; flex-direction: column; gap: 7px; }
.cw-lista::-webkit-scrollbar { width: 4px; }
.cw-lista::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 4px; }

/* CARD DE PROVA NO HISTÓRICO */
.cw-prova-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1.5px solid #e2e8f0; border-radius: 11px;
  cursor: pointer; transition: all .15s; background: #fff;
}
.cw-prova-item:hover { border-color: #b7e4c7; background: #fafffe; transform: translateX(2px); }
.cw-prova-item.selecionado { border-color: #2D6A4F; background: #f0fdf4; }
.cw-prova-item.convertido { border-color: #b7e4c7; }

.cw-prova-radio {
  width: 20px; height: 20px; border-radius: 50%; border: 2px solid #e2e8f0;
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.cw-prova-item.selecionado .cw-prova-radio { background: #2D6A4F; border-color: #2D6A4F; }
.cw-prova-item.selecionado .cw-prova-radio::after { content: ''; width: 8px; height: 8px; background: #fff; border-radius: 50%; }

.cw-prova-ico {
  width: 38px; height: 38px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
  background: #eff6ff; transition: background .15s;
}
.cw-prova-item.selecionado .cw-prova-ico { background: #dbeafe; }
.cw-prova-item.convertido .cw-prova-ico { background: #fef2f2; }

.cw-prova-info { flex: 1; min-width: 0; }
.cw-prova-titulo { font-size: 13.5px; font-weight: 600; color: #1e293b; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-prova-meta  { font-size: 11.5px; color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-prova-tags  { display: flex; gap: 5px; margin-top: 5px; flex-wrap: wrap; }
.cw-tag { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 20px; }
.cw-tag-word   { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.cw-tag-pdf    { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.cw-tag-modulo { background: #f0fdf4; color: #2D6A4F; border: 1px solid #b7e4c7; }
.cw-tag-data   { background: #f8fafc; color: #64748b; border: 1px solid #e2e8f0; }

/* VAZIO */
.cw-vazio {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  flex: 1; text-align: center; color: #cbd5e1; padding: 40px 20px;
}
.cw-vazio-ico { font-size: 44px; margin-bottom: 12px; }
.cw-vazio-txt { font-size: 14px; font-weight: 600; color: #94a3b8; margin-bottom: 5px; }
.cw-vazio-sub { font-size: 12px; color: #cbd5e1; }

/* COLUNA DIREITA — PAINEL */
.cw-col-painel { display: none; }

.cw-painel-vazio {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 28px; text-align: center; color: #cbd5e1;
}
.cw-painel-vazio-ico { font-size: 48px; margin-bottom: 14px; }
.cw-painel-vazio-txt { font-size: 14px; font-weight: 600; color: #94a3b8; margin-bottom: 6px; }
.cw-painel-vazio-sub { font-size: 13px; color: #cbd5e1; line-height: 1.6; }

/* PAINEL DE DETALHES */
.cw-painel-detalhe {
  display: none; flex: 1; flex-direction: column; overflow: hidden;
  animation: cwSlide .2s ease;
}
.cw-painel-detalhe.visivel { display: flex; }

.cw-detalhe-header {
  padding: 18px 22px 14px; border-bottom: 1px solid #f1f5f9; flex-shrink: 0;
}
.cw-det-titulo { font-size: 16px; font-weight: 700; color: #1e293b; margin-bottom: 4px; line-height: 1.3; }
.cw-det-meta   { font-size: 12.5px; color: #64748b; margin-bottom: 10px; }
.cw-det-tags   { display: flex; gap: 6px; flex-wrap: wrap; }

/* PREVIEW DO CONTEÚDO */
.cw-det-preview-wrap { flex: 1; overflow-y: auto; padding: 16px 22px; }
.cw-det-preview-wrap::-webkit-scrollbar { width: 4px; }
.cw-det-preview-wrap::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 4px; }

.cw-preview-box {
  background: #f8fafc; border: 1.5px solid #e2e8f0; border-radius: 12px;
  padding: 16px; margin-bottom: 14px; font-size: 13.5px; color: #374151; line-height: 1.8;
}
.cw-preview-box h4 { font-size: 12px; font-weight: 700; color: #2D6A4F; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
.cw-preview-linha { border-bottom: 1px solid #e2e8f0; padding: 6px 0; font-size: 13.5px; color: #374151; display: flex; gap: 10px; }
.cw-preview-linha:last-child { border-bottom: none; }
.cw-preview-linha-label { font-size: 11px; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: .3px; min-width: 90px; padding-top: 2px; }

/* CONVERSOR */
.cw-conversor { padding: 14px 22px; border-top: 1.5px solid #f1f5f9; flex-shrink: 0; background: #fff; }
.cw-conv-titulo { font-size: 12px; font-weight: 700; color: #374151; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }

/* PROGRESS BAR DE CONVERSÃO */
.cw-conv-progress {
  display: none; margin-bottom: 14px;
}
.cw-conv-progress.visivel { display: block; }
.cw-conv-prog-label { font-size: 12.5px; color: #2D6A4F; font-weight: 500; margin-bottom: 6px; display: flex; align-items: center; gap: 7px; }
.cw-conv-prog-spinner { width: 14px; height: 14px; border: 2px solid #d8f3dc; border-top-color: #2D6A4F; border-radius: 50%; animation: cwSpin .6s linear infinite; flex-shrink: 0; }
.cw-conv-track { background: #e2e8f0; border-radius: 10px; height: 8px; overflow: hidden; }
.cw-conv-fill  { height: 100%; background: linear-gradient(90deg,#2D6A4F,#52B788); border-radius: 10px; transition: width .4s ease; width: 0%; }

/* STATUS CONVERTIDO */
.cw-conv-status {
  display: none; padding: 10px 14px; border-radius: 9px; margin-bottom: 12px;
  font-size: 13px; font-weight: 500; align-items: center; gap: 8px;
}
.cw-conv-status.visivel { display: flex; }
.cw-status-ok  { background: #f0fdf4; border: 1.5px solid #b7e4c7; color: #2D6A4F; }
.cw-status-err { background: #fef2f2; border: 1.5px solid #fecaca; color: #991b1b; }

/* BOTÕES DE AÇÃO */
.cw-acoes { display: flex; flex-direction: column; gap: 8px; }
.cw-btn-converter {
  width: 100%; padding: 13px; border-radius: 11px; border: none;
  background: linear-gradient(135deg,#2D6A4F,#52B788);
  font-size: 14.5px; font-weight: 700; font-family: 'DM Sans',sans-serif;
  cursor: pointer; color: #fff; transition: all .2s;
  box-shadow: 0 4px 14px rgba(45,106,79,.28);
  display: flex; align-items: center; justify-content: center; gap: 9px;
}
.cw-btn-converter:hover { background: linear-gradient(135deg,#1a5c3a,#2D6A4F); transform: translateY(-2px); box-shadow: 0 8px 22px rgba(45,106,79,.36); }
.cw-btn-converter:disabled { background: #b7e4c7; color: #95d5b2; box-shadow: none; transform: none; cursor: not-allowed; }

.cw-dl-row { display: flex; gap: 8px; }
.cw-btn-dl {
  flex: 1; padding: 10px; border-radius: 10px; font-size: 13px; font-weight: 700;
  font-family: 'DM Sans',sans-serif; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 7px; transition: all .15s;
}
.cw-btn-dl.word { background: #fff; color: #1d4ed8; border: 1.5px solid #bfdbfe; }
.cw-btn-dl.word:hover { background: #eff6ff; transform: translateY(-1px); }
.cw-btn-dl.pdf  { background: #fff; color: #991b1b; border: 1.5px solid #fecaca; }
.cw-btn-dl.pdf:hover  { background: #fef2f2; transform: translateY(-1px); }
.cw-btn-dl:disabled { background: #f8fafc; color: #cbd5e1; border-color: #f1f5f9; cursor: not-allowed; transform: none; }

/* FOOTER */
.cw-footer {
  border-top: 1px solid #f1f5f9; padding: 12px 20px;
  display: flex; align-items: center; gap: 12px; flex-shrink: 0; background: #fff;
}
.cw-footer-txt { font-size: 13px; color: #94a3b8; flex: 1; }
.cw-footer-converter {
  display: none;
  width: 100%;
  margin-left: 0;
}
.cw-btn-fechar-footer {
  padding: 9px 22px; border-radius: 10px; border: 1.5px solid #e2e8f0;
  background: #fff; font-size: 14px; font-weight: 500; font-family: 'DM Sans',sans-serif;
  cursor: pointer; color: #64748b; transition: all .15s;
}
.cw-btn-fechar-footer:hover { background: #f8fafc; }

/* MOBILE */
@media (max-width: 768px) {
  .cw-layout { grid-template-columns: 1fr; }
  .cw-col-painel { display: none; }
  .cw-col-hist { border-right: none; }
  .cw-footer {
    padding: 10px 12px;
  }
  .cw-footer-txt {
    display: none;
  }
  .cw-footer-converter {
    width: 100%;
  }
}

.cw-footer-txt {
  display: none;
}

#overlayConversorWord.cw-backdrop{z-index:10050;}
