/* ==========================================================================
   TBTEC — tbtec.com.br
   Direção: "engenharia clínica" — azul-noite profundo, traço de pulso/fluxo
   Display: Archivo (expanded) · Body: IBM Plex Sans · Utility: IBM Plex Mono
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --bg: #071018;
  --bg-raised: #0c1a28;
  --bg-card: #0a1622;
  --line: rgba(146, 180, 205, 0.14);
  --line-strong: rgba(146, 180, 205, 0.30);
  --pulse: #2ce3c8;
  --pulse-soft: rgba(44, 227, 200, 0.13);
  --signal: #5fa8ff;
  --text: #e9f1f7;
  --text-dim: #9aaebe;
  --text-faint: #6b8091;
  --danger: #ff6b6b;

  --font-display: "Archivo", "Inter", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --max: 1120px;
  --radius: 14px;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* blueprint grid sutil no fundo */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(146, 180, 205, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(146, 180, 205, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 40%, transparent 100%);
}

img, svg { display: block; max-width: 100%; }

a { color: var(--pulse); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

::selection { background: var(--pulse); color: #04241f; }

:focus-visible {
  outline: 2px solid var(--pulse);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Tipografia utilitária ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--pulse);
  margin: 0 0 14px;
}

.eyebrow::before { content: "// "; color: var(--text-faint); }

.display {
  font-family: var(--font-display);
  font-stretch: 118%;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.06;
  margin: 0;
}

.section-head { max-width: 640px; margin-bottom: 48px; }
.section-head h2 { font-size: clamp(28px, 4vw, 40px); }
.section-head p { color: var(--text-dim); margin: 14px 0 0; font-size: 17px; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-stretch: 110%;
  font-weight: 650;
  font-size: 15.5px;
  padding: 13px 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }

.btn-primary {
  background: var(--pulse);
  color: #03211c;
}
.btn-primary:hover { box-shadow: 0 6px 28px rgba(44, 227, 200, 0.35); }

.btn-ghost {
  border-color: var(--line-strong);
  color: var(--text);
  background: transparent;
}
.btn-ghost:hover { border-color: var(--pulse); color: var(--pulse); }

/* ---------- Navegação ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(7, 16, 24, 0.78);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-family: var(--font-display);
  font-stretch: 122%;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.02em;
}
.brand:hover { text-decoration: none; }
.brand svg { width: 26px; height: 26px; }
.brand .tld { color: var(--pulse); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: var(--text-dim);
  font-size: 15px;
  font-weight: 500;
}
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links .btn { padding: 9px 18px; font-size: 14px; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 8px 10px;
  color: var(--text);
  cursor: pointer;
}
.nav-toggle svg { width: 20px; height: 20px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 96px 0 40px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -220px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 560px;
  background:
    radial-gradient(closest-side, rgba(44, 227, 200, 0.14), transparent 70%),
    radial-gradient(closest-side, rgba(95, 168, 255, 0.10), transparent 75%);
  filter: blur(10px);
  z-index: -1;
  pointer-events: none;
}

.hero h1 {
  font-size: clamp(38px, 6.4vw, 72px);
  max-width: 820px;
}
.hero h1 em {
  font-style: normal;
  color: var(--pulse);
}

.hero-sub {
  max-width: 560px;
  color: var(--text-dim);
  font-size: 18px;
  margin: 22px 0 34px;
}

.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; }

/* assinatura: pulso → fluxo de nós */
.pulseflow {
  margin-top: 64px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
}
.pulseflow svg { width: 100%; height: auto; }

.pf-line {
  fill: none;
  stroke: var(--pulse);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pf-track {
  fill: none;
  stroke: rgba(146, 180, 205, 0.18);
  stroke-width: 2;
}
.pf-node circle {
  fill: var(--bg-raised);
  stroke: var(--line-strong);
  stroke-width: 1.5;
}
.pf-node .pf-ico { stroke: var(--text-dim); stroke-width: 1.6; fill: none; }
.pf-node text {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  fill: var(--text-faint);
  text-transform: uppercase;
}
.pf-dot { fill: var(--pulse); }

@keyframes pf-dash {
  from { stroke-dashoffset: 1200; }
  to { stroke-dashoffset: 0; }
}
@keyframes pf-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}
.pf-line {
  stroke-dasharray: 1200;
  animation: pf-dash 4.5s ease-out forwards;
}
.pf-dot { animation: pf-blink 2.4s ease-in-out infinite; }

/* ---------- Faixa de capacidades ---------- */
.caps {
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
}
.caps-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 34px;
  justify-content: space-between;
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.16em;
  color: var(--text-faint);
  text-transform: uppercase;
}
.caps-list b { color: var(--pulse); font-weight: 500; margin-right: 8px; }

