/* DOcStream - paleta inspirada no BM Liga + laranja Engeman */

:root {
  --bg: #09090b;
  --bg-card: #0c0c0e;
  --bg-muted: #18181b;
  --border: #27272a;
  --accent: #ec6020;           /* laranja Engeman (do logo) */
  --accent-hover: #d5531b;
  --success: #22c55e;
  --warning: #eab308;
  --danger: #ef4444;
  --text: #fafafa;
  --text-muted: #a1a1aa;
  --text-dim: #71717a;

  color-scheme: dark;
}

html:not(.dark) {
  --bg: #fafafa;
  --bg-card: #ffffff;
  --bg-muted: #f4f4f5;
  --border: #e4e4e7;
  --text: #09090b;
  --text-muted: #52525b;
  --text-dim: #a1a1aa;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  user-select: none;           /* chrome da app nao precisa seleção */
}

/* Onde precisa selecionar/copiar */
textarea, input,
.section-body,
.review-title, .review-meta,
.recent-code, .recent-titulo,
.preview-page,
.preview-page * {
  user-select: text;
}

/* Cor da seleção no padrão laranja Engeman */
::selection {
  background: rgba(236, 96, 32, 0.35);
  color: var(--text);
}
::-moz-selection {
  background: rgba(236, 96, 32, 0.35);
  color: var(--text);
}

/* Landing: tela única sem scroll */
body.landing-page {
  height: 100vh;
  overflow: hidden;
}

body.landing-page main {
  justify-content: center;
  padding: 24px 40px;
  overflow: hidden;
}

body.landing-page .recent-list {
  max-height: 160px;
  overflow-y: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  font-weight: 400;
  cursor: pointer;
  border: none;
}

/* ============ HEADER ============ */

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  height: 36px;
  width: auto;
  opacity: 0.95;
}

.app-title {
  font-size: 12px;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-sep { color: var(--text-dim); opacity: 0.4; }

.header-user {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.header-logout {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.15s;
}

.header-logout:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.08);
}

/* ============ MAIN LAYOUT ============ */

main {
  flex: 1;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 48px 40px 40px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.app-subtitle {
  font-size: 14px;
  font-weight: 300;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: 0 0 32px;
}

.landing-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.landing-top .app-subtitle { margin: 0; }

.quota-pill {
  font-size: 10px;
  padding: 6px 12px;
  border-radius: 12px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.quota-pill.quota-full {
  color: var(--warning);
  border-color: rgba(234, 179, 8, 0.3);
  background: rgba(234, 179, 8, 0.08);
}

.section-label {
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin: 48px 0 16px;
  font-weight: 500;
}

/* ============ DROPZONE ============ */

.dropzone {
  display: block;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: 10px;
  text-align: center;
  transition: all 0.2s ease;
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  padding: 0;                /* padding vai pro label */
  overflow: hidden;
}

.dropzone > label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 28px;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
}

.dropzone:hover,
.dropzone.drag-over {
  border-color: var(--accent);
  background: var(--bg-muted);
}

.dropzone.drag-over {
  border-style: solid;
}

.dropzone-icon-svg {
  width: 36px;
  height: 36px;
  color: var(--accent);
  margin: 0 auto 12px;
  display: block;
}

.dropzone-title {
  font-size: 16px;
  font-weight: 400;
  margin: 0 0 6px;
}

.dropzone-hint {
  font-size: 12px;
  color: var(--text-dim);
  margin: 0;
}

/* ============ WORKSPACE / STATUS ============ */

.workspace-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 32px;
  margin-top: 24px;
}

.status-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  color: var(--text-dim);
  transition: color 0.3s;
}

.status-item.active {
  color: var(--text);
}

.status-item.done {
  color: var(--text-muted);
}

.status-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--text-dim);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--bg);
}

.status-item.active .status-icon {
  border-color: var(--accent);
  background: transparent;
  position: relative;
}

.status-item.active .status-icon::after {
  content: "";
  position: absolute;
  inset: -2px;
  border: 1.5px solid var(--accent);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.status-item.done .status-icon {
  background: var(--success);
  border-color: var(--success);
  color: var(--bg);
}

.status-item.done .status-icon::after {
  content: "✓";
}

.status-item.error .status-icon {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--bg);
}

.status-item.error .status-icon::after {
  content: "!";
}

/* ============ MOBILE / RESPONSIVE ============ */

