/* ============================================================
   PATRIOTA SAÚDE — Design System
   Paleta: navy marinho profundo + dourado, off-white
   Tipografia: Fraunces (display) + Inter (corpo)
   ============================================================ */

:root {
  /* Cores */
  --navy-950: #081521;
  --navy-900: #0c1f30;
  --navy-800: #11293e;
  --navy-700: #17374f;
  --teal-600: #1b7f6f;
  --teal-500: #239985;
  --teal-100: #e3f1ec;
  --gold-500: #c9a659;
  --gold-600: #b6924a;
  --gold-100: #f3ead2;
  --cream-50: #f6f4ef;
  --cream-100: #efeae0;
  --ink-900: #14202b;
  --ink-600: #46555f;
  --ink-400: #7d8a92;
  --line-200: #dadcd6;
  --white: #ffffff;
  --red-600: #b3433a;
  --green-700: #1c7a4f;
  --amber-600: #a8761f;

  /* Tipografia */
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;

  /* Layout */
  --max-width: 1180px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(8, 21, 33, 0.08);
  --shadow-md: 0 8px 24px rgba(8, 21, 33, 0.14);
  --shadow-lg: 0 20px 48px rgba(8, 21, 33, 0.22);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink-900);
  background: var(--cream-50);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}

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

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  margin: 0 0 0.5em;
  color: var(--navy-950);
  letter-spacing: -0.01em;
}

p { margin: 0 0 1em; color: var(--ink-600); }

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal-600);
  margin-bottom: 14px;
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--teal-600);
}
.hero .eyebrow, .how-section .eyebrow, .form-section .eyebrow { color: var(--gold-500); }
.hero .eyebrow::before, .how-section .eyebrow::before, .form-section .eyebrow::before { background: var(--gold-500); }

/* Foco visível para acessibilidade */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--teal-500);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--navy-950);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--white);
}
.brand-mark {
  height: auto;
  width: 200px;
  flex-shrink: 0;
  object-fit: contain;
}
.brand-tag {
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-500);
  display: block;
  margin-top: 1px;
}
.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--gold-500);
  color: var(--navy-950);
  padding: 11px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  transition: background 0.2s ease, transform 0.2s ease;
}
.header-cta:hover { background: var(--gold-600); transform: translateY(-1px); }

/* ============================================================
   BOTÕES
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  border-radius: 999px;
  padding: 16px 32px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn-primary {
  background: var(--gold-500);
  color: var(--navy-950);
  box-shadow: var(--shadow-md);
}
.btn-primary:hover { background: var(--gold-600); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost {
  background: transparent;
  color: var(--navy-950);
  border: 1.5px solid var(--line-200);
}
.btn-ghost:hover { border-color: var(--navy-950); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn-whatsapp {
  background: #1da851;
  color: var(--white);
  box-shadow: var(--shadow-md);
}
.btn-whatsapp:hover { background: #19c75a; transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn-danger {
  background: transparent;
  color: var(--red-600);
  border: 1.5px solid var(--red-600);
}
.btn-danger:hover { background: var(--red-600); color: var(--white); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  background: var(--navy-950);
  padding: 56px 0 0;
  overflow: hidden;
}
.hero .container {
  display: grid;
  grid-template-columns: 1fr 0.92fr;
  gap: 40px;
  align-items: end;
}
.hero-copy { padding-bottom: 56px; color: var(--white); }
.hero h1 {
  color: var(--white);
  font-size: clamp(2.1rem, 4vw, 3.1rem);
  margin-bottom: 20px;
}
.hero h1 em {
  font-style: normal;
  color: var(--gold-500);
}
.hero-sub {
  font-size: 1.08rem;
  color: rgba(246,244,239,0.72);
  max-width: 460px;
  margin-bottom: 28px;
}
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; margin-bottom: 32px; }
.hero-note { font-size: 0.85rem; color: rgba(246,244,239,0.5); display: flex; align-items: center; gap: 8px; }
.hero-stats {
  display: flex;
  gap: 32px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.12);
}
.hero-stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--white);
}
.hero-stat span { font-size: 0.78rem; color: rgba(246,244,239,0.5); }

.hero-photo { align-self: end; border-radius: var(--radius-lg) var(--radius-lg) 0 0; overflow: hidden; }
.hero-photo img { width: 100%; height: 380px; object-fit: cover; display: block; }

@media (max-width: 880px) {
  .hero .container { grid-template-columns: 1fr; align-items: start; }
  .hero-copy { padding-bottom: 32px; }
  .hero-photo img { height: 260px; border-radius: var(--radius-lg); }
  .hero-stats { gap: 24px; }
}

/* Conexão humana (foto real) */
.human-section { padding: 0; background: var(--cream-50); }
.human-section-inner {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 48px;
  align-items: center;
  padding: 56px 24px 88px;
}
.human-photo { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); }
.human-photo img { width: 100%; height: 360px; object-fit: cover; }
.human-copy { max-width: 480px; }
.human-copy h2 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); }

