/* Instituto Castro — Portal de Resultados.
   Linguagem visual: card navy de cantos largos sobre fundo claro, eyebrow com
   fio dourado, título DM Serif Display com accent em dourado ITÁLICO, botões
   pílula em caixa normal, logo à direita. (Referência: hero "Boa tarde, equipe") */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&family=DM+Serif+Display:ital@0;1&display=swap');

:root {
  --navy: #0e1c33;
  --navy-2: #16294a;
  --blue: #1f4e79;
  --blue-l: #2e6da4;
  --gold: #d2ab5f;
  --gold-d: #b8933f;
  --amber: #f39c12;
  --green: #27ae60;
  --red: #d1495b;
  --bg: #f2f3f0;
  --card: #ffffff;
  --ink: #1a2332;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --line: #e2e8f0;
  --shadow: 0 1px 2px rgba(14, 28, 51, 0.06), 0 10px 30px rgba(14, 28, 51, 0.08);
  --serif: 'DM Serif Display', 'Cormorant Garamond', Georgia, serif;
  --sans: 'DM Sans', -apple-system, system-ui, 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); }

.wrap { max-width: 1140px; margin: 0 auto; padding: 18px 20px 40px; }

/* ---- Eyebrow com fio dourado (assinatura da referência) ---- */
.eyebrow-dash {
  display: flex; align-items: center; gap: 12px;
  font-size: 12px; font-weight: 600; letter-spacing: 2.6px;
  text-transform: uppercase; color: rgba(255,255,255,.75);
}
.eyebrow-dash::before {
  content: ''; width: 34px; height: 2px; background: var(--gold); flex: 0 0 auto;
}
.eyebrow { /* variante para fundos claros (login) */
  font-size: 11px; font-weight: 700; letter-spacing: 1.6px;
  text-transform: uppercase; color: var(--slate-400);
}

/* Accent dourado itálico dentro de títulos serif */
.gold-italic { font-family: var(--serif); font-style: italic; color: var(--gold); font-weight: 400; }

/* ---- Header interno: card navy de cantos largos ---- */
.topbar {
  max-width: 1140px;
  margin: 20px auto 0;
  background: var(--navy);
  color: #fff;
  border-radius: 24px;
  padding: 30px 36px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: var(--shadow);
}
@media (max-width: 1180px) { .topbar { margin-left: 16px; margin-right: 16px; } }
.topbar .topbar-text { min-width: 0; }
.topbar h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(26px, 3.4vw, 34px);
  margin: 10px 0 0;
  letter-spacing: -.2px;
  line-height: 1.12;
}
.topbar .sub {
  font-size: 12px; letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--slate-400); margin-top: 8px;
}
.topbar .spacer { flex: 1; }
.topbar .pill {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.22);
  padding: 9px 18px; border-radius: 999px;
  font-size: 13.5px; font-weight: 600;
  color: #fff; white-space: nowrap;
}
a.pill:hover { background: rgba(255,255,255,.14); }
.topbar .logo { flex: 0 0 auto; }
.topbar .logo img { height: 62px; width: auto; display: block; }

/* ---- Abas penduradas no card navy ---- */
.tabs {
  max-width: 1140px;
  margin: 0 auto;
  background: var(--navy);
  border-radius: 0 0 24px 24px;
  padding: 0 26px 6px;
  display: flex;
  gap: 6px;
  box-shadow: var(--shadow);
  overflow-x: auto;
}
@media (max-width: 1180px) { .tabs { margin-left: 16px; margin-right: 16px; } }
.topbar.has-tabs { border-radius: 24px 24px 0 0; box-shadow: none; padding-bottom: 22px; }
.tabs a {
  display: inline-block;
  padding: 11px 18px 13px;
  color: rgba(255,255,255,.6);
  text-decoration: none;
  font-size: 14px; font-weight: 500;
  border-bottom: 2.5px solid transparent;
  white-space: nowrap;
}
.tabs a.ativa {
  color: #fff;
  border-bottom-color: var(--gold);
}
.tabs a:hover { color: #fff; }

/* ---- Card-aviso do prazo (navy, serif, dourado) ---- */
.hero {
  background: var(--navy);
  color: #fff;
  border-radius: 20px;
  padding: 22px 28px;
  margin: 18px 0;
  box-shadow: var(--shadow);
}
.hero .titulo {
  font-family: var(--serif);
  font-size: 19px;
  display: flex; align-items: center; gap: 8px;
}
.hero .frase { margin-top: 6px; font-size: 15px; color: rgba(255,255,255,.78); }
.hero .frase b { color: #fff; }
.hero .destaque { color: var(--gold); font-weight: 600; }

/* ---- Cards brancos ---- */
.card {
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 22px 24px;
  margin-bottom: 16px;
}
.card.accent-green { border-left: 4px solid var(--green); }
.card.accent-amber { border-left: 4px solid var(--gold); }

h2.section {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--ink);
  font-size: 22px;
  margin: 24px 0 6px;
}
.card h2.section { margin-top: 0; }

/* ---- Grid de unidades ---- */
.unidades-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; margin-top: 16px; }
.unidade-tile {
  text-decoration: none; color: var(--ink);
  background: var(--card); border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 18px 20px;
  display: flex; align-items: center; gap: 12px;
  border: 1px solid transparent;
  transition: transform .12s, box-shadow .12s, border-color .12s;
}
.unidade-tile:hover { transform: translateY(-2px); box-shadow: 0 12px 34px rgba(14,28,51,.14); border-color: var(--gold); }
.unidade-tile .dot { display: none; }
.unidade-tile .n { font-weight: 700; font-size: 15.5px; }
.unidade-tile .c {
  margin-left: auto;
  font-size: 12px; font-weight: 600;
  color: var(--slate-500);
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 13px;
  transition: all .12s;
}
.unidade-tile:hover .c { color: var(--navy); border-color: var(--gold); background: rgba(210,171,95,.10); }

