/* =====================================================================
   Pesquisa OctoClinic — segue o design system do OctoClinic
   (octo-clinic/ui-components/.../css/layouts/theme.css e theme-dark.css).
   Os tokens -oe-* do JavaFX viraram variáveis CSS --oe-*.
   ===================================================================== */

:root {
  /* marca */
  --oe-brand: #1e5f9e;
  --oe-brand-hover: #1a5389;
  --oe-brand-pressed: #164873;
  --oe-brand-soft: #e8f1f9;
  --oe-brand-soft-hover: #dbe9f5;
  --oe-brand-border: #c3dbef;
  --oe-brand-on: #ffffff;
  --oe-focus-ring: rgba(30, 95, 158, 0.18);

  /* superfícies */
  --oe-bg-shell: #eef0f3;
  --oe-bg-surface: #ffffff;
  --oe-bg-subtle: #f7f8fa;
  --oe-bg-hover: rgba(16, 24, 40, 0.05);

  /* traços */
  --oe-border: #e2e6eb;
  --oe-border-strong: #cdd4dd;

  /* texto */
  --oe-fg: #101828;
  --oe-fg-body: #344054;
  --oe-fg-muted: #667085;
  --oe-fg-subtle: #98a2b3;

  /* semânticas */
  --oe-success: #157347;
  --oe-success-soft: #e6f4ec;
  --oe-warning: #a8720a;
  --oe-warning-soft: #fdf3e2;
  --oe-danger: #b42318;
  --oe-danger-soft: #fdeceb;
  --oe-neutral-soft: #eef0f3;

  --oe-shadow-card: 0 2px 14px rgba(16, 24, 40, 0.10);
  --oe-radius: 6px;
  --oe-radius-card: 10px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --oe-brand: #4f9ee0;
    --oe-brand-hover: #66aee8;
    --oe-brand-pressed: #3d8ccd;
    --oe-brand-soft: #16334d;
    --oe-brand-soft-hover: #1c405f;
    --oe-brand-border: #24506f;
    --oe-brand-on: #08121b;
    --oe-focus-ring: rgba(79, 158, 224, 0.25);

    --oe-bg-shell: #16181d;
    --oe-bg-surface: #202429;
    --oe-bg-subtle: #262b31;
    --oe-bg-hover: rgba(255, 255, 255, 0.06);

    --oe-border: #2f353d;
    --oe-border-strong: #3d454f;

    --oe-fg: #e9edf2;
    --oe-fg-body: #c6ced8;
    --oe-fg-muted: #93a0ad;
    --oe-fg-subtle: #6f7c8a;

    --oe-success: #4ec27f;
    --oe-success-soft: #16301f;
    --oe-warning: #e0b345;
    --oe-warning-soft: #33290f;
    --oe-danger: #f0736a;
    --oe-danger-soft: #3a1c1a;
    --oe-neutral-soft: #2b3138;

    --oe-shadow-card: 0 3px 16px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", "Inter", "Roboto", "Noto Sans", "DejaVu Sans", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  background: var(--oe-bg-shell);
  color: var(--oe-fg-body);
}

h1, h2 { color: var(--oe-fg); font-weight: 700; }
h1 { font-size: 1.6rem; margin: 0 0 8px; }   /* login-title */
h2 { font-size: 1.35rem; margin: 0 0 18px; } /* page-title */
strong { color: var(--oe-fg); }

/* ---------- Barra superior (titlebar) ---------- */
.topo {
  position: sticky; top: 0; z-index: 10;
  background: var(--oe-bg-shell);
}
.marca {
  max-width: 760px; margin: 0 auto;
  padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
}
.brand-mark {
  display: grid; place-items: center;
  width: 30px; height: 30px;
  padding: 5px;
  border-radius: 7px;
  background: var(--oe-brand);
}
.brand-mark img { display: block; width: 100%; height: auto; }
.brand-name { color: var(--oe-fg); font-weight: 700; font-size: 1.05rem; }
.brand-sub { color: var(--oe-fg-muted); font-size: .9rem; }
.brand-sub::before { content: "·"; margin-right: 8px; color: var(--oe-fg-subtle); }

.progresso { height: 3px; background: var(--oe-border); }
#barra { height: 100%; width: 0; background: var(--oe-brand); transition: width .3s; }

/* ---------- Cartão de conteúdo ---------- */
main { max-width: 760px; margin: 0 auto; padding: 20px 16px 64px; }

.content-card {
  background: var(--oe-bg-surface);
  border: 1px solid var(--oe-border);
  border-radius: var(--oe-radius-card);
  box-shadow: var(--oe-shadow-card);
  padding: 28px 28px 20px;
}

.etapa { display: none; }
.etapa.ativa { display: block; }

.lead { color: var(--oe-fg-muted); font-size: 1rem; margin: 0 0 16px; }
.dicas { padding-left: 20px; color: var(--oe-fg-body); margin: 0 0 8px; }
.dicas li { margin-bottom: 6px; }