@media (max-width: 768px) {
  main { padding: 32px 20px 24px; }

  .app-header {
    padding: 14px 20px;
    gap: 8px;
  }
  .logo { height: 28px; }
  .app-title { font-size: 10px; letter-spacing: 0.12em; }
  .header-right { gap: 6px; }
  .header-logout { padding: 3px 6px; }

  .app-subtitle {
    font-size: 12px;
    margin: 0 0 20px;
  }

  .landing-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 16px;
  }

  body.landing-page {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }
  body.landing-page main {
    padding: 24px 20px;
    justify-content: flex-start;
  }
  body.landing-page .recent-list,
  body.landing-page .recent-cards { max-height: none; overflow: visible; }

  .dropzone > label {
    padding: 28px 20px;
  }
  .dropzone-icon-svg { width: 28px; height: 28px; }
  .dropzone-title { font-size: 14px; }
  .dropzone-hint { font-size: 11px; }

  .recent-cards {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .review-header {
    padding-bottom: 14px;
    margin-bottom: 20px;
  }
  .review-title { font-size: 16px; }
  .review-meta { font-size: 11px; }

  .badges {
    gap: 6px;
    margin-bottom: 20px;
  }
  .badge { font-size: 11px; padding: 6px 10px; }

  .sections-grid {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 24px;
  }
  details.section > summary { padding: 12px 14px; font-size: 12px; }
  .section-body { padding: 4px 14px 14px; }

  .actions {
    flex-wrap: wrap;
    gap: 8px;
  }
  .actions .btn {
    flex: 1 1 auto;
    min-width: 140px;
    justify-content: center;
  }

  .done-card { padding: 36px 20px; }
  .done-icon-svg { width: 40px; height: 40px; }
  .done-title { font-size: 16px; }
  .done-actions { flex-wrap: wrap; gap: 8px; }
  .done-actions .btn { flex: 1 1 auto; min-width: 130px; }

  /* Status (processing) */
  .workspace-card { padding: 20px 18px; }
  .status-list { gap: 10px; }
  .status-item { flex-wrap: wrap; font-size: 13px; }
  .status-hint {
    flex-basis: 100%;
    margin-left: 30px;
    font-size: 10px;
  }

  /* Login */
  .login-card { padding: 28px 22px; }
  .login-icon { width: 28px; height: 28px; }
  .login-title { font-size: 15px; }
  .login-submit { height: 40px; }

  /* Modal */
  .modal { padding: 12px; }
  .modal-content { padding: 16px; max-height: 94vh; }
  .preview-page {
    padding: 28px 20px;
    font-size: 10pt;
  }
  .preview-page .preview-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .preview-page .preview-header .meta { text-align: left; }
  .preview-page .doc-title { font-size: 11pt; }

  /* Footer */
  .app-footer { padding: 12px 20px; font-size: 10px; }

  /* Quota */
  .quota-pill { font-size: 9px; padding: 5px 10px; }
  body.landing-page .recent-header { margin: 24px 0 10px; }
}

@media (max-width: 400px) {
  .dropzone > label { padding: 22px 16px; }
  .actions .btn { min-width: 0; width: 100%; }
  .done-actions .btn { min-width: 0; width: 100%; }
}

@keyframes spin {
  from { transform: rotate(0); }
  to   { transform: rotate(360deg); }
}

.status-meta {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 16px;
  letter-spacing: 0.03em;
}

/* Hint discreto mostrado na etapa ativa */
.status-hint {
  margin-left: 10px;
  font-size: 11px;
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.02em;
}

.status-elapsed {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* Dots pulsantes (3 pontinhos animados) */
.status-dots {
  display: inline-flex;
  gap: 3px;
  align-items: center;
}
.status-dots span {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.25;
  animation: dot-pulse 1.4s infinite ease-in-out;
}
.status-dots span:nth-child(2) { animation-delay: 0.2s; }
.status-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dot-pulse {
  0%, 80%, 100% { opacity: 0.25; transform: scale(0.8); }
  40%           { opacity: 1;    transform: scale(1.2); }
}

/* ============ REVIEW ============ */

.review-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}

.review-title {
  font-size: 20px;
  font-weight: 500;
  margin: 0;
}