.trust-photo-banner { border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 48px; box-shadow: var(--shadow-md); }
.trust-photo-banner img { width: 100%; height: 280px; object-fit: cover; }

/* Depoimentos */
.testimonials { background: var(--cream-100); }
.testi-disclosure {
  font-size: 0.74rem;
  color: var(--ink-400);
  text-align: center;
  margin: -24px auto 36px;
  max-width: 520px;
}
.testi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.testi-card { background: var(--white); border: 1px solid var(--line-200); border-radius: var(--radius-md); padding: 26px 24px; }
.testi-stars { color: var(--gold-500); font-size: 0.85rem; margin-bottom: 12px; letter-spacing: 1px; }
.testi-quote { font-size: 0.92rem; color: var(--ink-600); margin-bottom: 16px; }
.testi-author { display: flex; align-items: center; gap: 10px; }
.testi-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--navy-900); color: var(--gold-100);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 600; flex-shrink: 0;
}
.testi-name { font-size: 0.85rem; font-weight: 600; color: var(--navy-950); }
.testi-loc { font-size: 0.76rem; color: var(--ink-400); }

@media (max-width: 880px) {
  .human-section-inner { grid-template-columns: 1fr; text-align: center; }
  .human-copy { margin: 0 auto; }
  .human-photo img { height: 240px; }
  .trust-photo-banner img { height: 180px; }
  .testi-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   SEÇÕES GERAIS
   ============================================================ */
section { padding: 84px 0; }
.section-head { max-width: 620px; margin-bottom: 52px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }

/* Benefícios */
.benefits-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.benefit-card {
  background: var(--white);
  border: 1px solid var(--line-200);
  border-radius: var(--radius-md);
  padding: 32px 28px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.benefit-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.benefit-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--teal-100);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
  color: var(--teal-600);
}
.benefit-card h3 { font-size: 1.12rem; margin-bottom: 8px; }
.benefit-card p { font-size: 0.93rem; margin-bottom: 0; }

@media (max-width: 880px) {
  .benefits-grid { grid-template-columns: 1fr; }
}

/* Como funciona */
.how-section { background: var(--navy-950); color: var(--cream-50); }
.how-section .section-head h2 { color: var(--white); }
.how-section .section-head p { color: rgba(247,245,240,0.6); }
.steps-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  position: relative;
}
.step-card { position: relative; padding-top: 8px; }
.step-num {
  font-family: var(--font-display);
  font-size: 2.6rem;
  color: var(--gold-500);
  opacity: 0.9;
  margin-bottom: 10px;
  line-height: 1;
}
.step-card h3 { color: var(--white); font-size: 1.05rem; margin-bottom: 8px; }
.step-card p { color: rgba(247,245,240,0.55); font-size: 0.9rem; margin-bottom: 0; }

@media (max-width: 880px) {
  .steps-row { grid-template-columns: 1fr 1fr; gap: 32px 24px; }
}
@media (max-width: 540px) {
  .steps-row { grid-template-columns: 1fr; }
}

/* Confiança */
.trust-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  text-align: center;
}
.trust-item {
  padding: 28px 16px;
  border-radius: var(--radius-md);
  background: var(--white);
  border: 1px solid var(--line-200);
}
.trust-item strong { display: block; font-family: var(--font-display); font-size: 1.5rem; color: var(--navy-950); margin-bottom: 4px; }
.trust-item span { font-size: 0.82rem; color: var(--ink-400); }

@media (max-width: 880px) { .trust-grid { grid-template-columns: 1fr 1fr; } }

/* ============================================================
   FORMULÁRIO
   ============================================================ */
