/* ═══════════════════════════════════════════════════════════════
   TIES – Triagem Inteligente da Eficiência do Sono
   Sistema de design derivado da logomarca
   ═══════════════════════════════════════════════════════════════ */

/* ── Tokens ──────────────────────────────────────────────────── */
:root {
  --night:      #0B1F3A;   /* azul noturno do logo */
  --night-mid:  #142D50;   /* hover da topbar */
  --night-soft: #1E3F6B;   /* acentos secundários */
  --teal:       #D4A017;   /* CTA principal – ouro */
  --teal-dark:  #B8860B;   /* hover do CTA */
  --bg:         #F0F4F8;   /* fundo geral */
  --surface:    #FFFFFF;   /* cards */
  --border:     #DDE3EC;   /* divisórias */
  --text:       #1A2B40;   /* corpo */
  --muted:      #64748B;   /* secundário */
  --success:    #16A34A;
  --warning:    #D97706;
  --danger:     #DC2626;

  --radius:     8px;
  --radius-lg:  14px;
  --shadow-sm:  0 1px 4px rgba(11,31,58,.07);
  --shadow-md:  0 4px 16px rgba(11,31,58,.10);
  --shadow-lg:  0 8px 32px rgba(11,31,58,.14);

  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body:    'Montserrat', system-ui, sans-serif;

  --color-success: var(--success);
  --color-warning: var(--warning);
  --color-danger:  var(--danger);
}

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a   { color: inherit; text-decoration: none; }

/* ── Topbar ──────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--night);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 56px;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 20px;
  color: #fff;
  letter-spacing: .02em;
}

.brand-icon {
  width: 30px;
  height: 30px;
  border: 2px solid var(--teal);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--teal);
  flex-shrink: 0;
}

.topbar-nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

.topbar-nav a {
  color: rgba(255,255,255,.75);
  font-size: 13px;
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: background .15s, color .15s;
}

.topbar-nav a:hover { background: var(--night-mid); color: #fff; }

/* ── Container ───────────────────────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}
.container-form { max-width: 820px; }

/* ── Botões ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background .15s, color .15s, border-color .15s, transform .1s, box-shadow .15s;
  white-space: nowrap;
  line-height: 1.3;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--teal);
  color: var(--night);
  border-color: var(--teal);
}
.btn-primary:hover {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
  box-shadow: 0 4px 12px rgba(212,160,23,.35);
}

.btn-outline {
  background: transparent;
  color: var(--night);
  border-color: var(--border);
}
.btn-outline:hover {
  border-color: var(--night-soft);
  background: rgba(11,31,58,.04);
}

.btn-sm  { padding: 5px 12px; font-size: 13px; }
.btn-lg  { padding: 13px 28px; font-size: 15px; }

/* ── Alertas ─────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 14px;
  border-left: 4px solid;
}
.alert-success { background: #f0fdf4; border-color: var(--success); color: #14532d; }
.alert-danger  { background: #fef2f2; border-color: var(--danger);  color: #7f1d1d; }
.alert-warning { background: #fffbeb; border-color: var(--warning); color: #78350f; }

/* ── Badges ──────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef9c3; color: #854d0e; }
.badge-danger  { background: #fee2e2; color: #991b1b; }

/* ── Cores utilitárias ───────────────────────────────────────── */
.text-muted   { color: var(--muted); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger  { color: var(--danger); }

/* ════════════════════════════════════════════════════════════════
   HOME PAGE
   ════════════════════════════════════════════════════════════════ */

.home-page { background: var(--bg); }

/* Hero */
.hero {
  background: var(--night);
  padding: 80px 24px 90px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* onda de EEG sutil no fundo do hero */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='120' viewBox='0 0 1200 120'%3E%3Cpath d='M0 60 Q60 60 80 40 Q100 20 120 60 Q140 100 160 60 Q180 20 200 30 Q220 40 240 60 Q300 60 400 60 Q420 60 440 45 Q460 30 480 60 Q500 90 520 60 Q540 30 560 60 Q620 60 1200 60' fill='none' stroke='%23D4A017' stroke-width='1.5' stroke-opacity='.18'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-position: center 75%;
  pointer-events: none;
}

.hero-logo {
  width: 160px;
  height: 160px;
  margin: 0 auto 32px;
  border-radius: 50%;
  background: rgba(255,255,255,.05);
  border: 1.5px solid rgba(212,160,23,.25);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius:100px;
  opacity: .92;
}

.hero-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 12px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 52px);
  color: #fff;
  line-height: 1.15;
  margin-bottom: 16px;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.hero-sub {
  font-size: 16px;
  color: rgba(255,255,255,.65);
  max-width: 520px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-hero {
  background: var(--teal);
  color: var(--night);
  border-color: var(--teal);
  font-size: 16px;
  padding: 14px 32px;
  border-radius: var(--radius);
  font-weight: 700;
  transition: background .15s, box-shadow .15s, transform .1s;
}
.btn-hero:hover {
  background: var(--teal-dark);
  box-shadow: 0 6px 20px rgba(212,160,23,.4);
  transform: translateY(-1px);
}

.btn-hero-ghost {
  background: transparent;
  color: rgba(255,255,255,.8);
  border: 2px solid rgba(255,255,255,.2);
  font-size: 15px;
  padding: 13px 24px;
  border-radius: var(--radius);
  font-weight: 500;
  transition: border-color .15s, color .15s;
}
.btn-hero-ghost:hover { border-color: rgba(255,255,255,.5); color: #fff; }

/* Blocos explicativos */
.home-section { padding: 72px 24px; }
.home-section-inner { max-width: 1060px; margin: 0 auto; }

.section-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--teal-dark);
  margin-bottom: 10px;
}