.review-meta {
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

.badges {
  display: flex;
  gap: 10px;
  margin: 0 0 28px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 12px;
  border-radius: 6px;
  background: var(--bg-muted);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.badge.ok {
  color: var(--success);
  border-color: rgba(34, 197, 94, 0.3);
}

.badge.warn {
  color: var(--warning);
  border-color: rgba(234, 179, 8, 0.3);
}

.badge.info {
  color: var(--accent);
  border-color: rgba(236, 96, 32, 0.3);
}

.sections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
  align-items: start;  /* impede que celulas vazias cresçam pra acompanhar a aberta */
}

details.section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

details.section > summary {
  padding: 14px 18px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 400;
  color: var(--text);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

details.section > summary::-webkit-details-marker { display: none; }

details.section > summary::after {
  content: "▾";
  color: var(--text-dim);
  font-size: 10px;
  transition: transform 0.2s;
}

details.section[open] > summary::after { transform: rotate(180deg); }

.section-count {
  font-size: 11px;
  color: var(--text-dim);
  background: var(--bg-muted);
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 8px;
}

.section-body {
  padding: 4px 18px 18px;
  font-size: 13px;
  color: var(--text-muted);
}

/* Inputs editaveis (revisao humana) */
.section-body textarea,
.section-body input[type="text"] {
  width: 100%;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 300;
  line-height: 1.55;
  resize: vertical;
  transition: border-color 0.15s;
}

.section-body textarea:focus,
.section-body input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
}

.section-body textarea {
  min-height: 80px;
}

.section-body label {
  display: block;
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 14px 0 6px;
}

.section-body label:first-child {
  margin-top: 4px;
}

.edit-hint {
  font-size: 11px;
  color: var(--text-dim);
  font-style: italic;
  margin: 4px 0 0;
}

.section-body p {
  margin: 8px 0;
  line-height: 1.55;
}

.section-body ul {
  margin: 8px 0;
  padding-left: 18px;
  line-height: 1.6;
}

.section-body .nota,
.section-body .cabecalho-interno {
  color: var(--text);
  font-weight: 500;
  margin-top: 14px;
}

/* ============ ACTIONS ============ */

.actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.btn {
  padding: 10px 20px;
  font-size: 13px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  transition: all 0.15s;
}

.btn:hover {
  border-color: var(--text-dim);
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn.ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn.ghost:hover {
  color: var(--text);
}

/* ============ RECENT ============ */

.recent-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.recent-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
}

.recent-item .dim {
  font-size: 11px;
  color: var(--text-dim);
}

.recent-item.clickable {
  padding: 0;
  transition: border-color 0.15s;
}

.recent-item.clickable:hover {
  border-color: var(--accent);
}

.recent-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 10px 14px;
  color: var(--text);
}

/* Cabecalho da secao recent (titulo + botao limpar) */
.recent-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 48px 0 16px;
}

.recent-header .section-label {
  margin: 0;
}

.btn-link-clear {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 10px;
  cursor: pointer;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.15s;
  font-family: inherit;
}

.btn-link-clear:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.08);
}

/* No body.landing-page, ajusta margin-top do header */
body.landing-page .recent-header {
  margin: 28px 0 12px;
}

/* ============ RECENT CARDS (grid) ============ */

.recent-cards {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}

.recent-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.15s, transform 0.15s;
}

.recent-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.recent-card > a,
.recent-card > .no-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  color: inherit;
}

.recent-icon {
  color: var(--text-dim);
  flex-shrink: 0;
}

.recent-card:hover .recent-icon { color: var(--accent); }

.recent-meta {
  flex: 1;
  min-width: 0;
}