/* ---------- Seções ---------- */
.section { padding: 96px 0; }
.section + .section { border-top: 1px solid var(--line); }

/* Serviços */
.svc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.svc-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px 24px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.svc-card:hover {
  border-color: rgba(44, 227, 200, 0.5);
  transform: translateY(-3px);
}
.svc-card .ico {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: var(--pulse-soft);
  display: grid;
  place-items: center;
  margin-bottom: 18px;
}
.svc-card .ico svg {
  width: 22px;
  height: 22px;
  stroke: var(--pulse);
  stroke-width: 1.7;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.svc-card h3 {
  font-family: var(--font-display);
  font-stretch: 112%;
  font-weight: 700;
  font-size: 19px;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.svc-card p { color: var(--text-dim); font-size: 15.5px; margin: 0; }
.svc-card .tag {
  position: absolute;
  top: 22px;
  right: 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--text-faint);
}

/* Clínicas — split com diagrama */
.clinic-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.clinic-points { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 18px; }
.clinic-points li { display: flex; gap: 14px; align-items: flex-start; }
.clinic-points .mark {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  margin-top: 2px;
  border-radius: 8px;
  background: var(--pulse-soft);
  display: grid;
  place-items: center;
}
.clinic-points .mark svg { width: 14px; height: 14px; stroke: var(--pulse); stroke-width: 2.4; fill: none; stroke-linecap: round; }
.clinic-points b { display: block; font-weight: 600; }
.clinic-points span { color: var(--text-dim); font-size: 15px; }

.flow-panel {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
}
.flow-panel .fp-title {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 18px;
}
.flow-panel svg { width: 100%; height: auto; }
.fp-box { fill: var(--bg-raised); stroke: var(--line-strong); stroke-width: 1.2; rx: 8; }
.fp-box-hl { fill: rgba(44, 227, 200, 0.08); stroke: var(--pulse); }
.fp-label {
  font-family: var(--font-mono);
  font-size: 11px;
  fill: var(--text);
  letter-spacing: 0.06em;
}
.fp-sub { font-family: var(--font-mono); font-size: 9px; fill: var(--text-faint); letter-spacing: 0.08em; }
.fp-wire { stroke: var(--line-strong); stroke-width: 1.4; fill: none; }
.fp-wire-hl { stroke: var(--pulse); }

/* Apps */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.app-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.app-icon {
  width: 58px;
  height: 58px;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--pulse), var(--signal));
  display: grid;
  place-items: center;
  box-shadow: 0 8px 24px rgba(44, 227, 200, 0.22);
}
.app-icon svg { width: 30px; height: 30px; stroke: #04241f; stroke-width: 2.2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.app-icon.is-ghost {
  background: var(--bg-raised);
  border: 1px dashed var(--line-strong);
  box-shadow: none;
}
.app-icon.is-ghost svg { stroke: var(--text-faint); }
.app-card h3 {
  font-family: var(--font-display);
  font-stretch: 112%;
  font-weight: 700;
  font-size: 19px;
  margin: 0;
}
.app-card p { color: var(--text-dim); font-size: 15px; margin: 0; flex: 1; }
.store-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.store-badge {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 6px 12px;
}