.section-heading {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.5vw, 38px);
  color: var(--night);
  line-height: 1.2;
  margin-bottom: 14px;
}

.section-lead {
  color: var(--muted);
  font-size: 16px;
  max-width: 580px;
  line-height: 1.75;
  margin-bottom: 48px;
}

/* Cards dos blocos */
.blocks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.block-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  position: relative;
  transition: box-shadow .2s, transform .2s, border-color .2s;
}
.block-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: rgba(212,160,23,.4);
}

.block-card-letter {
  width: 40px;
  height: 40px;
  background: var(--night);
  color: var(--teal);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 20px;
  margin-bottom: 16px;
}

.block-card h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--night);
  margin-bottom: 6px;
}

.block-card p { font-size: 13px; color: var(--muted); line-height: 1.6; }

/* Seção TIES Score */
.ties-explainer {
  background: var(--night);
  padding: 72px 24px;
}
.ties-explainer-inner {
  max-width: 1060px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.ties-explainer .section-heading,
.ties-explainer .section-lead { color: rgba(255,255,255,.9); }
.ties-explainer .section-eyebrow { color: var(--teal); }
.ties-explainer .section-lead { color: rgba(255,255,255,.6); margin-bottom: 0; }

.ties-risk-cards { display: flex; flex-direction: column; gap: 12px; }

.risk-card {
  background: rgba(255,255,255,.05);
  border: 1.5px solid rgba(255,255,255,.1);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.risk-card-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}
.risk-card.baixo   .risk-card-dot { background: var(--success); box-shadow: 0 0 10px rgba(22,163,74,.5); }
.risk-card.moderado .risk-card-dot { background: var(--warning); box-shadow: 0 0 10px rgba(217,119,6,.5); }
.risk-card.alto    .risk-card-dot { background: var(--danger);  box-shadow: 0 0 10px rgba(220,38,38,.5); }
.risk-card-text strong { color: #fff; display: block; font-size: 14px; margin-bottom: 2px; }
.risk-card-text span   { color: rgba(255,255,255,.5); font-size: 12px; }

/* Formulário de cadastro */
.cadastro-section {
  padding: 72px 24px;
  background: var(--bg);
}
.cadastro-inner {
  max-width: 1060px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}

.cadastro-form-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-md);
}

.cadastro-form-card h2 {
  font-family: var(--font-display);
  font-size: 26px;
  color: var(--night);
  margin-bottom: 6px;
}
.cadastro-form-card .sub {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 28px;
}

