/* Redesign: uma família de UI (Manrope) e Space Grotesk restrita à marca e
   a números grandes. A cursiva decorativa (Playwrite CO) saiu do uso geral. */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;700&display=swap');

:root {
  /* Common */
  /* Ciano da marca: só ação primária, estado ativo e foco. No claro usa o
     teal escuro (5.4:1 sobre branco) — o #00e5ff dá 1.5:1 e some no papel. */
  --primary: #0e7490;
  --primary-glow: rgba(14, 116, 144, 0.12);
  --primary-hover: #155e75;
  --primary-contrast: #ffffff;
  --primary-soft: rgba(14, 116, 144, 0.08);
  --radius: 14px;
  --radius-sm: 10px;
  --transition: 0.15s ease;
  /* Sem glassmorphism: o blur fica desligado em todo lugar que ainda usa a var */
  --glass-blur: none;
  /* Elevação seca, tipo papel — nada de halo */
  --shadow-1: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-2: 0 2px 6px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  /* CTA (assinar/renovar): único destaque colorido do site, nos tons do
     banner de indicação. Claro: âmbar escuro + branco (5.0:1). */
  --cta-bg: #b45309;
  --cta-bg-hover: #92400e;
  --cta-text: #ffffff;
  --font-ui: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Space Grotesk', var(--font-ui);

  /* Light Mode (Default) */
  /* Claro: um único eixo de cinza (slate) do fundo à borda. Degraus
     suficientes para o card branco se destacar do fundo e a borda ser
     visível em monitor lavado — sem precisar de sombra. */
  --bg: #eceff3;
  --bg-dark: #e2e8f0;
  --bg-deep: #cbd5e1;
  --surface: #ffffff;
  --surface-high: #ffffff;
  --surface-highest: #f8fafc;
  --text-main: #0f172a;
  /* 7.6:1 sobre card branco. Era #64748b, a 4.76:1 — logo acima do piso do AA,
     e usado em TODO corpo de texto: em monitor lavado de consultório, sob luz
     ambiente, cinza claro em corpo pequeno é o primeiro a sumir. */
  --text-muted: #475569;
  --border: #c3ccd7;
  --border-ghost: #d8dee6;
  --glass-bg: #ffffff;
  /* Anel de foco: o --primary (#00e5ff) da so 1.5:1 sobre branco, fraco demais
     para indicador. No escuro ele funciona (10.6:1), entao a cor e por tema. */
  --focus-ring: #0e7490;
}

body.dark-mode {
  --bg: #10131a;
  --bg-dark: #0b0e14;
  --bg-deep: #05080a;
  --surface: #1d2026;
  --surface-high: #272a31;
  --surface-highest: #32353c;
  --text-main: #e1e2eb;
  --text-muted: #bac9cc;
  --border: rgba(186, 201, 204, 0.2);
  --border-ghost: rgba(186, 201, 204, 0.15);
  /* 0.85 em vez de 0.6: o card deixa de depender do backdrop-filter renderizar
     (GPU/driver antigo simplesmente ignora a propriedade e o vidro virava um
     véu quase transparente). */
  --glass-bg: #1d2026;
  --focus-ring: #00e5ff;
  --primary: #00e5ff;
  --primary-glow: rgba(0, 229, 255, 0.14);
  --primary-hover: #67efff;
  --primary-contrast: #0b0e14;
  --primary-soft: rgba(0, 229, 255, 0.1);
  /* CTA no escuro: âmbar claro + texto quase preto (11:1) */
  --cta-bg: #fbbf24;
  --cta-bg-hover: #f59e0b;
  --cta-text: #0b0e14;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 2px 8px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Variáveis legadas que várias páginas usam mas nunca foram definidas
   (no escuro o fundo de busca/lista ficava transparente). Viram apelidos
   dos tokens atuais; redefinidas no body.dark-mode para pegar o tema. */
:root,
body.dark-mode {
  --surface-dark: var(--surface);
  --text-light: var(--text-main);
  --border-dark: var(--border);
  --text-muted-dark: var(--text-muted);
}

/* Foco de teclado. Os inputs ja tinham indicador proprio (border + box-shadow),
   mas botoes e links so tinham o outline padrao do navegador, que some no tema
   escuro. :focus-visible so aparece na navegacao por teclado — nao poe anel em
   volta do botao a cada clique de mouse. */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
[role="button"]:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: 6px;
}

/* .login-card e rgba(255,255,255,0.85) e nao tem override no escuro — e branco
   nos dois modos. O anel ciano do tema escuro sumiria ali (1.5:1). */