.oculto { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ---------- Passo do assistente (wizard-step ativo) ---------- */
.passo { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.passo-num {
  display: grid; place-items: center;
  width: 26px; height: 26px;
  border-radius: 100px;
  background: var(--oe-brand);
  color: var(--oe-brand-on);
  font-size: .8rem; font-weight: 700;
}
.passo-txt { color: var(--oe-fg-muted); font-size: .85rem; }

/* ---------- Perguntas (field-label / text-field) ---------- */
.pergunta { border: 0; margin: 0 0 22px; padding: 0; min-width: 0; }
.pergunta > label, .pergunta > legend {
  display: block; padding: 0; margin-bottom: 6px;
  color: var(--oe-fg); font-weight: 600;
}
.dica { display: block; color: var(--oe-fg-subtle); font-size: .85rem; margin: -2px 0 6px; }
.estrela { color: var(--oe-brand); font-weight: 700; }

input[type=text], textarea {
  width: 100%;
  font: inherit;
  color: var(--oe-fg);
  background: var(--oe-bg-surface);
  padding: 8px 12px;
  border: 1px solid var(--oe-border-strong);
  border-radius: var(--oe-radius);
}
input[type=text]::placeholder, textarea::placeholder { color: var(--oe-fg-subtle); }
textarea { resize: vertical; min-height: 84px; }
input[type=text]:focus, textarea:focus {
  outline: none;
  border-color: var(--oe-brand);
  box-shadow: 0 0 0 3px var(--oe-focus-ring);
}

input[type=radio], input[type=checkbox] { accent-color: var(--oe-brand); }

/* opções: checkbox/radio simples, como .check-box/.radio-button do app */
.opcoes { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.opcao {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 0;
  cursor: pointer;
  user-select: none;
}
.opcao:hover { color: var(--oe-fg); }
.opcao:has(input:checked) { color: var(--oe-fg); }
.opcao input { margin: 0; width: 16px; height: 16px; }
.opcao.outro input[type=text] { width: 200px; padding: 4px 8px; }

/* ---------- Termo e modo rápido (toggle-list-row) ---------- */
.toggle, .consentimento {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; margin-top: 12px;
  border: 1px solid var(--oe-border);
  border-radius: 8px;
  cursor: pointer;
}
.toggle:hover { background: var(--oe-bg-hover); }
.consentimento { background: var(--oe-brand-soft); border-color: var(--oe-brand-border); }
.toggle input, .consentimento input { margin-top: 4px; }

/* ---------- Escala de priorização ---------- */
.legenda-escala {
  display: flex; justify-content: space-between;
  color: var(--oe-fg-subtle); font-size: .8rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .03em;
  padding-bottom: 8px; border-bottom: 1px solid var(--oe-border);
}
.linha-escala {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px; align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--oe-border);
}
.nome-func { color: var(--oe-fg); }

/* nota 1–5 como segmented toggle */
.notas { display: flex; }
.nota input, .top3 input { position: absolute; opacity: 0; pointer-events: none; }
.nota span {
  display: grid; place-items: center;
  width: 36px; height: 34px;
  background: var(--oe-bg-surface);
  border: 1px solid var(--oe-border-strong);
  border-right-width: 0;
  color: var(--oe-fg-body);
  cursor: pointer;
}
.nota:first-child span { border-radius: var(--oe-radius) 0 0 var(--oe-radius); }
.nota:last-child span { border-radius: 0 var(--oe-radius) var(--oe-radius) 0; border-right-width: 1px; }
.nota span:hover { background: var(--oe-bg-hover); }
.nota input:checked + span { background: var(--oe-brand-soft); color: var(--oe-brand); font-weight: 700; }
.nota input:focus-visible + span, .top3 input:focus-visible + span { outline: 2px solid var(--oe-brand); outline-offset: 1px; }

/* Top 3 como badge */
.top3 span {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 100px;
  background: var(--oe-neutral-soft);
  color: var(--oe-fg-muted);
  font-size: .8rem; font-weight: 700;
  cursor: pointer; white-space: nowrap;
}
.top3 input:checked + span { background: var(--oe-brand); color: var(--oe-brand-on); }
.top3 input:disabled + span { opacity: .45; cursor: not-allowed; }
.contador-top3 { text-align: right; color: var(--oe-fg-muted); font-size: .9rem; }

/* ---------- Rodapé do assistente (wizard-footer) ---------- */
.navegacao {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 8px; padding-top: 16px;
  border-top: 1px solid var(--oe-border);
}
.contador { color: var(--oe-fg-muted); font-size: .9rem; }

.btn {
  font: inherit; font-weight: 600;
  padding: 9px 18px;
  border-radius: var(--oe-radius);
  cursor: pointer;
}
.btn.oe-primary {
  margin-left: auto;
  background: var(--oe-brand);
  color: var(--oe-brand-on);
  border: 1px solid var(--oe-brand);
}
.btn.oe-primary:hover { background: var(--oe-brand-hover); border-color: var(--oe-brand-hover); }
.btn.oe-primary:active { background: var(--oe-brand-pressed); }
.btn.oe-secondary {
  background: var(--oe-bg-surface);
  color: var(--oe-fg-body);
  border: 1px solid var(--oe-border-strong);
  font-weight: 400;
}
.btn.oe-secondary:hover { background: var(--oe-bg-subtle); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--oe-focus-ring); }
.btn[hidden] { display: none; }

/* login-error */
.erro {
  color: var(--oe-danger);
  background: var(--oe-danger-soft);
  border-radius: var(--oe-radius);
  padding: 8px 12px;
  font-size: .9rem; font-weight: 600;
}
.centro { text-align: center; margin-top: 12px; }

/* ---------- Celular ---------- */
@media (max-width: 600px) {
  .content-card { padding: 20px 16px 16px; }
  .brand-sub { display: none; }
  h1 { font-size: 1.35rem; }
  h2 { font-size: 1.2rem; }
  .linha-escala { grid-template-columns: 1fr auto; }
  .nome-func { grid-column: 1 / -1; }
  .nota span { width: 40px; height: 38px; }
}