/* ---- Botões-pílula (caixa normal, como a referência) ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--navy); color: #fff; border: none; border-radius: 999px;
  padding: 12px 24px;
  font-family: var(--sans);
  font-size: 14.5px; font-weight: 600;
  cursor: pointer; transition: background .12s, transform .12s;
  text-decoration: none;
}
.btn:hover { background: var(--navy-2); }
.btn.gold { background: var(--gold); color: var(--navy); }
.btn.gold:hover { background: var(--gold-d); }
.btn.green { background: var(--green); }
.btn.green:hover { background: #1f9d52; }
.btn.ghost { background: transparent; color: var(--navy); border: 1.5px solid #cfd6de; }
.btn.ghost:hover { border-color: var(--navy); background: #fff; }
.btn.ghost-dark { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.30); }
.btn.ghost-dark:hover { background: rgba(255,255,255,.10); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---- Dropzone ---- */
.dropzone {
  border: 2px dashed var(--slate-400); border-radius: 16px;
  padding: 38px; text-align: center; color: var(--slate-500);
  background: #fbfbf9; cursor: pointer; transition: background .12s, border-color .12s;
}
.dropzone.drag, .dropzone:hover { background: #f6f4ee; border-color: var(--gold); }
.dropzone .big { font-size: 34px; }
.dropzone b { color: var(--navy); }

/* ---- Chips de resumo ---- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  background: var(--bg); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 13px; font-size: 12.5px; font-weight: 500; color: var(--ink);
}
.chip b { color: var(--gold-d); }

/* ---- Conferência ---- */
.confere { border-radius: 12px; padding: 12px 16px; font-size: 14px; margin: 12px 0 0; font-weight: 500; }
.confere.ok { background: rgba(39,174,96,.08); border: 1px solid rgba(39,174,96,.4); color: #1e8449; }
.confere.bad { background: rgba(209,73,91,.07); border: 1px solid rgba(209,73,91,.4); color: var(--red); }

/* ---- Cabeçalho de dia + tag de prazo ---- */
.dia-header { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 26px 0 10px; }
.dia-header h3 { margin: 0; font-family: var(--serif); font-weight: 400; color: var(--ink); font-size: 21px; }
.dia-header .prazo-tag {
  font-size: 11.5px; padding: 6px 14px; border-radius: 999px; font-weight: 700;
}
.prazo-tag.no-prazo { background: rgba(39,174,96,.12); color: #1e8449; }
.prazo-tag.proximo { background: rgba(210,171,95,.18); color: #8d6a1e; }
.prazo-tag.atrasado { background: rgba(209,73,91,.12); color: var(--red); }
.dia-header .count { color: var(--slate-500); font-size: 13px; }

/* Título de unidade nas listagens */
h3.unidade-heading {
  font-family: var(--serif); font-weight: 400; font-size: 21px;
  color: var(--ink); margin: 28px 0 2px;
}
h3.unidade-heading .qtd { font-family: var(--sans); font-size: 13px; color: var(--slate-500); }

/* ---- Tabela de exames ---- */
table.exames {
  width: 100%; border-collapse: collapse; background: var(--card);
  border-radius: 16px; overflow: hidden; box-shadow: var(--shadow);
}
table.exames th {
  text-align: left; background: var(--navy); color: rgba(255,255,255,.85);
  font-weight: 700; font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.2px;
  padding: 12px 14px;
}
table.exames td { padding: 12px 14px; border-top: 1px solid #eef1f4; font-size: 14px; }
table.exames tr:nth-child(even) td { background: #fafaf8; }
table.exames .tipo-badge {
  display: inline-block; background: var(--bg); border: 1px solid var(--line);
  color: var(--navy); border-radius: 999px; padding: 3px 11px; font-size: 12px; font-weight: 500;
}
table.exames .tipo-badge.incerto { border-color: var(--red); color: var(--red); background: rgba(209,73,91,.06); }
table.exames .paciente { font-weight: 700; color: var(--ink); }
table.exames .cpf { color: var(--slate-500); font-variant-numeric: tabular-nums; font-size: 13px; }
table.exames .btn { padding: 8px 16px; font-size: 12.5px; }

/* ---- Login (card central) ---- */
.login-box { max-width: 410px; margin: 46px auto; padding: 34px 30px; text-align: center; border-radius: 22px; }
.login-box .logo-login {
  width: 68px; height: 68px; border-radius: 18px; background: var(--navy);
  display: grid; place-items: center; margin: 0 auto 16px;
}
.login-box .logo-login img { height: 44px; width: auto; display: block; }
.login-box h2.section { font-size: 24px; margin: 0 0 2px; }
.login-box .eyebrow { display: block; margin-bottom: 22px; }
.login-box label {
  display: block; text-align: left;
  font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--slate-500); margin: 14px 0 6px;
}
.login-box input {
  width: 100%; padding: 13px 14px; border: 1.8px solid var(--line); border-radius: 12px;
  font-family: var(--sans); font-size: 15px; text-align: center; letter-spacing: 2px;
  outline: none; transition: border-color .12s;
}
.login-box input:focus { border-color: var(--gold); }
.login-box .btn { width: 100%; margin-top: 18px; }
.login-box .erro { color: var(--red); font-size: 13px; min-height: 20px; margin-top: 10px; }

/* ---- Landing: hero navy sobre fundo claro (como a referência) ---- */
.wrap-landing { max-width: 1240px; margin: 0 auto; padding: 26px 20px 30px; }
.hero-card {
  background: var(--navy);
  border-radius: 28px;
  box-shadow: var(--shadow);
  color: #fff;
  padding: clamp(36px, 5vw, 64px) clamp(28px, 5vw, 72px);
  display: flex; align-items: center; gap: 40px;
}
.hero-card .hero-text { flex: 1 1 auto; min-width: 0; }
.hero-title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(40px, 5.6vw, 64px);
  line-height: 1.06; letter-spacing: -.5px;
  margin: 20px 0 0; color: #fff;
}
.hero-sub {
  margin: 20px 0 0; max-width: 520px;
  font-size: 17px; line-height: 1.6; color: rgba(255,255,255,.72);
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 30px; }
.hero-actions .btn { font-size: 15px; padding: 13px 26px; }
.hero-logo { flex: 0 0 auto; text-align: center; }
.hero-logo img { height: clamp(150px, 20vw, 230px); width: auto; }
@media (max-width: 860px) { .hero-logo { display: none; } }

.landing-features {
  display: flex; gap: 16px; flex-wrap: wrap;
  margin: 22px auto 0; max-width: 1240px;
}
.landing-features .feat {
  flex: 1 1 240px;
  background: var(--card);
  border-radius: 18px; padding: 22px 22px;
  box-shadow: var(--shadow);
}
.landing-features .fi { font-size: 24px; margin-bottom: 10px; }
.landing-features .ft {
  font-size: 11.5px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--navy); margin-bottom: 5px;
}
.landing-features .fd { font-size: 14px; color: var(--slate-500); line-height: 1.55; }

/* ---- utilitários ---- */
.muted { color: var(--slate-500); }
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.hidden { display: none !important; }
.footer {
  display: flex; align-items: center; justify-content: center; gap: 22px; flex-wrap: wrap;
  text-align: center; color: var(--slate-400); font-size: 12.5px; padding: 28px 20px;
}
.footer a { color: var(--slate-500); text-decoration: none; border-bottom: 1px dotted var(--slate-400); }
.footer a:hover { color: var(--navy); }

@media print {
  .topbar, .tabs, .btn, .dropzone, .no-print, .hero-card, .landing-features { display: none !important; }
  body { background: #fff; }
  .card, table.exames { box-shadow: none; border: 1px solid #ddd; }
  .hero { background: #fff; color: #000; border: 1px solid #ddd; }
  .hero .destaque, .hero .frase { color: #000; }
}