/* CTA final */
.cta {
  text-align: center;
  padding: 110px 0;
}
.cta h2 { font-size: clamp(30px, 4.6vw, 48px); }
.cta p { color: var(--text-dim); max-width: 520px; margin: 16px auto 34px; }
.cta .mail {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--text-dim);
  margin-top: 22px;
  display: block;
}
.cta .mail a { color: var(--pulse); }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 44px 0;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
  align-items: flex-start;
}
.footer .brand { font-size: 17px; }
.footer-meta {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-faint);
  margin-top: 12px;
  line-height: 2;
}
.footer-links {
  display: flex;
  gap: 26px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.footer-links a { color: var(--text-dim); font-size: 14.5px; }
.footer-links a:hover { color: var(--pulse); }

/* ---------- Páginas internas ---------- */
.page-head {
  padding: 84px 0 44px;
  border-bottom: 1px solid var(--line);
}
.page-head h1 { font-size: clamp(32px, 5vw, 52px); }
.page-head .meta {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-faint);
  margin-top: 18px;
}

.prose {
  max-width: 760px;
  padding: 56px 0 96px;
}
.prose h2 {
  font-family: var(--font-display);
  font-stretch: 112%;
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.01em;
  margin: 48px 0 14px;
  scroll-margin-top: 90px;
}
.prose h2:first-child { margin-top: 0; }
.prose h2 .num {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--pulse);
  font-weight: 500;
  margin-right: 10px;
  letter-spacing: 0.08em;
}
.prose h3 { font-size: 17.5px; font-weight: 600; margin: 28px 0 8px; }
.prose p, .prose li { color: var(--text-dim); }
.prose strong { color: var(--text); font-weight: 600; }
.prose ul { padding-left: 22px; }
.prose li { margin: 6px 0; }
.prose .note {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--pulse);
  border-radius: 10px;
  padding: 16px 18px;
  font-size: 15px;
  margin: 24px 0;
}
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 18px 0; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border: 1px solid var(--line); color: var(--text-dim); vertical-align: top; }
.prose th { color: var(--text); font-weight: 600; background: var(--bg-card); }

/* Cartão de contato (suporte) */
.contact-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin: 32px 0;
  flex-wrap: wrap;
}
.contact-card .ico {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--pulse-soft);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.contact-card .ico svg { width: 22px; height: 22px; stroke: var(--pulse); stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.contact-card .lines { flex: 1; min-width: 220px; }
.contact-card .lines b { display: block; font-size: 17px; }
.contact-card .lines span { color: var(--text-dim); font-size: 14.5px; }

/* FAQ */
.faq { display: grid; gap: 12px; margin: 28px 0; }
.faq details {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 20px;
  transition: border-color 0.2s ease;
}
.faq details[open] { border-color: rgba(44, 227, 200, 0.45); }
.faq summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 0;
  font-weight: 600;
  color: var(--text);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-family: var(--font-mono);
  color: var(--pulse);
  font-size: 19px;
  transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .faq-body { padding: 0 0 18px; color: var(--text-dim); font-size: 15.5px; }
.faq .faq-body p { margin: 0 0 10px; }
.faq .faq-body p:last-child { margin-bottom: 0; }

/* ---------- Animação de entrada ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.rise { animation: rise 0.7s ease-out both; }
.rise-2 { animation-delay: 0.12s; }
.rise-3 { animation-delay: 0.24s; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rise, .rise-2, .rise-3 { animation: none; }
  .pf-line { animation: none; stroke-dasharray: none; }
  .pf-dot { animation: none; }
  .btn, .svc-card { transition: none; }
}

/* ---------- Responsivo ---------- */
@media (max-width: 960px) {
  .svc-grid { grid-template-columns: repeat(2, 1fr); }
  .apps-grid { grid-template-columns: repeat(2, 1fr); }
  .clinic-split { grid-template-columns: 1fr; gap: 44px; }
}

@media (max-width: 720px) {
  .nav-links {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(7, 16, 24, 0.97);
    border-bottom: 1px solid var(--line);
    padding: 10px 24px 20px;
    display: none;
  }
  .nav-links.is-open { display: flex; }
  .nav-links li { padding: 10px 0; }
  .nav-links .btn { margin-top: 8px; justify-content: center; }
  .nav-toggle { display: inline-flex; }

  .hero { padding-top: 64px; }
  .section { padding: 68px 0; }
  .svc-grid, .apps-grid { grid-template-columns: 1fr; }
  .pf-hide-sm { display: none; }
  .footer-inner { flex-direction: column; }
}