/* Busca de pacientes */
.search-section {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}
.search-section h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--night);
  margin-bottom: 14px;
}
.search-box {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.search-box input {
  flex: 1;
  padding: 9px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: var(--font-body);
  outline: none;
  transition: border-color .15s;
}
.search-box input:focus { border-color: var(--night-soft); }

.paciente-list { display: flex; flex-direction: column; gap: 8px; }
.paciente-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  transition: background .15s, border-color .15s;
}
.paciente-item:hover { background: var(--bg); border-color: var(--night-soft); }
.paciente-item-name { font-weight: 500; font-size: 14px; color: var(--night); }
.paciente-item-meta { font-size: 12px; color: var(--muted); margin-top: 1px; }
.paciente-empty { text-align: center; color: var(--muted); font-size: 14px; padding: 20px; }

/* ════════════════════════════════════════════════════════════════
   FORMULÁRIOS (campos reutilizados em todos os forms)
   ════════════════════════════════════════════════════════════════ */

.field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 18px;
}

.field-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--night);
}

.field-group input,
.field-group select,
.field-group textarea {
  padding: 9px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}

.field-group input:focus,
.field-group select:focus {
  border-color: var(--night-soft);
  box-shadow: 0 0 0 3px rgba(30,63,107,.1);
  background: var(--surface);
}

.field-group input.field-error,
.field-group.field-error { border-color: var(--danger); }

.field-hint {
  font-size: 12px;
  color: var(--muted);
}

.req { color: var(--danger); margin-left: 2px; }

.field-row { display: flex; flex-direction: column; gap: 0; }

@media (min-width: 600px) {
  .field-row.col-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .field-row.col-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
}

/* Calc display (IMC) */
.calc-display {
  padding: 9px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  background: var(--bg);
  color: var(--muted);
  min-height: 42px;
  display: flex;
  align-items: center;
  transition: background .2s, color .2s, border-color .2s;
}
.calc-ok      { color: var(--success); background: #f0fdf4; border-color: #86efac; }
.calc-warning { color: var(--warning); background: #fffbeb; border-color: #fcd34d; }
.calc-danger  { color: var(--danger);  background: #fef2f2; border-color: #fca5a5; }

/* ════════════════════════════════════════════════════════════════
   FORMULÁRIO MULTI-STEP (nova_avaliacao)
   ════════════════════════════════════════════════════════════════ */

.form-patient-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--night);
  border-radius: var(--radius-lg);
  color: #fff;
  margin-bottom: 24px;
}
.form-patient-avatar {
  width: 38px;
  height: 38px;
  background: var(--teal);
  color: var(--night);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}
.form-patient-bar strong { font-size: 15px; }
.form-patient-bar .text-muted { color: rgba(255,255,255,.55); }

/* Progress steps */
.progress-steps {
  display: flex;
  gap: 4px;
  margin-bottom: 28px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
}

.progress-steps .step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 18px;
  font-family: var(--font-display);
  color: var(--muted);
  cursor: default;
  padding: 6px 4px;
  border-radius: var(--radius);
  transition: background .15s, color .15s;
}
.progress-steps .step span {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.progress-steps .step.done {
  color: var(--teal-dark);
  cursor: pointer;
}
.progress-steps .step.done:hover { background: var(--bg); }
.progress-steps .step.active {
  background: var(--night);
  color: var(--teal);
}

/* Blocos do formulário */
.form-block { display: none; }
.form-block.active { display: block; }

.block-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1.5px solid var(--border);
}

.block-tag {
  width: 44px;
  height: 44px;
  background: var(--night);
  color: var(--teal);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 22px;
  flex-shrink: 0;
}

.block-header h2 { font-size: 20px; font-weight: 700; color: var(--night); margin-bottom: 3px; }
.block-desc { font-size: 13px; color: var(--muted); }

/* Resultado em tempo real */
.rt-result {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  background: var(--night);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin: 20px 0 8px;
}