.login-card a:focus-visible,
.login-card button:focus-visible,
.login-card .btn:focus-visible {
  outline-color: #0e7490;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Botões e campos não herdam a fonte por padrão — sem isso "Sair" e outros
   botões caíam na fonte do sistema, destoando da Manrope. */
button, input, select, textarea {
  font-family: inherit;
}

body {
  font-family: var(--font-ui);
  background-color: var(--bg);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

body:not(.login-body) {
  background: var(--bg);
}

/* A ponta clara do gradiente era #1a2233, cuja luminância é praticamente igual
   à do card (--surface #1d2026). No canto superior direito o card desaparecia
   no fundo — sobrava só a borda, que é justo o que morre em painel com preto
   estourado. Aumentar a opacidade do card não resolvia (mesmo 100% opaco o
   contraste ali ficava em 1.7/1000); a correção é na origem: baixar a ponta do
   gradiente para que o fundo nunca encoste na luminância do card. */
body.dark-mode:not(.login-body) {
  background: var(--bg);
}

body.dark-mode {
  background-color: var(--bg-dark);
  color: var(--text-main);
}

body.dark-mode label {
  color: var(--text-main);
}

/* Caixa de seleção do site: quadrado de cantos suaves (5px), traço fino,
   marcado = preenchido na cor do texto com "✓" na cor da superfície.
   Nem o círculo do radio nativo nem o quadrado grosso do navegador.
   Vale para radio também (mesma aparência; o agrupamento por name
   continua garantindo seleção única). */
input[type="checkbox"],
input[type="radio"] {
  -webkit-appearance: none;
  appearance: none;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin: 0;
  border: 1.5px solid var(--text-muted);
  border-radius: 5px;
  background: var(--surface) center / 12px 12px no-repeat;
  cursor: pointer;
  vertical-align: -3px;
  transition: background-color 0.15s, border-color 0.15s;
}

input[type="checkbox"]:hover,
input[type="radio"]:hover {
  border-color: var(--text-main);
}

input[type="checkbox"]:checked,
input[type="radio"]:checked {
  background-color: var(--text-main);
  border-color: var(--text-main);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.3 2.3 4.7-4.9' fill='none' stroke='%23ffffff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.dark-mode input[type="checkbox"]:checked,
.dark-mode input[type="radio"]:checked {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.3 2.3 4.7-4.9' fill='none' stroke='%231d2026' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

input[type="checkbox"]:disabled,
input[type="radio"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Abas de página (.page-tabs): barra com sublinhado, distribuição igual,
   sem pílula. Mais específico que .tab-btn do docsNav.css. */
.page-tabs,
.docs-nav-row.page-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  border-bottom: 1px solid var(--border-ghost);
  overflow-x: auto;
  scrollbar-width: none;
}

.page-tabs::-webkit-scrollbar { display: none; }

.page-tabs .tab-btn {
  flex: 1 1 0;
  min-height: 48px;
  padding: 0 16px;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  margin-bottom: -1px;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

body .page-tabs .tab-btn:hover {
  color: var(--text-main);
  border-color: transparent;
  border-bottom-color: var(--border);
  background: transparent;
}

body .page-tabs .tab-btn.active,
body:not(.dark-mode) .page-tabs .tab-btn.active {
  color: var(--text-main);
  font-weight: 800;
  background: transparent;
  border-color: transparent;
  border-bottom-color: var(--text-main);
}

/* Painéis de exames: superfície sólida nos dois temas (antes branco
   translúcido no claro e azul no hover do checkbox no escuro). */
.exame-panel,
.preview-panel {
  background: var(--surface) !important;
}

#previewExames {
  background: var(--bg) !important;
  color: var(--text-main) !important;
  border-color: var(--border-ghost) !important;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text-main);
}

.dark-mode .btn-secondary {
  background: var(--surface);
  color: var(--text-main);
}

/* =========== SUPERFÍCIE (antigo glass) =========== */
/* A classe .glass continua no HTML, mas virou superfície sólida: sem
   backdrop-filter e sem o brilho cônico girando por cima. */
.glass {
  background: var(--surface);
  border: 1px solid var(--border-ghost);
  border-radius: var(--radius);
  transition: background-color var(--transition), border-color var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}

@keyframes scan {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse-glow {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }

  70% {
    box-shadow: 0 0 0 20px rgba(239, 68, 68, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

.plantao-btn.danger {
  border-bottom: 4px solid #ef4444;
  animation: pulse-glow 2s infinite;
}

/* =========== LOGIN =========== */
.login-body {
  background-color: var(--bg);
  background-image: radial-gradient(circle at 0% 0%, #ffffff 0%, #f0f4f8 50%, #e2e8f0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
  padding: 20px;
}

body.dark-mode.login-body {
  background-image: radial-gradient(circle at 0% 0%, #1a2233 0%, #10131a 50%, #0b0e14 100%);
}

.login-card {
  max-width: 440px;
  width: 100%;
  padding: 60px 48px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
  /* Antes vinha só de inline style (login/signup) ou da classe .glass
     (reset-password) — três páginas, três caminhos para o mesmo raio.
     Uma única fonte aqui deixa as três iguais e libera o HTML de repetir. */
  border-radius: var(--radius);
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Encurta o card de cadastro sem alargar: os dois campos de senha dividem
   a mesma linha, em vez de empilhados — o card só cresce com quantidade
   real de perguntas diferentes, não repete a mesma largura duas vezes. */
.input-row-2 {
  display: flex;
  gap: 12px;
}

.input-row-2 .input-group {
  flex: 1;
  min-width: 0;
}

/* Marca igual à do index.html: mesma fonte, mesmo peso, mesmas cores de
   acento (--accent/--muted de lá) e sem glow — só o tamanho continua
   maior aqui (42px), porque é a peça central do card, não um item de nav.
   "Med" fica em --text-main (não em --fg do index) porque esse card é
   sempre claro; --fg foi pensado para o fundo escuro da landing e
   ficaria ilegível aqui. */
.login-logo {
  font-family: var(--font-ui);
  font-size: 42px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 12px;
  letter-spacing: -0.03em;
}

.login-logo .flow {
  color: #00d4ff;
}

.login-logo .pro {
  color: #8e9cb5;
  font-weight: 500;
}

/* Telas de autenticação (login, cadastro, recuperação de senha) são sempre
   claras por design — mas --primary (#00e5ff) foi calibrado para o fundo
   escuro do app logado: 1.44:1 sobre o card branco quando usado como texto
   de link, bem abaixo do piso de 4,5:1. Escopado em .login-body para não
   mexer no --primary usado em todo o resto do app (dashboard, etc.) —
   reaproveita o mesmo teal já calibrado como --focus-ring nesta folha. */
.login-body {
  --primary: #0e7490;
  --primary-hover: #0b5c73;
  --primary-glow: rgba(14, 116, 144, 0.3);
}

/* Botão principal: mantido no tom original (--primary de :root, não o
   teal escopado acima) — só os links e o glow do input acompanham a cor
   nova. .btn herdaria o teal de --primary se não travasse aqui, porque
   o gradiente e a sombra do .btn genérico usam a variável. */
.login-body .btn {
  background: linear-gradient(135deg, #00e5ff 0%, #00b0ff 100%);
  box-shadow: 0 10px 30px rgba(0, 229, 255, 0.2);
}

.login-body .btn:hover {
  box-shadow: 0 15px 40px rgba(0, 229, 255, 0.35);
}

.login-body .input-group input:focus {
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.login-logo .pro-2,
.navbar-brand .pro-2 {
  display: inline-block;
  position: relative;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  margin-left: -6px;
  left: -5px;
  top: 6px;
  color: var(--text-main);
  font-style: italic;
  transform: skewX(-15deg);
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 32px;
}

.input-group {
  margin-bottom: 20px;
  text-align: left;
}

.input-group label {
  display: block;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.input-group input {
  width: 100%;
  padding: 16px;
  background: var(--surface-high);
  border: 1px solid var(--border-ghost);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: 'Manrope', sans-serif;
  font-size: 16px;
  transition: all var(--transition);
}

body.dark-mode .input-group input {
  background: rgba(255, 255, 255, 0.03);
}

.input-group input:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(0, 229, 255, 0.05);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

.input-group input::placeholder {
  color: var(--text-muted);
}

.btn {
  width: 100%;
  padding: 16px;
  /* Botão padrão neutro, igual ao "Personalizar" do dashboard: superfície,
     borda e texto. Cor cheia só no CTA de pagamento (--cta-*). */
  background: var(--surface);
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  min-height: 44px;
  box-shadow: var(--shadow-1);
}

.btn:hover {
  background: var(--surface-highest);
  border-color: var(--text-muted);
}

.dark-mode .btn:hover {
  background: var(--surface-high);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* =========== DESTAQUE (único botão colorido do site) ===========
   Tons do banner "Indique o MedFlowPro" (--cta-*): âmbar escuro no claro,
   âmbar claro no escuro. Só em ações importantes:
   - assinatura/pagamento (#renewBtn; .trial-banner-btn no dashboard)
   - interações medicamentosas no dashboard (.rb-btn-interacoes)
   - ações que acionam a IA (#analisarBtn, #grammarBtn, #spellBtn).
   - Imprimir da prescrição (cartão, modal de edição) e do modal de
     visualização/impressão (#docPrintModal), por pedido do Tássio: é a
     ação principal desses fluxos; ali Analisar/Interações ficam neutros.
   Todo o resto é neutro. !important porque várias dessas classes têm
   regra própria na página (algumas com !important) ou estilo inline. */
#analisarBtn,
.presc-rx-card button.btn-imprimir,
#modalImprimir .rx-btn.rx-btn-primary,
#docPrintModal .dp-btn.dp-btn-main,
.rb-btn.rb-btn-interacoes,
.notepad-footer-actions #grammarBtn,
.notepad-footer-actions #spellBtn {
  background: var(--cta-bg) !important;
  color: var(--cta-text) !important;
  border-color: transparent !important;
}

#analisarBtn:hover,
.presc-rx-card button.btn-imprimir:hover,
#modalImprimir .rx-btn.rx-btn-primary:hover,
#docPrintModal .dp-btn.dp-btn-main:hover,
.rb-btn.rb-btn-interacoes:hover,
.notepad-footer-actions #grammarBtn:hover,
.notepad-footer-actions #spellBtn:hover {
  background: var(--cta-bg-hover) !important;
  color: var(--cta-text) !important;
}

/* "Analisar Texto" ligado (painel aberto): estado ativo invertido */
.notepad-footer-actions #grammarBtn.active {
  background: var(--text-main) !important;
  color: var(--surface) !important;
}

#analisarBtn:disabled,
.notepad-footer-actions #spellBtn:disabled,
.notepad-footer-actions #grammarBtn:disabled {
  opacity: 0.55;
}

/* Ação de pagamento */
#paywallModal #renewBtn {
  background: var(--cta-bg);
  color: var(--cta-text);
  border-color: transparent;
}

#paywallModal #renewBtn:hover {
  background: var(--cta-bg-hover);
}

.btn:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-weight: 600;
}

.btn-secondary:hover {
  background: var(--surface-highest);
  border-color: var(--border);
  box-shadow: none;
}

.dark-mode .btn-secondary {
  background: var(--surface);
  color: var(--text-main);
  border-color: var(--border-ghost);
}

.dark-mode .btn-secondary:hover {
  background: var(--surface-high);
}

/* #dc2626→#b91c1c variava só 35 por canal — pouco visível. Modelo (.btn:
   var(--primary)→#00b0ff) varia 53; usa-se aqui um tom a mais claro
   (mesma proporção do degradê, escala inteira deslocada). */
.btn-danger {
  background: var(--surface);
  color: #dc2626;
  border-color: rgba(220, 38, 38, 0.45);
}

.btn-danger:hover {
  background: rgba(220, 38, 38, 0.06);
  border-color: #dc2626;
}

.dark-mode .btn-danger {
  color: #f87171;
}

.btn-success {
  background: #16a34a;
}

.btn-success:hover {
  background: #15803d;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
  width: auto;
}

.error-msg {
  color: #ef4444;
  font-size: 13px;
  margin-top: 16px;
  display: none;
}

/* =========== NAVBAR =========== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-ghost);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 40px;
  z-index: 1000;
  box-shadow: var(--shadow-1);
}

.navbar-brand {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  letter-spacing: -1px;
}

.navbar-brand span {
  color: #00e5ff;
}

/* Marca: cores fixas da identidade original, iguais nos dois temas —
   logotipo não segue o --primary da interface. */
.navbar-brand .pro {
  color: #6b7a96;
  font-weight: 500;
  text-shadow: none;
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 16px;
}

.navbar-username {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}

.dark-mode .navbar-username {
  color: var(--text-muted);
}

.navbar-no-local {
  color: #f59e0b;
  text-decoration: none;
  font-weight: 600;
}

.navbar-no-local:hover {
  color: #d97706;
  text-decoration: underline;
}

.navbar-back {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-main);
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 500;
  transition: all var(--transition);
  text-decoration: none;
  font-size: 14px;
}

.dark-mode .navbar-back {
  border-color: var(--border);
  color: var(--text-main);
}

.navbar-back:hover {
  background: var(--surface-highest);
  border-color: var(--text-muted);
}

.dark-mode .navbar-back:hover {
  background: var(--surface-high);
}

/* =========== MAIN CONTENT =========== */
.main-content {
  padding-top: 88px;
  padding-bottom: 40px;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* =========== DASHBOARD GRID =========== */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px;
}

/* Ferramenta em formato de linha: ícone numa pastilha neutra e o título.
   Todos os cards têm o mesmo tamanho; a descrição longa não aparece no
   dashboard (cortada em reticências ela só gerava ruído). */
.dash-card {
  background: var(--surface);
  border: 1px solid var(--border-ghost);
  border-radius: var(--radius-sm);
  padding: 10px 52px 10px 12px;
  min-height: 60px;
  text-decoration: none;
  color: inherit;
  transition: background-color var(--transition), border-color var(--transition);
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  column-gap: 12px;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.dash-card:hover {
  border-color: var(--border);
  background: var(--surface-highest);
}

.dark-mode .dash-card:hover {
  background: var(--surface-high);
}

.dash-card:focus-visible {
  border-radius: var(--radius-sm);
}

.dash-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg);
  color: var(--text-muted);
}

.dark-mode .dash-card-icon {
  background: var(--surface-high);
}

.dash-card-icon svg {
  width: 19px;
  height: 19px;
}

.dash-card-title {
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-main);
}

.dash-card-desc,
.dash-card-arrow {
  display: none;
}

/* =========== PLANTAO =========== */
.plantao-body {
  background: var(--bg-deep);
  min-height: 100vh;
  padding: 20px;
}

.plantao-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 100px 20px 40px 20px;
}

.plantao-title {
  font-family: var(--font-ui);
  font-size: 32px;
  font-weight: 700;
  color: var(--text-main);
  text-align: center;
  margin-bottom: 48px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.plantao-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.plantao-btn {
  background: var(--glass-bg);
  border: 1px solid var(--border-ghost);
  color: var(--text-main);
  padding: 32px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 20px;
  font-weight: 600;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

body.dark-mode .plantao-btn {
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.plantao-btn:hover {
  background: rgba(0, 229, 255, 0.1);
  border-color: var(--primary);
  transform: translateY(-5px);
  box-shadow: var(--shadow-2);
}

.plantao-btn-icon {
  font-size: 40px;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
}

.plantao-btn.danger {
  border-bottom: 4px solid #ef4444;
}

.plantao-btn.danger:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 20px rgba(239, 68, 68, 0.3);
}

.plantao-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 24px;
  transition: color var(--transition);
}

.plantao-back:hover {
  color: var(--text-main);
}

/* =========== MODALS =========== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--surface);
  border: 1px solid var(--border-ghost);
  border-radius: var(--radius);
  max-width: 700px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 48px;
  position: relative;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.25);
}

.modal-title {
  font-family: var(--font-ui);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 32px;
  text-align: center;
  letter-spacing: -0.5px;
}

.modal-body {
  color: var(--text-muted);
  line-height: 1.7;
  font-size: 15px;
  text-align: center;
  margin-bottom: 24px;
}

.modal-body p {
  margin-bottom: 12px;
}

.modal-body p:last-child {
  margin-bottom: 0;
}

.modal-body h3 {
  color: var(--text-main);
  margin: 20px 0 10px;
  font-size: 17px;
}

.modal-body ul {
  padding-left: 20px;
  margin: 10px 0;
}

.modal-body li {
  margin-bottom: 6px;
}

.modal-body .highlight {
  background: var(--primary-soft);
  border-left: 3px solid var(--primary);
  padding: 12px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 16px 0;
  color: var(--text-main);
}

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

.modal-actions .btn {
  min-width: 160px;
}

/* =========== FLUXOS =========== */
.fluxo-container {
  max-width: 700px;
  margin: 0 auto;
}

.navbar-username {
  font-weight: 500;
  margin-right: 20px;
  color: var(--text-main);
  opacity: 0.8;
}

.navbar-icon {
  font-size: 24px;
  text-decoration: none;
  margin-right: 20px;
  color: var(--text-main);
  filter: grayscale(1);
  transition: all var(--transition);
}

/* Navbar uniforme em todas as páginas: tema e configurações como botões
   fantasma de 44px lado a lado; só "Voltar"/"Sair" (texto) mantêm borda.
   Mesmo padrão que o dashboard já usava. */
.navbar-user { gap: 4px; }
#darkModeBtn, .navbar-user .navbar-icon {
  width: 44px; height: 44px; min-width: 44px;
  padding: 0; margin: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  filter: none;
  font-size: inherit;
}
#darkModeBtn:hover, .navbar-user .navbar-icon:hover { background: var(--bg); color: var(--text-main); }
.navbar-user .navbar-back:last-child { margin-left: 8px; }

.fluxo-header {
  text-align: center;
  margin-bottom: 24px;
}

.fluxo-header h1 {
  font-family: var(--font-ui);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--text-main);
  margin-bottom: 6px;
}

.fluxo-header h1 span {
  font-size: 28px;
  line-height: 1;
}

.fluxo-header p {
  color: var(--text-muted);
  font-size: 15px;
}

.fluxo-card {
  background: var(--glass-bg);
  border: 1px solid var(--border-ghost);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.fluxo-question {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 24px;
  text-align: center;
  color: var(--text-main);
}

/* =========== FLUXO ARVORE - VERTICAL TREE =========== */
.fluxo-arvore-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 20px 0;
}

.calc-layout {
  display: flex;
  min-height: calc(100vh - 72px);
  width: 100%;
}

.calc-sidebar {
  width: 280px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border-ghost);
  padding: 32px 0;
  overflow-y: auto;
}

.fluxo-galho {
  background: var(--surface);
  border: 2px solid var(--border-ghost);
  border-radius: var(--radius);
  padding: 16px 24px;
  min-width: 300px;
  max-width: 500px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  color: var(--text-main);
}

.fluxo-galho::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -20px;
  width: 2px;
  height: 20px;
  background: var(--primary);
  transform: translateX(-50%);
}

.fluxo-galho:last-child::before {
  display: none;
}

.fluxo-galho:hover {
  border-color: var(--primary);
}

.fluxo-galho.ativo {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.fluxo-galho.ativo .fluxo-galho-resposta {
  font-weight: 700;
}

.fluxo-galho.inativo {
  opacity: 0.5;
}

.fluxo-galho.inativo:hover {
  opacity: 0.8;
}

.fluxo-galho-numero {
  background: var(--primary);
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
}

.fluxo-galho.inativo .fluxo-galho-numero {
  background: #64748b;
}

.fluxo-galho-pergunta {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.4;
}

.fluxo-galho-resposta {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
}

.fluxo-galho-resposta.resposta-vazia {
  color: var(--text-muted);
  font-style: italic;
  font-weight: 400;
}

.fluxo-conector {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 20px;
  padding: 4px 0;
  font-weight: bold;
}

.fluxo-opcoes-titulo {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 12px;
  margin-top: 16px;
}

.fluxo-opcoes-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.fluxo-opcao-galho {
  background: var(--primary);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.fluxo-opcao-galho:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
}

.fluxo-options {
  display: grid;
  gap: 12px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border-ghost);
}

.breadcrumb-item {
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
  opacity: 0.5;
}

.breadcrumb-item:hover {
  background: var(--primary);
  color: white;
  opacity: 1;
}

.breadcrumb-item.ativo {
  background: var(--primary);
  color: white;
  opacity: 1;
  font-weight: 600;
}

.fluxo-cascade-step.concluido {
  opacity: 0.5;
}

.fluxo-cascade-step.editando {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.fluxo-cascade-step.concluido:hover {
  opacity: 0.8;
  border-color: var(--primary);
}

.fluxo-option {
  background: var(--bg);
  border: 2px solid var(--border-ghost);
  color: var(--text-main);
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: all var(--transition);
  text-align: left;
}

.fluxo-option:hover {
  border-color: var(--primary);
  background: rgba(0, 229, 255, 0.05);
  transform: translateX(4px);
}

.fluxo-result {
  background: rgba(0, 229, 255, 0.1);
  border-left: 4px solid var(--primary);
  padding: 20px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-top: 20px;
}

.fluxo-result h3 {
  color: var(--primary);
  margin-bottom: 8px;
}

.fluxo-breadcrumb {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  font-size: 13px;
}

.fluxo-breadcrumb span {
  color: var(--text-muted);
}

.fluxo-breadcrumb .current {
  color: var(--primary);
  font-weight: 600;
}

.fluxo-back-btn {
  background: transparent;
  border: 1px solid var(--border-ghost);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  transition: all var(--transition);
  margin-bottom: 20px;
}

.fluxo-back-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.fluxo-selector {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.fluxo-selector-btn {
  background: var(--surface);
  border: 2px solid var(--border-ghost);
  color: var(--text-main);
  padding: 20px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  transition: all var(--transition);
  text-align: center;
}

.fluxo-selector-btn:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* =========== CALCULADORAS =========== */
.calc-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  min-height: calc(100vh - 120px);
}

.calc-sidebar {
  background: var(--glass-bg);
  border-right: 1px solid var(--border-ghost);
  width: 280px;
  height: calc(100vh - 72px);
  position: fixed;
  top: 72px;
  left: 0;
  overflow-y: auto;
  padding: 18px 0;
  z-index: 100;
}

.calc-sidebar-title {
  padding: 0 20px;
  margin-bottom: 14px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

/* ── Onboarding tour ──────────────────────────────────────── */
#ob-wrap {
  position: fixed; inset: 0;
  z-index: 9000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}
#ob-wrap.ob-on {
  opacity: 1;
  pointer-events: all;
}
#ob-spot {
  position: fixed;
  border-radius: 10px;
  box-shadow:
    0 0 0 9999px rgba(0,0,0,0.55),
    0 0 0 3px  var(--primary);
  z-index: 9001;
  pointer-events: none;
  transition:
    top    0.28s cubic-bezier(.4,0,.2,1),
    left   0.28s cubic-bezier(.4,0,.2,1),
    width  0.28s cubic-bezier(.4,0,.2,1),
    height 0.28s cubic-bezier(.4,0,.2,1);
}
#ob-spot.ob-hidden { opacity: 0; }

#ob-tip {
  position: fixed;
  z-index: 9002;
  width: min(310px, 90vw);
  background: #fff;
  border-radius: 16px;
  padding: 20px 20px 16px;
  box-shadow: 0 24px 70px rgba(0,0,0,0.2), 0 6px 20px rgba(0,0,0,0.1);
  transition:
    top  0.28s cubic-bezier(.4,0,.2,1),
    left 0.28s cubic-bezier(.4,0,.2,1);
}
.dark-mode #ob-tip {
  background: #131720;
  border: 1px solid rgba(255,255,255,0.07);
  box-shadow: 0 24px 70px rgba(0,0,0,0.5), 0 6px 20px rgba(0,0,0,0.35);
}