.recent-code {
  font-size: 12px;
  color: var(--text);
  margin: 0;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-titulo {
  font-size: 11px;
  color: var(--text-muted);
  margin: 2px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-data {
  font-size: 10px;
  color: var(--text-dim);
  margin: 4px 0 0;
  letter-spacing: 0.03em;
}

.recent-status {
  font-size: 10px;
  padding: 4px 9px;
  border-radius: 10px;
  background: var(--bg-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  color: var(--text-muted);
}

.status-done    .recent-status { color: var(--success); background: rgba(34, 197, 94, 0.1); }
.status-review  .recent-status { color: var(--accent);  background: rgba(236, 96, 32, 0.1); }
.status-processing .recent-status { color: var(--warning); background: rgba(234, 179, 8, 0.12); }
.status-error   .recent-status { color: var(--danger);  background: rgba(239, 68, 68, 0.1); }

/* ============ FOOTER ============ */

.app-footer {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 14px 40px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  box-sizing: border-box;
}

.footer-dot {
  opacity: 0.5;
}

.footer-brand {
  color: var(--text-muted);
  transition: color 0.15s;
}

.footer-brand:hover {
  color: var(--accent);
}

/* ============ DONE ============ */

.done-card {
  text-align: center;
  padding: 56px 32px;
}

.done-icon-svg {
  width: 48px;
  height: 48px;
  color: var(--success);
  margin: 0 auto 16px;
  display: block;
}

/* Botoes com icones + texto alinhados */
.btn { display: inline-flex; align-items: center; gap: 6px; }

.done-title {
  font-size: 20px;
  font-weight: 500;
  margin: 0 0 8px;
}

.done-sub {
  font-size: 13px;
  color: var(--text-dim);
  margin: 0 0 32px;
}

.done-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

/* ============ ERROR ============ */

.error-card {
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--danger);
}

/* Icones SVG (outline, stroke currentColor) */
.ic {
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  flex-shrink: 0;
}
.ic.ic-lg { width: 1.4em; height: 1.4em; }
.ic.ic-xl { width: 32px; height: 32px; }

/* ============ LOGIN ============ */

.login-wrapper {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 36px 32px;
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}

.login-icon {
  width: 32px;
  height: 32px;
  color: var(--accent);
  margin: 0 auto 12px;
  display: block;
}

.login-title {
  font-size: 16px;
  font-weight: 500;
  margin: 0 0 4px;
  color: var(--text);
}

.login-subtitle {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0;
}

.login-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger);
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 12px;
  margin-bottom: 16px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-form label span {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.login-form input {
  background: var(--bg-muted);
  border: 1px solid var(--border);
  padding: 10px 12px;
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 300;
  transition: border-color 0.15s;
}

.login-form input:focus {
  outline: none;
  border-color: var(--accent);
}

.login-submit {
  margin-top: 12px;
  padding: 11px 20px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  justify-content: center;
  width: 100%;
  height: 42px;
}

/* ============ MODAL ============ */

.modal.hidden { display: none; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
}

.modal-content {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 100%;
  max-width: 920px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-close {
  position: sticky;
  top: 0;
  right: 0;
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-muted);
  color: var(--text-muted);
  border: 1px solid var(--border);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  float: right;
  z-index: 10;
}

.modal-close:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Ao abrir o modal, o preview-page tem que ficar um pouco menor e sem sombra */
.modal .preview-page {
  box-shadow: none;
  max-width: 100%;
  margin: 0;
  padding: 40px 44px;
}

/* ============ PREVIEW (visualizacao do documento) ============ */

.preview-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.preview-toolbar .btn-group {
  display: flex;
  gap: 8px;
}

.preview-page {
  background: #ffffff;
  color: #222;
  padding: 48px 56px;
  max-width: 820px;
  margin: 0 auto 40px;
  border-radius: 4px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
  font-family: "Arial", "Helvetica", sans-serif;
  font-weight: 400;
  font-size: 11pt;
  line-height: 1.4;
}

.preview-page h1 {
  font-size: 13pt;
  font-weight: bold;
  margin: 18pt 0 8pt;
}

.preview-page h2 {
  font-size: 12pt;
  font-weight: bold;
  margin: 14pt 0 6pt;
}

.preview-page h3 {
  font-size: 11pt;
  font-weight: bold;
  margin: 12pt 0 4pt;
}

.preview-page p {
  margin: 4pt 0;
}

.preview-page ul {
  margin: 6pt 0;
  padding-left: 20pt;
}

.preview-page li {
  margin: 2pt 0;
}

.preview-page table {
  width: 100%;
  border-collapse: collapse;
  margin: 8pt 0;
  font-size: 10pt;
}

.preview-page th,
.preview-page td {
  border: 1px solid #555;
  padding: 5pt 8pt;
  text-align: left;
  vertical-align: top;
}

.preview-page th {
  background: #f2f2f2;
  font-weight: bold;
}

.preview-page .preview-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid #333;
  padding-bottom: 10pt;
  margin-bottom: 14pt;
  font-size: 9pt;
}

.preview-page .preview-header img {
  height: 28pt;
}

.preview-page .preview-header .meta {
  text-align: right;
  color: #555;
}

.preview-page .preview-header .doc-title {
  text-align: center;
  font-weight: bold;
  font-size: 11pt;
  flex: 1;
  align-self: center;
}

.preview-page .preview-passo {
  padding-left: 12pt;
}

.preview-page .preview-nota {
  font-weight: bold;
  margin-top: 6pt;
}