.form-section { background: var(--navy-950); }
.form-section .section-head h2 { color: var(--white); }
.form-section .section-head p { color: rgba(246,244,239,0.6); }
.form-shell {
  max-width: 760px;
  margin: 0 auto;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.form-tabs {
  display: flex;
  border-bottom: 1px solid var(--line-200);
}
.form-tab {
  flex: 1;
  padding: 20px;
  text-align: center;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink-400);
  background: var(--cream-50);
  border: none;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.form-tab.active { background: var(--white); color: var(--navy-950); box-shadow: inset 0 -2px 0 var(--gold-500); }

.form-body { padding: 40px; }
@media (max-width: 600px) { .form-body { padding: 28px 22px; } }

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; }
.field-grid .full { grid-column: 1 / -1; }
@media (max-width: 600px) { .field-grid { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-900);
}
.field label .req { color: var(--red-600); margin-left: 2px; }
.field input, .field select, .field textarea {
  font-family: var(--font-body);
  font-size: 0.96rem;
  padding: 13px 14px;
  border: 1.5px solid var(--line-200);
  border-radius: var(--radius-sm);
  background: var(--cream-50);
  color: var(--ink-900);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--teal-500);
  background: var(--white);
  outline: none;
}
.field textarea { resize: vertical; min-height: 90px; }
.field-error {
  font-size: 0.8rem;
  color: var(--red-600);
  display: none;
}
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--red-600); }
.field.invalid .field-error { display: block; }

.form-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal-600);
  margin: 28px 0 16px;
}
.form-section-title:first-child { margin-top: 0; }

.consent-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--cream-100);
  border: 1px solid var(--line-200);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin: 24px 0;
}
.consent-row input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--gold-600); flex-shrink: 0; }
.consent-row label { font-size: 0.85rem; color: var(--ink-600); line-height: 1.5; }
.consent-row a { color: var(--teal-600); text-decoration: underline; }

.form-footer-note { font-size: 0.78rem; color: var(--ink-400); text-align: center; margin-top: 16px; }

.form-alert {
  display: none;
  background: var(--red-600);
  color: var(--white);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-bottom: 20px;
}
.form-alert.show { display: block; }

/* Estado de sucesso */
.success-state { display: none; text-align: center; padding: 56px 40px; }
.success-state.show { display: block; }
.success-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--teal-100);
  color: var(--teal-600);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px;
}
.success-state h3 { font-size: 1.5rem; margin-bottom: 12px; }
.success-state p { max-width: 420px; margin: 0 auto 28px; }
.success-protocol {
  display: inline-block;
  background: var(--cream-100);
  border: 1px solid var(--line-200);
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--ink-600);
  margin-bottom: 24px;
}
.success-protocol strong { color: var(--navy-950); font-family: monospace; }

.success-options { max-width: 360px; margin: 0 auto; }
.success-option-caption { font-size: 0.82rem; color: var(--ink-400); margin: 10px 0 0; }
.success-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0; color: var(--ink-400); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; }
.success-divider::before, .success-divider::after { content: ""; flex: 1; height: 1px; background: var(--line-200); }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { background: var(--navy-950); color: rgba(247,245,240,0.6); padding: 56px 0 28px; }
.footer-top { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; margin-bottom: 36px; }
.footer-brand { font-family: var(--font-display); font-size: 1.2rem; color: var(--white); margin-bottom: 8px; }
.footer-cols { display: flex; gap: 56px; flex-wrap: wrap; }
.footer-col h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(247,245,240,0.4); margin-bottom: 14px; }
.footer-col a, .footer-col p { display: block; font-size: 0.88rem; margin-bottom: 10px; color: rgba(247,245,240,0.7); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 22px; font-size: 0.78rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

/* ============================================================
   UTILIDADES PARA ÁREAS ADMIN/CORRETOR (compartilhado)
   ============================================================ */
.app-shell { display: flex; min-height: 100vh; background: var(--cream-50); }
.app-sidebar {
  width: 240px;
  background: var(--navy-950);
  color: var(--cream-50);
  padding: 28px 20px;
  flex-shrink: 0;
}
.app-sidebar .brand { color: var(--white); margin-bottom: 36px; font-size: 1.1rem; }
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: var(--radius-sm);
  font-size: 0.9rem; font-weight: 500;
  color: rgba(247,245,240,0.7);
  margin-bottom: 4px;
  cursor: pointer;
}
.nav-link:hover, .nav-link.active { background: rgba(255,255,255,0.08); color: var(--white); }
.app-main { flex: 1; padding: 36px 40px; max-width: 1280px; }
.app-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.app-topbar h1 { font-size: 1.5rem; margin: 0; }
.logout-link { font-size: 0.85rem; color: var(--ink-400); cursor: pointer; }
.logout-link:hover { color: var(--red-600); }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 32px; }
.stat-card { background: var(--white); border: 1px solid var(--line-200); border-radius: var(--radius-md); padding: 22px; }
.stat-card span { font-size: 0.78rem; color: var(--ink-400); text-transform: uppercase; letter-spacing: 0.06em; }
.stat-card strong { display: block; font-family: var(--font-display); font-size: 2rem; color: var(--navy-950); margin-top: 6px; }