.ob-dots { display: flex; gap: 5px; margin-bottom: 12px; }
.ob-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--border);
  transition: background 0.2s, transform 0.2s;
}
.ob-dot-on { background: var(--primary); transform: scale(1.25); }

.ob-ttitle { font-size: 15px; font-weight: 700; color: #1e293b; margin: 0 0 6px; }
.dark-mode .ob-ttitle { color: #f1f5f9; }

.ob-ttext { font-size: 13.5px; color: #64748b; line-height: 1.6; margin: 0 0 16px; }
.dark-mode .ob-ttext { color: #94a3b8; }

.ob-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ob-skip {
  font-size: 12px; color: var(--text-muted); background: none; border: none;
  cursor: pointer; padding: 0; flex-shrink: 0;
  transition: color 0.15s;
}
.ob-skip:hover { color: var(--text-main); }

.ob-nav { display: flex; gap: 8px; }
.ob-prev {
  padding: 7px 13px; border-radius: 8px; font-size: 13px; font-weight: 600;
  border: 1.5px solid rgba(0,0,0,0.1); background: transparent; cursor: pointer;
  color: #475569; transition: all 0.15s;
}
.ob-prev:hover { background: rgba(0,0,0,0.04); }
.dark-mode .ob-prev { border-color: rgba(255,255,255,0.1); color: #94a3b8; }

.ob-next {
  padding: 7px 15px; border-radius: 8px; font-size: 13px; font-weight: 700;
  border: none; cursor: pointer;
  background: var(--primary);
  color: var(--primary-contrast);
  transition: background 0.15s;
}
.ob-next:hover { background: var(--primary-hover); }
.ob-fin { background: var(--primary); }

.ob-help-btn {
  position: fixed; bottom: 24px; right: 20px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border); color: var(--text-main);
  font-size: 18px; font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-2);
  transition: border-color 0.15s, background 0.15s;
  z-index: 900;
}
.ob-help-btn:hover { border-color: var(--text-muted); background: var(--surface-highest); }
.dark-mode .ob-help-btn:hover { background: var(--surface-high); }

@media (max-width: 1023px) {
  #obHelpBtn, #ob-wrap { display: none !important; }
}

.ob-profiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}
.ob-profile-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  border-radius: 12px;
  border: 1.5px solid rgba(99,102,241,0.2);
  background: rgba(99,102,241,0.04);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.ob-profile-btn:hover {
  border-color: #6366f1;
  background: rgba(99,102,241,0.1);
  transform: translateY(-2px);
}
.ob-profile-btn:active { transform: translateY(0); }
.dark-mode .ob-profile-btn {
  border-color: rgba(99,102,241,0.3);
  background: rgba(99,102,241,0.07);
}
.dark-mode .ob-profile-btn:hover {
  border-color: #818cf8;
  background: rgba(99,102,241,0.15);
}
.ob-profile-label { font-size: 13px; font-weight: 600; color: var(--text-main); text-align: center; line-height: 1.4; }

.calc-nav-item {
  display: block;
  width: 100%;
  padding: 8px 20px;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
}

.calc-nav-item:hover {
  background: rgba(0, 229, 255, 0.05);
}

.calc-nav-item.active {
  background: rgba(0, 229, 255, 0.1);
  color: var(--primary);
  border-right: 3px solid var(--primary);
}

.calc-area {
  flex: 1;
  min-width: 0;
  padding: 28px;
  background: radial-gradient(circle at 100% 100%, var(--bg-dark) 0%, var(--bg) 100%);
  overflow-y: auto;
}

.calc-section {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

.calc-card {
  width: 100%;
}

.calc-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-main);
}

.calc-desc {
  color: var(--text-muted);
  margin-bottom: 24px;
  font-size: 14px;
}

.calc-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  align-items: end;
}