.rt-item { display: flex; flex-direction: column; gap: 4px; }
.rt-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.45); }
.rt-value { font-size: 15px; font-weight: 700; color: #fff; }
.rt-value.text-success { color: #4ade80; }
.rt-value.text-danger  { color: #f87171; }
.rt-value.text-warning { color: #fbbf24; }

/* Navegação de bloco */
.block-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1.5px solid var(--border);
}

/* Epworth */
.epworth-item {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 10px;
  transition: border-color .15s;
}
.epworth-item:hover { border-color: rgba(11,31,58,.2); }
.epworth-item.field-error { border-color: var(--danger); }
.epworth-label { display: block; font-size: 14px; color: var(--text); margin-bottom: 12px; }

.epworth-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.radio-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 14px;
  transition: border-color .15s, background .15s;
  min-width: 72px;
  text-align: center;
}
.radio-card input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.radio-card .rc-val { font-size: 18px; font-weight: 700; color: var(--night); font-family: var(--font-display); }
.radio-card .rc-txt { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.radio-card:has(input:checked) {
  background: var(--night);
  border-color: var(--night);
}
.radio-card:has(input:checked) .rc-val { color: var(--teal); }
.radio-card:has(input:checked) .rc-txt { color: rgba(255,255,255,.6); }
.radio-card:hover:not(:has(input:checked)) { border-color: var(--night-soft); background: var(--bg); }

/* Berlin */
.berlin-group {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
}
.berlin-cat-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--night);
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.btn-radio-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.btn-radio {
  cursor: pointer;
}
.btn-radio input { position: absolute; opacity: 0; pointer-events: none; }
.btn-radio span {
  display: block;
  padding: 7px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  transition: border-color .15s, background .15s, color .15s;
}
.btn-radio:hover span { border-color: var(--night-soft); background: var(--bg); }
.btn-radio:has(input:checked) span {
  background: var(--night);
  border-color: var(--night);
  color: var(--teal);
  font-weight: 600;
}

/* ISI */
.isi-item {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 10px;
  transition: border-color .15s;
}
.isi-item.field-error { border-color: var(--danger); }
.isi-label { display: block; font-size: 14px; color: var(--text); margin-bottom: 12px; }

.isi-scale {
  display: flex;
  gap: 8px;
}

.scale-option { cursor: pointer; }
.scale-option input { position: absolute; opacity: 0; pointer-events: none; }
.scale-option .scale-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 700;
  color: var(--night);
  transition: border-color .15s, background .15s, color .15s;
}
.scale-option:hover .scale-num { border-color: var(--night-soft); background: var(--bg); }
.scale-option:has(input:checked) .scale-num {
  background: var(--night);
  border-color: var(--night);
  color: var(--teal);
}

/* Revisão */
.ties-preview {
  background: var(--night);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 20px;
}
.tp-loading { color: rgba(255,255,255,.5); font-size: 14px; }
.tp-score {
  font-family: var(--font-display);
  font-size: 64px;
  line-height: 1;
  flex-shrink: 0;
}
.tp-info strong { display: block; font-size: 18px; margin-bottom: 6px; }
.tp-info p { font-size: 13px; color: rgba(255,255,255,.55); }

.review-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 4px;
}
.rv-item {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.rv-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); display: block; margin-bottom: 4px; }
.rv-value { font-size: 14px; font-weight: 600; color: var(--night); }

/* ════════════════════════════════════════════════════════════════
   DASHBOARD DO PACIENTE
   ════════════════════════════════════════════════════════════════ */

.patient-header {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-bottom: 28px;
}
.patient-avatar {
  width: 60px;
  height: 60px;
  background: var(--night);
  color: var(--teal);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 26px;
  flex-shrink: 0;
}
.patient-info h1 { font-size: 26px; font-weight: 700; color: var(--night); }
.patient-meta { color: var(--muted); font-size: 14px; margin-top: 3px; }
.patient-actions { margin-left: auto; }

/* Stats row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 36px;
}
.stat-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stat-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.stat-value { font-size: 22px; font-weight: 700; color: var(--night); }

/* Seção */
.section { margin-bottom: 32px; }
.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--night);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1.5px solid var(--border);
}

/* Lista de avaliações */
.avaliacao-list { display: flex; flex-direction: column; gap: 10px; }

.avaliacao-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: box-shadow .15s, border-color .15s;
}
.avaliacao-card:hover { box-shadow: var(--shadow-sm); border-color: rgba(11,31,58,.2); }

.avaliacao-date {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  min-width: 80px;
}

.avaliacao-metrics {
  display: flex;
  gap: 20px;
  flex: 1;
  flex-wrap: wrap;
}

