/* EmissorFiscal · Swagger UI — tokens da marca Prometheus (docs/10-identidade-visual.md).
   Tema claro padrão; escuro via [data-theme="dark"] (alternado pelo botão no topo). */
@import url("https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  --ef-bg: #FEFDF8;
  --ef-surface: #FFFFFF;
  --ef-surface-2: #F8EFE4;
  --ef-text: #3A0D0A;
  --ef-text-soft: #6B3A34;
  --ef-line: #3A0D0A24;
  --ef-primary: #C42E08;       /* flame-deep: contraste AA em texto sobre fundo claro */
  --ef-primary-hover: #F04E12; /* flame */
  --ef-accent: #F7931E;
  --ef-focus: #FFC53D;
  --ef-on-primary: #FEFDF8;
  --ef-ok: #1F8A4C;
  --ef-erro: #C62828;
  --ef-aviso: #B26A00;
  --ef-font: "Figtree", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --ef-mono: "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
}

[data-theme="dark"] {
  --ef-bg: #120504;
  --ef-surface: #1D0907;
  --ef-surface-2: #2A0806;
  --ef-text: #F6E9D6;
  --ef-text-soft: #F6E9D6B8;
  --ef-line: #FFC53D29;
  --ef-primary: #F7931E;
  --ef-primary-hover: #FFC53D;
  --ef-on-primary: #120504;
  --ef-ok: #4CC38A;
  --ef-erro: #FF6B5E;
  --ef-aviso: #FFC53D;
  color-scheme: dark;
}

html, body { background: var(--ef-bg) !important; }
body, .swagger-ui, .swagger-ui .info .title, .swagger-ui .opblock-tag, .swagger-ui .btn, .swagger-ui select,
.swagger-ui input, .swagger-ui textarea, .swagger-ui table, .swagger-ui .model-title, .swagger-ui .tab li {
  font-family: var(--ef-font) !important;
}
.swagger-ui code, .swagger-ui pre, .swagger-ui .microlight, .swagger-ui .opblock-summary-path,
.swagger-ui .parameter__type, .swagger-ui .model { font-family: var(--ef-mono) !important; }

/* Topo */
.swagger-ui .topbar { background: var(--ef-surface); border-bottom: 1px solid var(--ef-line); padding: 10px 0; }
.swagger-ui .topbar .topbar-wrapper { display: flex; align-items: center; gap: 16px; }
.swagger-ui .topbar a.link img, .swagger-ui .topbar a.link svg { display: none; }
.swagger-ui .topbar a.link {
  display: block; width: 210px; height: 42px;
  background: url("/marca/logo.svg") left center / contain no-repeat;
}
[data-theme="dark"] .swagger-ui .topbar a.link { background-image: url("/marca/logo-escuro.svg"); }
.swagger-ui .topbar .download-url-wrapper, .dark-mode-toggle { display: none !important; }
.swagger-ui .topbar .topbar-wrapper { width: 100%; }
.ef-tema {
  margin-left: auto !important; border: 1px solid var(--ef-line); background: var(--ef-surface-2); color: var(--ef-text);
  border-radius: 8px; padding: 6px 12px; font: 600 13px var(--ef-font); cursor: pointer;
}
.ef-tema:hover { border-color: var(--ef-primary); }
.ef-tema:focus-visible { outline: 2px solid var(--ef-focus); outline-offset: 2px; }