.calc-form .input-group {
  margin-bottom: 0;
}

.calc-form .input-group label {
  color: var(--text-muted);
}

.calc-form .input-group input,
.calc-form .input-group select {
  background: var(--surface);
  border-color: var(--border-ghost);
  color: var(--text-main);
}

.calc-result {
  background: rgba(0, 229, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 24px;
  margin-top: 24px;
  display: none;
}

.calc-result.visible {
  display: block;
}

.calc-result-label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 8px;
}

.calc-result-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-main);
}

.calc-result-detail {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* =========== PRESCRICAO =========== */
.presc-container {
  max-width: 800px;
  margin: 0 auto;
}

.presc-card {
  background: var(--surface);
  border: 1px solid var(--border-ghost);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-1);
  margin-bottom: 24px;
}

.presc-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--text-main);
}

.presc-context-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.presc-context-btn {
  background: var(--bg);
  border: 2px solid var(--border-ghost);
  color: var(--text-main);
  padding: 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all var(--transition);
  text-align: center;
}

.presc-context-btn:hover {
  border-color: var(--border);
}

.presc-context-btn.active {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.presc-output {
  width: 100%;
  min-height: 200px;
  padding: 20px;
  background: var(--bg);
  border: 1px solid var(--border-ghost);
  border-radius: var(--radius-sm);
  font-family: 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  color: var(--text-main);
}

.presc-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.presc-actions .btn {
  flex: 1;
}

/* Campo de busca padrão das ferramentas */
#busca {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  font-size: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  margin-bottom: 12px;
  background: var(--surface);
  color: var(--text-main);
  transition: border-color var(--transition), box-shadow var(--transition);
}