.metric { display: flex; flex-direction: column; gap: 2px; }
.metric-label { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.metric-value { font-size: 14px; font-weight: 600; color: var(--night); }

.avaliacao-actions { display: flex; gap: 8px; margin-left: auto; }

/* Estado vazio */
.empty-state {
  text-align: center;
  padding: 80px 24px;
}
.empty-icon { font-size: 52px; margin-bottom: 16px; }
.empty-state h2 { font-size: 22px; font-weight: 700; color: var(--night); margin-bottom: 8px; }
.empty-state p  { color: var(--muted); margin-bottom: 28px; }

/* ════════════════════════════════════════════════════════════════
   RESULTADO
   ════════════════════════════════════════════════════════════════ */

.resultado-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}
.resultado-header h1 { font-size: 26px; font-weight: 700; color: var(--night); }
.resultado-actions { display: flex; gap: 8px; }

/* TIES Score principal */
.ties-score-card {
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 28px;
  border: 2px solid;
}
.ties-score-card.ties-baixo    { background: #f0fdf4; border-color: #86efac; }
.ties-score-card.ties-moderado { background: #fffbeb; border-color: #fcd34d; }
.ties-score-card.ties-alto     { background: #fef2f2; border-color: #fca5a5; }

.ties-score-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 10px;
}
.ties-numero {
  font-family: var(--font-display);
  font-size: 56px;
  line-height: 1;
  flex-shrink: 0;
}
.ties-score-card.ties-baixo    .ties-numero { color: var(--success); }
.ties-score-card.ties-moderado .ties-numero { color: var(--warning); }
.ties-score-card.ties-alto     .ties-numero { color: var(--danger); }

.ties-titulo { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 4px; }
.ties-class  { font-size: 18px; font-weight: 700; color: var(--night); }
.ties-recomendacao { font-size: 14px; color: var(--muted); }

/* Grid de resultados */
.resultado-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.resultado-bloco {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
}
.resultado-bloco h3 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.bloco-metricas {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.bm {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.bm-label { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.bm-value { font-size: 18px; font-weight: 700; color: var(--night); }
.bm-destaque .bm-value { font-size: 22px; }
.bm-danger  .bm-value { color: var(--danger); }
.bm-success .bm-value { color: var(--success); }

.bloco-status { font-size: 13px; font-weight: 500; }

/* Condutas */
.condutas-section {
  background: #fff7ed;
  border-left: 4px solid var(--warning);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  padding: 24px 28px;
  margin-bottom: 28px;
}
.condutas-section h2 { font-size: 16px; font-weight: 700; color: #92400e; margin-bottom: 14px; }
.condutas-list { padding-left: 18px; display: flex; flex-direction: column; gap: 8px; }
.condutas-list li { font-size: 14px; color: #78350f; }

.resultado-footer-nav { padding-top: 12px; }

/* ════════════════════════════════════════════════════════════════
   RESPONSIVO
   ════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .container { padding: 24px 16px 60px; }

  .topbar { padding: 0 16px; }

  /* Home */
  .ties-explainer-inner { grid-template-columns: 1fr; gap: 36px; }
  .cadastro-inner { grid-template-columns: 1fr; gap: 28px; }

  /* Dashboard */
  .patient-header { flex-wrap: wrap; }
  .patient-actions { margin-left: 0; }
  .avaliacao-card { flex-direction: column; align-items: flex-start; }
  .avaliacao-actions { margin-left: 0; }
  .stats-row { grid-template-columns: 1fr 1fr; }

  /* Resultado */
  .resultado-grid { grid-template-columns: 1fr; }
  .resultado-header { flex-direction: column; }
  .ties-score-inner { flex-direction: column; align-items: flex-start; gap: 12px; }
  .ties-numero { font-size: 44px; }

  /* Formulário */
  .progress-steps .step span { display: none; }
  .epworth-options { gap: 6px; }
  .radio-card { min-width: 60px; padding: 6px 10px; }
  .isi-scale { gap: 5px; }
  .scale-option .scale-num { width: 36px; height: 36px; font-size: 14px; }
  .review-grid { grid-template-columns: 1fr; }
  .ties-preview { flex-direction: column; align-items: flex-start; gap: 12px; }
  .tp-score { font-size: 48px; }
}

@media (max-width: 480px) {
  .blocks-grid { grid-template-columns: 1fr 1fr; }
  .stats-row { grid-template-columns: 1fr; }
  .hero { padding: 52px 16px 60px; }
  .hero-logo { width: 120px; height: 120px; }
}

/* ── Reduced motion ──────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; }
}