/* Texto e superfícies */
.swagger-ui, .swagger-ui .info p, .swagger-ui .info li, .swagger-ui .opblock-description-wrapper p,
.swagger-ui .opblock .opblock-summary-description, .swagger-ui .parameter__name, .swagger-ui .response-col_status,
.swagger-ui table thead tr th, .swagger-ui .tab li, .swagger-ui label, .swagger-ui .model, .swagger-ui .model-title,
.swagger-ui .opblock-tag, .swagger-ui .info .title, .swagger-ui h1, .swagger-ui h2, .swagger-ui h3, .swagger-ui h4, .swagger-ui h5,
.swagger-ui .opblock .opblock-section-header h4, .swagger-ui .response-col_description, .swagger-ui .renderedMarkdown p {
  color: var(--ef-text) !important;
}
.swagger-ui .info .title small { background: var(--ef-primary) !important; }
.swagger-ui .info .title small pre { color: var(--ef-on-primary) !important; }
.swagger-ui .info a, .swagger-ui .info .link { color: var(--ef-primary) !important; }
.swagger-ui a.nostyle, .swagger-ui a.nostyle span, .swagger-ui .opblock-summary-path, .swagger-ui .opblock-summary-path a { color: var(--ef-text) !important; }
.swagger-ui .scheme-container { background: var(--ef-surface) !important; box-shadow: none; border-bottom: 1px solid var(--ef-line); }
.swagger-ui .opblock-tag { border-bottom: 1px solid var(--ef-line) !important; }
.swagger-ui .opblock { border-radius: 10px; box-shadow: none; background: var(--ef-surface) !important; }
.swagger-ui .opblock .opblock-section-header { background: var(--ef-surface-2) !important; box-shadow: none; }
.swagger-ui section.models, .swagger-ui section.models .model-container { background: var(--ef-surface) !important; border-color: var(--ef-line) !important; }
.swagger-ui input[type=text], .swagger-ui textarea, .swagger-ui select, .swagger-ui .parameters-col_description input {
  background: var(--ef-bg) !important; color: var(--ef-text) !important; border: 1px solid var(--ef-line) !important; border-radius: 6px;
}
.swagger-ui textarea.body-param__text { min-height: 320px; }

/* Botões */
.swagger-ui .btn { border-radius: 8px; box-shadow: none; color: var(--ef-text); border-color: var(--ef-line); background: var(--ef-surface); }
.swagger-ui .btn.execute, .swagger-ui .btn.authorize.unlocked, .swagger-ui .auth-btn-wrapper .btn-done {
  background: var(--ef-primary) !important; border-color: var(--ef-primary) !important; color: var(--ef-on-primary) !important;
}
.swagger-ui .btn.execute:hover { background: var(--ef-primary-hover) !important; }
.swagger-ui .btn.authorize { color: var(--ef-primary); border-color: var(--ef-primary); }
.swagger-ui .btn.authorize svg { fill: currentColor; }

/* Status das respostas (separados da paleta da marca) */
.swagger-ui .responses-table .response-col_status { font-family: var(--ef-mono) !important; }

/* Escuro: blocos de código e modais */
[data-theme="dark"] .swagger-ui .highlight-code > .microlight, [data-theme="dark"] .swagger-ui .microlight,
[data-theme="dark"] .swagger-ui pre.example, [data-theme="dark"] .swagger-ui .model-box {
  background: #0B0302 !important; color: #F6E9D6 !important;
}
[data-theme="dark"] .swagger-ui .dialog-ux .modal-ux { background: var(--ef-surface) !important; border-color: var(--ef-line) !important; }
[data-theme="dark"] .swagger-ui .dialog-ux .modal-ux-header h3, [data-theme="dark"] .swagger-ui .dialog-ux .modal-ux-content p,
[data-theme="dark"] .swagger-ui .dialog-ux .modal-ux-content h4 { color: var(--ef-text) !important; }
[data-theme="dark"] .swagger-ui svg.arrow, [data-theme="dark"] .swagger-ui .expand-operation svg,
[data-theme="dark"] .swagger-ui .opblock-control-arrow svg, [data-theme="dark"] .swagger-ui .models-control svg { fill: var(--ef-text); }
[data-theme="dark"] .swagger-ui .opblock-summary-control:focus, [data-theme="dark"] .swagger-ui .opblock-summary-path { color: var(--ef-text) !important; }
[data-theme="dark"] .swagger-ui .prop-type, [data-theme="dark"] .swagger-ui .parameter__type { color: var(--ef-accent) !important; }
[data-theme="dark"] .swagger-ui .tab li button.tablinks { color: var(--ef-text) !important; }

/* Escuro: fundos da marca (night) no lugar do cinza padrão do swagger-ui */
[data-theme="dark"] .swagger-ui, [data-theme="dark"] .swagger-ui .wrapper, [data-theme="dark"] .swagger-ui .information-container,
[data-theme="dark"] .swagger-ui .info, [data-theme="dark"] .swagger-ui section.models { background: var(--ef-bg) !important; }
[data-theme="dark"] .swagger-ui .topbar { background: var(--ef-surface) !important; }