#busca:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.lista {
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--border-ghost);
  border-radius: var(--radius-sm);
  background: var(--surface);
  margin-bottom: 16px;
}

.lista-item {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  border-bottom: 1px solid var(--border-ghost);
  transition: background 0.15s;
  color: var(--text-main);
}

.lista-item:last-child {
  border-bottom: none;
}

.lista-item:hover {
  background: var(--bg);
}

.presc-rx-card {
  background: var(--bg);
  border: 1px solid var(--border-ghost);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin-bottom: 16px;
  white-space: pre-line;
  font-family: Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  position: relative;
  color: var(--text-main);
}

.presc-rx-card > button {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 6px 12px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

/* =========== PACIENTES =========== */
.pacientes-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.pacientes-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-main);
}

.paciente-list {
  display: grid;
  gap: 16px;
}

.paciente-card {
  background: var(--glass-bg);
  border: 1px solid var(--border-ghost);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  transition: all var(--transition);
}

.paciente-card:hover {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  border-color: var(--primary);
}

.paciente-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.paciente-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
}

.paciente-age {
  font-size: 14px;
  color: var(--text-muted);
}

.paciente-diag {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.dark-mode .paciente-diag {
  color: var(--text-muted-dark);
}

.paciente-conduta {
  font-size: 14px;
  color: var(--text-main);
  background: var(--bg);
  padding: 12px;
  border-radius: var(--radius-sm);
  line-height: 1.5;
}

.dark-mode .paciente-conduta {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-light);
}

.paciente-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.paciente-actions button {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  transition: all var(--transition);
  font-weight: 500;
}

.dark-mode .paciente-actions button {
  border-color: var(--border-dark);
  color: var(--text-muted-dark);
}

.paciente-actions .edit-btn:hover {
  background: #eff6ff;
  border-color: var(--primary);
  color: var(--primary);
}

.paciente-actions .delete-btn:hover {
  background: #fef2f2;
  border-color: #ef4444;
  color: #ef4444;
}

/* =========== CONFIG =========== */
.config-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
}

.config-container .config-card {
  max-width: 100%;
  width: 100%;
}

.config-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
}

body:not(.dark-mode) .config-card {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

body.dark-mode .config-card {
  background: var(--surface);
  border: 1px solid var(--border-ghost);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.config-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 24px;
}

.dark-mode .config-title {
  color: var(--text-light);
}

.config-section {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.dark-mode .config-section {
  border-bottom-color: var(--border-dark);
}

.config-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.config-section h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
}

.dark-mode .config-section h3 {
  color: var(--text-light);
}

.toggle-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}

.toggle-label {
  font-size: 14px;
  color: var(--text-muted);
}

.dark-mode .toggle-label {
  color: var(--text-muted-dark);
}

.toggle {
  position: relative;
  width: 48px;
  height: 26px;
  display: inline-block;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--border);
  border-radius: 26px;
  transition: var(--transition);
}

.dark-mode .toggle-slider {
  background: var(--border-dark);
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: var(--transition);
}

.toggle input:checked+.toggle-slider {
  background: var(--primary);
}

.toggle input:checked+.toggle-slider:before {
  transform: translateX(22px);
}

/* =========== RESPONSIVE =========== */
@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .calc-layout {
    flex-direction: column;
    min-height: auto;
    grid-template-columns: 1fr;
  }

.calc-sidebar {
    position: static;
    width: 100%;
    max-height: none;
    overflow-y: visible;
    border-right: none;
    border-bottom: 1px solid var(--border-ghost);
    flex: none;
  }

  .navbar {
    padding: 0 12px;
    height: 56px;
    flex-wrap: nowrap;
    gap: 4px;
  }

  .navbar-brand {
    font-size: 15px;
  }

  .navbar-user {
    gap: 4px;
    width: auto;
    min-width: 0;
    flex-wrap: nowrap;
  }

  .navbar-username {
    display: none !important;
  }
  .navbar-icon {
    margin-right: 0;
    font-size: 14px;
    padding: 4px 6px;
  }
  .navbar-icon svg {
    width: 16px;
    height: 16px;
  }
  .navbar-back {
    font-size: 12px;
    padding: 4px 8px;
    white-space: nowrap;
  }
  .navbar-back svg {
    width: 14px;
    height: 14px;
  }

  .main-content {
    padding-left: 16px;
    padding-right: 16px;
  }

  .plantao-btn {
    font-size: 18px;
    padding: 20px 24px;
  }

  .presc-context-grid {
    grid-template-columns: 1fr 1fr;
  }

  .fluxo-selector {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .login-card {
    padding: 32px 24px;
  }

  .input-row-2 {
    flex-direction: column;
    gap: 0;
  }

  .presc-context-grid {
    grid-template-columns: 1fr;
  }

  .presc-actions {
    flex-direction: column;
  }
}