@media (max-width: 880px) { .stat-grid { grid-template-columns: 1fr 1fr; } }

.data-table-card { background: var(--white); border: 1px solid var(--line-200); border-radius: var(--radius-md); overflow: hidden; }
.table-toolbar { display: flex; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line-200); flex-wrap: wrap; }
.table-toolbar input, .table-toolbar select {
  padding: 9px 12px; border: 1.5px solid var(--line-200); border-radius: var(--radius-sm);
  font-size: 0.88rem; background: var(--cream-50);
}
.table-toolbar input { flex: 1; min-width: 180px; }

table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
thead th {
  text-align: left; padding: 12px 16px; background: var(--cream-100);
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-400);
  border-bottom: 1px solid var(--line-200);
}
tbody td { padding: 14px 16px; border-bottom: 1px solid var(--line-200); color: var(--ink-900); }
tbody tr:hover { background: var(--cream-50); cursor: pointer; }
tbody tr:last-child td { border-bottom: none; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 0.76rem; font-weight: 600; }
.badge-novo { background: var(--teal-100); color: var(--teal-600); }
.badge-andamento { background: var(--gold-100); color: var(--amber-600); }
.badge-contatado { background: #e5e9f0; color: var(--navy-700); }
.badge-confirmado { background: #e2f3e9; color: #1a5c35; }
.badge-enviado_corretor { background: #e8f0fe; color: #1a56db; }
.badge-fechado { background: #e2f3e9; color: var(--green-700); }
.badge-sem_sucesso { background: #fbe7e5; color: var(--red-600); }

.empty-state { text-align: center; padding: 60px 20px; color: var(--ink-400); }

/* Login */
.login-shell {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--navy-950); padding: 24px;
}
.login-card { background: var(--white); border-radius: var(--radius-lg); padding: 44px 38px; max-width: 400px; width: 100%; box-shadow: var(--shadow-lg); }
.login-card .brand { color: var(--navy-950); margin-bottom: 6px; }
.login-card .login-sub { font-size: 0.88rem; color: var(--ink-400); margin-bottom: 28px; }

/* Modal de detalhes */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(12,31,43,0.55);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: 24px;
}
.modal-overlay.show { display: flex; }
.modal-card {
  background: var(--white); border-radius: var(--radius-lg); max-width: 560px; width: 100%;
  max-height: 86vh; overflow-y: auto; padding: 32px;
}
.modal-card h3 { margin-bottom: 4px; }
.modal-close { float: right; cursor: pointer; color: var(--ink-400); font-size: 1.3rem; line-height: 1; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; margin: 20px 0; }
.detail-item span { display: block; font-size: 0.72rem; text-transform: uppercase; color: var(--ink-400); margin-bottom: 3px; }
.detail-item strong { font-size: 0.92rem; color: var(--ink-900); font-weight: 500; }

.status-select { margin: 16px 0; }
.notes-area { width: 100%; min-height: 90px; padding: 12px; border: 1.5px solid var(--line-200); border-radius: var(--radius-sm); font-family: var(--font-body); }

.spinner {
  width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,0.4);
  border-top-color: var(--white); border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 880px) {
  .app-shell { flex-direction: column; }
  .app-sidebar { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; }
  .app-sidebar .brand { margin-bottom: 0; }
  .sidebar-nav { display: flex; gap: 4px; }
  .app-main { padding: 24px 18px; }
}