/* =========== SCROLLBAR =========== */
/* Barras de rolagem invisíveis em todo o site (como no modal de termos);
   a rolagem por roda, toque e teclado continua normal. */
html, body, *, *::before, *::after { scrollbar-width: none !important; -ms-overflow-style: none !important; }
::-webkit-scrollbar { display: none !important; width: 0 !important; height: 0 !important; }

/* =========== SELECT / DROPDOWN FIX =========== */
/* Controles nativos (lista aberta do select, calendário, spinners) no tom
   do tema, sem o azul padrão do sistema. */
:root { color-scheme: light; }
body.dark-mode { color-scheme: dark; }
select {
  background: #ffffff;
  color: #111827;
  border: 1px solid #d1d5db;
  padding: 8px;
  border-radius: 8px;
}

.dark-mode select {
  background: var(--surface);
  color: var(--text-main);
  border-color: var(--border);
}

select option {
  background: #ffffff;
  color: #111827;
}

.dark-mode select option {
  background: var(--surface);
  color: var(--text-main);
}

select option:checked {
  background: var(--surface-highest);
  color: var(--text-main);
}

/* =========== LABEL VISIBILITY =========== */
label {
  color: #111827;
}

.dark-mode label {
  color: #e5e7eb;
}

/* =========== CARD TEXT INHERITANCE =========== */
.calc-card {
  color: inherit;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

body.dark-mode .calc-card {
  background: var(--surface);
  border: 1px solid var(--border-ghost);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* =========== LAST MODE BANNER =========== */
/* Era amarelo-sinal chapado. Atalho útil, mas não é alerta: superfície
   neutra, marcador lateral e a ação no botão primário. */
.last-mode-banner {
  background: var(--surface);
  color: var(--text-main);
  border: 1px solid var(--border-ghost);
  border-left: 3px solid var(--text-muted);
  padding: 10px 12px 10px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow-1);
}

/* Botão neutro: a única cor cheia da tela é o CTA de assinatura. */
.last-mode-banner button {
  background: var(--surface);
  color: var(--text-main);
  border: 1px solid var(--border);
  min-height: 44px;
  padding: 0 16px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.last-mode-banner button:hover {
  background: var(--surface-highest);
  border-color: var(--text-muted);
}

.termos-group {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.termos-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  flex-shrink: 0;
}

.termos-group label {
  font-size: 14px;
  font-weight: normal;
  color: var(--text-main);
  display: inline;
  margin: 0;
}

.termos-group label a {
  color: var(--primary);
  text-decoration: underline;
  font-weight: 500;
}

.termos-group label a:hover {
  color: var(--primary-hover);
}

/* Legacy theme classes removed */

@media (max-width: 768px) {
  .navbar {
    height: 52px;
    padding: 0 10px;
    flex-wrap: nowrap;
    gap: 4px;
  }
  .navbar-brand {
    font-size: 14px;
  }
  .navbar-brand .pro-2 {
    font-size: 13px;
  }
  .navbar-icon {
    margin-right: 0;
    font-size: 13px;
    padding: 4px 5px;
  }
  .navbar-icon svg {
    width: 15px;
    height: 15px;
  }
  .navbar-back {
    font-size: 11px;
    padding: 4px 7px;
    white-space: nowrap;
  }
  .navbar-back svg {
    width: 13px;
    height: 13px;
  }
  .main-content {
    padding-top: 68px;
  }
  /* Ajustes para calculadoras, exames e medicamentos no mobile */
  .calc-card, .exame-panel, .med-card {
    padding: 16px;
    margin-bottom: 16px;
  }
  .calc-input, .exame-input, .med-input {
    width: 100%;
    font-size: 16px; /* evita zoom automático no iOS */
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .btn {
    width: 100%;
    margin-bottom: 8px;
  }
}

.btn-google {
  width: 100%;
  height: 54px;
  background: #ffffff;
  color: #334155;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  white-space: nowrap;
  overflow: hidden;
  box-sizing: border-box;
}

.btn-google:hover {
  background: #f8fafc;
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  border-color: #cbd5e1;
}

.btn-google:active {
  transform: translateY(0);
}

.btn-google img {
  width: 20px !important;
  height: 20px !important;
  object-fit: contain;
  flex-shrink: 0;
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: #475569;
  font-size: 13px;
  margin: 20px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #e2e8f0;
}

.auth-divider::before {
  margin-right: .5em;
}

.auth-divider::after {
  margin-left: .5em;
}


/* ═══════════════ Documentos médicos (atestado, encaminhamento, formularios) ═══════════════
   Mesmo padrão de config.html: página larga, superfícies neutras, sem ícones.
   Menu de documentos (#docsNav, gerado por js/docsNav.js) vira lista lateral;
   formulário à direita. Seletores com "html body" para vencer as pílulas do
   docsNav.css (carregado depois desta folha) sem !important. */
.docs-layout {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  max-width: 1240px;
  margin: 0 auto;
}

/* Lista completa, sem rolagem interna (a barra de rolagem do navegador
   destoava do tema) e sem sticky: o menu é mais alto que muitas telas. */
.docs-side {
  background: var(--surface);
  border: 1px solid var(--border-ghost);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: 14px 10px;
}

html body .docs-side .docs-nav { margin: 0; padding: 0; border: none; }
html body .docs-side .docs-nav-divider { margin: 10px 6px; background: var(--border-ghost); }
/* Título do grupo acima dos itens na hierarquia: mesmo corpo, mais peso,
   cor do texto; os itens ficam recuados abaixo dele. */
html body .docs-side .docs-nav-label {
  padding: 0 10px;
  margin: 4px 0 4px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-main);
}
html body .docs-side .docs-nav-row { flex-direction: column; flex-wrap: nowrap; gap: 1px; }

html body .docs-side .tab-btn {
  display: block;
  width: 100%;
  min-height: 34px;
  padding: 7px 10px 7px 20px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  white-space: normal;
  line-height: 1.3;
}

html body .docs-side .tab-btn:hover {
  background: var(--bg);
  color: var(--text-main);
  border-color: transparent;
}

html body .docs-side .tab-btn.active {
  background: var(--bg);
  color: var(--text-main);
  font-weight: 800;
  border-color: transparent;
  box-shadow: inset 2px 0 0 var(--text-main);
}

.docs-main.presc-card { padding: 28px 32px 32px; margin-bottom: 40px; }

@media (max-width: 900px) {
  .docs-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .docs-side { padding: 12px; }
  html body .docs-side .docs-nav-label { padding: 0 2px; }
  html body .docs-side .docs-nav-row {
    flex-direction: row;
    overflow-x: auto;
    gap: 6px;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  html body .docs-side .docs-nav-row::-webkit-scrollbar { display: none; }
  html body .docs-side .tab-btn {
    width: auto;
    flex: 0 0 auto;
    padding: 7px 12px;
    white-space: nowrap;
    border: 1px solid var(--border-ghost);
  }
  html body .docs-side .tab-btn.active { box-shadow: inset 0 0 0 1px var(--text-main); }
  .docs-main.presc-card { padding: 20px 16px 24px; }
}

/* ── Campos ── */
.docs-main .form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-main);
}

.docs-main .required { color: #dc2626; }
.dark-mode .docs-main .required { color: #f87171; }

.docs-main .form-input,
.docs-main .form-textarea,
.docs-main .atestado-preview,
.docs-main .enc-preview {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-main);
  font-family: var(--font-ui);
  font-size: 14px;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.docs-main .form-input { min-height: 44px; padding: 10px 12px; }

.dark-mode .docs-main .form-input,
.dark-mode .docs-main .form-textarea,
.dark-mode .docs-main .atestado-preview,
.dark-mode .docs-main .enc-preview { background: var(--surface); }

.docs-main .form-input:focus,
.docs-main .form-textarea:focus,
.docs-main .atestado-preview:focus,
.docs-main .enc-preview:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Prévia do documento: superfície levemente diferente do formulário */
.docs-main #preview,
.docs-main [id$="-preview"] {
  background: var(--bg);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
}

/* ── Títulos de seção, avisos ── */
.docs-main .apac-section-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-ghost);
}

.docs-main .inss-info,
.docs-main .doc-info {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border-ghost);
  border-left: 3px solid var(--text-muted);
  border-radius: 0 8px 8px 0;
  padding: 12px 16px;
}

/* ── Busca de CID, listas, chips (eram ciano) ── */
.docs-main .search-cid-bar {
  background: var(--bg);
  border: 1px solid var(--border-ghost);
  border-radius: 10px;
  padding: 12px 14px;
  flex-wrap: wrap;
}

.docs-main .search-cid-bar .form-input { background: var(--surface); }

.docs-main .cid-lista,
.docs-main .autocomplete-list,
.docs-main .dropdown-lista { border: 1px solid var(--border); border-radius: 8px; }

.docs-main .cid-lista:empty { display: none; }

.docs-main .cid-item:hover,
.docs-main .autocomplete-list div:hover,
.docs-main .dropdown-item:hover,
.docs-main .dropdown-item.highlighted {
  background: var(--bg);
  color: var(--text-main);
}

.docs-main .cid-chip,
.docs-main .cid-badge {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-main);
}

.docs-main .cid-selecionado { color: var(--text-main); }

/* ── Botões ── */
.docs-main .action-buttons,
.docs-main .form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 20px;
  border-top: 1px solid var(--border-ghost);
}

.docs-main .action-buttons .btn,
.docs-main .form-actions .btn { width: auto; padding: 0 22px; }

/* Imprimir tinha gradiente azul inline: neutro, destaque só no peso */
.docs-main .btn[style*="gradient"] {
  background: var(--surface) !important;
  color: var(--text-main) !important;
}

.docs-main button[onclick^="imprimir"],
.docs-main button[onclick^="gerar"] { font-weight: 800; }

/* Seletores internos (tipo de laudo, sim/não do LME…): segmentos neutros */
html body .docs-main .tab-btn {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-main);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
}

html body .docs-main .tab-btn:hover { border-color: var(--text-muted); color: var(--text-main); }

html body .docs-main .tab-btn.active {
  background: var(--text-main);
  border-color: var(--text-main);
  color: var(--surface);
}

.docs-main .btn-template,
.docs-main .lme-add-btn,
.docs-main .lme-del-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-main);
  font-family: var(--font-ui);
}

.docs-main .lme-add-btn { border-style: dashed; border-radius: 8px; }
.docs-main .btn-template { border-radius: 8px; }
.docs-main .btn-template:hover,
.docs-main .lme-add-btn:hover:not([disabled]) { background: var(--bg); border-color: var(--text-muted); color: var(--text-main); }

/* ── Grade de campos (linhas rótulo-acima) ── */
.docs-main .df-row,
.docs-main .linha-flex,
.docs-main .med-info {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  align-items: end;
}

/* O JS mostra algumas linhas com style.display = 'flex' */
.docs-main .df-row[style*="display: flex"],
.docs-main .linha-flex[style*="display: flex"] { display: grid !important; }

.docs-main .med-info { padding-top: 20px; border-top: 1px solid var(--border-ghost); }

/* encaminhamento: os grupos já vêm prontos como <div> filhos */
.docs-main .linha-flex > div,
.docs-main .med-info > div { min-width: 0 !important; grid-column: span 1; }
.docs-main .linha-flex > div[style*="flex:1"],
.docs-main .med-info > div[style*="flex:1"] { grid-column: span 2; }
.docs-main .linha-flex > div:only-child { grid-column: 1 / -1; }
.docs-main .linha-flex > div .form-input,
.docs-main .med-info > div .form-input { width: 100% !important; }

.docs-main .df-row > .df { min-width: 0; grid-column: span var(--span, 1); }
.docs-main .df .form-label { white-space: normal; overflow-wrap: anywhere; }

/* 4 colunas só quando o formulário é largo (menu lateral + >=860px de
   formulário). Abaixo disso, 2 colunas; campos largos ocupam a linha. */
@media (max-width: 1179px) {
  .docs-main .df-row,
  .docs-main .linha-flex,
  .docs-main .med-info { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .docs-main .df-row > .df[style*="--span"],
  .docs-main .linha-flex > div[style*="flex:1"],
  .docs-main .med-info > div[style*="flex:1"] { grid-column: 1 / -1; }
}
.docs-main .df .form-input { width: 100% !important; min-width: 0 !important; text-align: left !important; }
.docs-main .search-cid-bar b { font-size: 14px; }
.docs-main .search-cid-bar .form-input { flex: 1 1 260px !important; max-width: none !important; }
.docs-main .df-unit-wrap { display: flex; align-items: center; gap: 8px; }
.docs-main .df-unit { font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.docs-main .df-hint { display: block; margin-top: 4px; font-size: 12px; color: var(--text-muted); }

@media (max-width: 640px) {
  .docs-main .df-row,
  .docs-main .linha-flex,
  .docs-main .med-info { grid-template-columns: minmax(0, 1fr); }
  .docs-main .df-row > .df,
  .docs-main .linha-flex > div,
  .docs-main .med-info > div { grid-column: 1 / -1 !important; }
}

.docs-main .cid-chips:empty { display: none; }
.docs-main .urgente-label {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.docs-main .urgente-label svg { display: none; }
.docs-main .urgente-label.ativo { border-color: #dc2626; color: #dc2626; background: rgba(220, 38, 38, 0.06); }
.dark-mode .docs-main .urgente-label.ativo { border-color: #f87171; color: #f87171; background: rgba(248, 113, 113, 0.08); }


/* ═══════════════ Telas de entrada (login, signup, reset-password, google-callback) ═══════════════
   Painel de marca (sempre escuro) + formulário (sempre claro, por design).
   Neutro; a textura do painel (grade de pontos + traçado de ECG) é
   decorativa e fica atrás do texto. */
/* Login no visual novo: painel de marca (sempre escuro) + formulário
   (sempre claro, como já era por design). Neutro; a textura do painel
   (grade de pontos + traçado de ECG) é decorativa e fica atrás do texto. */
body.login-body {
  --primary: #0f172a;
  --primary-glow: rgba(15, 23, 42, 0.12);
  background: #eceff3;
  background-image: none;
  padding: 24px;
}
.auth-shell {
  width: 100%;
  max-width: 1040px;
  min-height: 620px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  background: #ffffff;
  border: 1px solid #d8dee6;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
  overflow: hidden;
}

/* ── Painel de marca ── */
.auth-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 48px 40px;
  background: #0f172a;
  color: #e2e8f0;
  overflow: hidden;
  isolation: isolate;
}
.auth-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgba(148, 163, 184, 0.16) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(160deg, #000 10%, transparent 75%);
  mask-image: linear-gradient(160deg, #000 10%, transparent 75%);
}
.auth-ecg {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 36px;
  z-index: -1;
  width: 100%;
  height: 64px;
  opacity: 0.5;
}
/* Marca igual à da navbar (style_novo .navbar-brand): Space Grotesk 700,
   letter-spacing -1px, Flow #00e5ff, Pro #6b7a96 500. */
.auth-brand-logo {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -1px;
  color: #f8fafc;
  margin-bottom: 48px;
}
.auth-brand-logo .flow { color: #00e5ff; }
.auth-brand-logo .pro { color: #6b7a96; font-weight: 500; }
.auth-brand h2 {
  margin: 0 0 12px;
  font-size: 32px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #f8fafc;
  max-width: 13ch;
}
.auth-brand-lead {
  margin: 0 0 28px;
  font-size: 15px;
  line-height: 1.6;
  color: #94a3b8;
  max-width: 36ch;
}
.auth-pilares { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; max-width: 420px; }
.auth-pilares li {
  display: flex;
  gap: 14px;
  align-items: baseline;
  padding: 12px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  font-size: 14px;
  color: #cbd5e1;
}
.auth-pilares li span {
  font-family: var(--font-display);
  font-size: 12px;
  color: #64748b;
  min-width: 20px;
}
/* espaço reservado ao traçado de ECG, sem texto */
.auth-brand-foot { height: 64px; }

/* ── Formulário ── */
.auth-shell .login-card {
  max-width: none;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px 56px 44px;
  background: #ffffff;
  border: none;
  border-radius: 0;
  box-shadow: none;
  text-align: left;
  color: #0f172a;
}
.auth-shell .login-logo { display: none; }
.auth-titulo { margin: 0 0 6px; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; color: #0f172a; }
.auth-shell .login-subtitle { margin: 0 0 32px; font-size: 14px; color: #64748b; text-align: left; }
.auth-shell .input-group { margin-bottom: 18px; }
.auth-shell .input-group label {
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  text-transform: none;
  letter-spacing: 0;
}
.auth-shell .input-group input:not([type="checkbox"]) {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid #c3ccd7;
  border-radius: 10px;
  background: #ffffff;
  color: #0f172a;
  font-size: 15px;
  box-shadow: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-shell .input-group input::placeholder { color: #94a3b8; }
.auth-shell .input-group input:not([type="checkbox"]):focus {
  outline: none;
  border-color: #0f172a;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.1);
}
.auth-shell .login-card > .btn {
  width: 100%;
  height: 48px;
  margin-top: 6px;
  background: #0f172a;
  color: #ffffff;
  border: 1px solid #0f172a;
  border-radius: 10px;
  box-shadow: none;
  font-size: 15px;
  font-weight: 800;
  transform: none;
}
.auth-shell .login-card > .btn:hover { background: #1e293b; border-color: #1e293b; box-shadow: none; transform: none; }
.auth-ou {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  font-size: 12px;
  color: #94a3b8;
}
.auth-ou::before, .auth-ou::after { content: ""; flex: 1; height: 1px; background: #e2e8f0; }
.auth-shell .btn-google {
  height: 48px;
  border: 1px solid #c3ccd7;
  border-radius: 10px;
  background: #ffffff;
  color: #0f172a;
  font-size: 15px;
  font-weight: 700;
  box-shadow: none;
  transform: none;
}
.auth-shell .btn-google:hover { background: #f8fafc; border-color: #94a3b8; box-shadow: none; transform: none; }
.auth-shell .error-msg {
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
}
.auth-shell #infoMsg { color: #334155 !important; background: #f1f5f9 !important; border: 1px solid #d8dee6 !important; }
.auth-links { margin-top: 28px; padding-top: 20px; border-top: 1px solid #e2e8f0; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 14px; color: #64748b; }
.auth-links a { color: #0f172a; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.auth-links #forgotLink { color: #64748b; font-weight: 600; }

/* Barra de carregamento: fina e neutra (era ciano com brilho) */
#loginLoadingBar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: #e2e8f0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.1s;
}
#loginLoadingBar.active { opacity: 1; }
#loginLoadingBar::after {
  content: '';
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 100%;
  background: #0f172a;
  animation: lpSlide 1.1s ease-in-out infinite;
}
@keyframes lpSlide {
  0%   { left: -40%; }
  100% { left: 100%; }
}
.login-card { position: relative; overflow: hidden; }

@media (max-width: 860px) {
  body.login-body { padding: 16px; align-items: flex-start; }
  .auth-shell { grid-template-columns: minmax(0, 1fr); min-height: 0; max-width: 460px; margin: 24px auto; }
  .auth-brand { display: none; }
  .auth-shell .login-card { padding: 40px 24px 32px; }
  .auth-shell .login-logo {
    display: block; margin-bottom: 20px;
    font-family: var(--font-display); font-size: 32px; font-weight: 700;
    letter-spacing: -1px; color: #0f172a;
  }
  .auth-shell .login-logo .flow { color: #00e5ff; }
  .auth-shell .login-logo .pro { color: #6b7a96; font-weight: 500; }
  .auth-shell .login-logo,
  .auth-titulo,
  .auth-shell .login-subtitle { text-align: center; }
}
.auth-shell .termos-group { align-items: flex-start; gap: 12px; margin: 4px 0 20px; }
.auth-shell .termos-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 0;
  padding: 0;
  margin-top: 2px;
  border-radius: 5px;
}
.auth-shell .termos-group label { font-size: 13px; font-weight: 500; line-height: 1.5; color: #334155; }
.auth-shell .termos-group label a { color: #0f172a; font-weight: 700; }

/* ── Modais de texto longo (Termos de Uso / Política de Privacidade:
   signup e config) — cabeçalho e rodapé fixos, texto rolável com a
   barra de rolagem oculta (rola com roda/toque/teclado normalmente). ── */
#termsModal .modal-content,
#privacyModal .modal-content {
  display: flex;
  flex-direction: column;
  max-width: 640px;
  max-height: 86vh;
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
}

#termsModal .modal-title,
#privacyModal .modal-title {
  margin: 0;
  padding: 22px 28px 18px;
  font-size: 20px;
  font-weight: 800;
  text-align: left;
  letter-spacing: -0.01em;
  border-bottom: 1px solid var(--border-ghost);
}

#termsModal .modal-body,
#privacyModal .modal-body {
  flex: 1 1 auto;
  max-height: none !important;
  margin: 0;
  padding: 20px 28px 28px;
  overflow-y: auto;
  text-align: left !important;
  font-size: 14px;
  line-height: 1.65;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 36px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 36px), transparent);
}

#termsModal .modal-body::-webkit-scrollbar,
#privacyModal .modal-body::-webkit-scrollbar { display: none; }

#termsModal .modal-body strong,
#privacyModal .modal-body strong { color: var(--text-main); font-weight: 700; }

#termsModal .modal-body a,
#privacyModal .modal-body a { color: var(--text-main) !important; text-decoration: underline; text-underline-offset: 3px; }

#termsModal .modal-actions,
#privacyModal .modal-actions {
  margin: 0 !important;
  padding: 14px 28px;
  justify-content: flex-end;
  border-top: 1px solid var(--border-ghost);
}

#termsModal .modal-actions .btn,
#privacyModal .modal-actions .btn {
  width: auto;
  min-width: 0;
  min-height: 44px;
  padding: 0 24px;
  font-weight: 800;
}

/* nas telas de entrada (sempre claras) o botão segue o principal */
.login-body #termsModal .modal-actions .btn,
.login-body #privacyModal .modal-actions .btn {
  background: #0f172a;
  color: #ffffff;
  border: 1px solid #0f172a;
  box-shadow: none;
}

@media (max-width: 520px) {
  #termsModal .modal-title, #privacyModal .modal-title { padding: 18px 20px 14px; }
  #termsModal .modal-body, #privacyModal .modal-body { padding: 16px 20px 24px; }
  #termsModal .modal-actions, #privacyModal .modal-actions { padding: 12px 20px; }
  #termsModal .modal-actions .btn, #privacyModal .modal-actions .btn { width: 100%; }
}

/* Botões montados no JS com estilo inline (modais de PDF de Exames,
   Formulários, Diabetes, Pré-natal, Puerpério): hover e foco de teclado. */
button[style*="--cta-bg"]:hover { background: var(--cta-bg-hover) !important; }
button[style*="background:var(--surface)"]:hover,
a[style*="background:var(--surface)"]:hover { background: var(--bg) !important; border-color: var(--text-muted) !important; }
button[style*="--cta-bg"]:focus-visible,
button[style*="background:var(--surface)"]:focus-visible,
a[style*="background:var(--surface)"]:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-glow); }
