/* ===================== RESET / BASE ===================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #F5F3EB;
  font-family: 'Instrument Sans', system-ui, sans-serif;
  color: #1C1C1B;
  -webkit-font-smoothing: antialiased;
}

a {
  color: #5A693A;
}

a:hover {
  color: #48552E;
}

input::placeholder {
  color: #A39A8F;
}

/* ===================== KEYFRAMES ===================== */
@keyframes aiGlow {
  0%, 100% { box-shadow: 0 20px 44px rgba(28,28,27,0.22), 0 0 0 rgba(157,179,106,0); }
  50% { box-shadow: 0 20px 44px rgba(28,28,27,0.22), 0 0 46px rgba(157,179,106,0.28); }
}
@keyframes aiNodePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(157,179,106,0.45); }
  50% { box-shadow: 0 0 0 6px rgba(157,179,106,0); }
}
@keyframes waveBar {
  0%, 100% { transform: scaleY(0.35); }
  50% { transform: scaleY(1); }
}
@keyframes dashFlow {
  to { stroke-dashoffset: -24; }
}
@keyframes dotGlow {
  0%, 100% { opacity: 0.55; r: 4; }
  50% { opacity: 1; r: 5.5; }
}

/* ===================== HOVER STATES ===================== */
/* Cada classe corresponde a um estado hover distinto extraído do arquivo original (.dc) */

.hv-navlink:hover { opacity: 1; color: #1C1C1B; }
.hv-fade:hover { opacity: 1; }
.hv-dark-to-accent:hover { background: #5A693A; color: #F5F3EB; }
.hv-primary:hover { background: #48552E; color: #F5F3EB; }
.hv-outline-fade:hover { border-color: rgba(28,28,27,0.4); }
.hv-lift:hover { transform: translateY(-6px); }
.hv-lift-shadow:hover { transform: translateY(-6px); box-shadow: 0 24px 48px rgba(28,28,27,0.12); }
.hv-accent-text:hover { color: #5A693A; }
.hv-bg-accent:hover { background: #5A693A; }
.hv-feature-card:hover { transform: translateY(-6px); border-color: #5A693A; box-shadow: 0 20px 40px rgba(28,28,27,0.12); }
.hv-pill-invert:hover { background: #5A693A; color: #F5F3EB; border-color: #5A693A; }
.hv-outline-light:hover { border-color: #F5F3EB; }
.hv-outline-dark:hover { border-color: #1C1C1B; }
.hv-underline-light:hover { color: #F5F3EB; border-bottom-color: #F5F3EB; }
.hv-footer-link:hover { color: #F5F3EB; }

/* ===================== FORM ===================== */
.input-field:focus {
  border-color: #5A693A;
}

/* ===================== WEBCHAT (Assistente IA) ===================== */
.pw-root {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  font-family: 'Instrument Sans', system-ui, sans-serif;
}

/* --- Launcher --- */
.pw-launcher {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 11px 20px 11px 13px;
  border: none;
  cursor: pointer;
  border-radius: 999px;
  background: linear-gradient(135deg, #5A693A 0%, #48552E 100%);
  box-shadow: 0 14px 32px rgba(28,28,27,0.28);
  color: #F5F3EB;
  font-family: 'General Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  animation: pwGlow 3.2s ease-in-out infinite;
}
.pw-launcher:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 40px rgba(28,28,27,0.34);
}
.pw-launcher-avatar {
  position: relative;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  background: rgba(245,243,235,0.16);
  display: flex;
  align-items: center;
  justify-content: center;
}
.pw-launcher-avatar svg { width: 19px; height: 19px; }
.pw-online-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #9DB36A;
  border: 2px solid #48552E;
  animation: pwPulseDot 2s ease-in-out infinite;
}
.pw-launcher-label { white-space: nowrap; }

@keyframes pwGlow {
  0%, 100% { box-shadow: 0 14px 32px rgba(28,28,27,0.28), 0 0 0 rgba(157,179,106,0); }
  50% { box-shadow: 0 14px 32px rgba(28,28,27,0.28), 0 0 34px rgba(157,179,106,0.42); }
}
@keyframes pwPulseDot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(157,179,106,0.55); }
  50% { box-shadow: 0 0 0 6px rgba(157,179,106,0); }
}

/* --- Panel --- */
.pw-panel {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 384px;
  max-width: calc(100vw - 32px);
  height: 588px;
  max-height: calc(100vh - 48px);
  background: #FFFFFF;
  border-radius: 22px;
  box-shadow: 0 30px 70px rgba(28,28,27,0.24);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform-origin: bottom right;
  opacity: 0;
  transform: translateY(14px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.24s ease, transform 0.24s cubic-bezier(0.22,1,0.36,1);
}
.pw-root.pw-open .pw-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.pw-root.pw-open .pw-launcher {
  opacity: 0;
  transform: translateY(10px) scale(0.9);
  pointer-events: none;
}

/* Header */
.pw-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: linear-gradient(135deg, #5A693A 0%, #48552E 100%);
  color: #F5F3EB;
}
.pw-header-avatar {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  background: rgba(245,243,235,0.16);
  display: flex;
  align-items: center;
  justify-content: center;
}
.pw-header-avatar svg { width: 22px; height: 22px; }
.pw-header-info { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.pw-header-name {
  font-family: 'General Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
}
.pw-header-status {
  font-size: 12.5px;
  color: rgba(245,243,235,0.82);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pw-header-status::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #9DB36A;
  animation: pwPulseDot 2s ease-in-out infinite;
}
.pw-close {
  margin-left: auto;
  width: 32px; height: 32px;
  flex: none;
  border: none;
  border-radius: 50%;
  background: rgba(245,243,235,0.12);
  color: #F5F3EB;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s ease;
}
.pw-close:hover { background: rgba(245,243,235,0.24); }
.pw-close svg { width: 16px; height: 16px; }

/* Messages */
.pw-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #FBFAF5;
  scroll-behavior: smooth;
}
.pw-messages::-webkit-scrollbar { width: 7px; }
.pw-messages::-webkit-scrollbar-thumb { background: rgba(28,28,27,0.14); border-radius: 999px; }

.pw-msg {
  max-width: 84%;
  padding: 11px 14px;
  font-size: 14px;
  line-height: 1.5;
  color: #1C1C1B;
  animation: pwMsgIn 0.28s ease;
}
.pw-msg-bot {
  align-self: flex-start;
  background: #F5F3EB;
  border: 1px solid rgba(28,28,27,0.08);
  border-radius: 14px 14px 14px 4px;
}
.pw-msg-user {
  align-self: flex-end;
  background: rgba(90,105,58,0.14);
  border: 1px solid rgba(90,105,58,0.25);
  border-radius: 14px 14px 4px 14px;
}
@keyframes pwMsgIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Typing indicator */
.pw-typing {
  align-self: flex-start;
  display: inline-flex;
  gap: 5px;
  padding: 13px 15px;
  background: #F5F3EB;
  border: 1px solid rgba(28,28,27,0.08);
  border-radius: 14px 14px 14px 4px;
}
.pw-typing span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #9DB36A;
  animation: pwTyping 1.3s ease-in-out infinite;
}
.pw-typing span:nth-child(2) { animation-delay: 0.18s; }
.pw-typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes pwTyping {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* Composer */
.pw-composer {
  border-top: 1px solid rgba(28,28,27,0.08);
  padding: 12px 14px;
  background: #FFFFFF;
}
.pw-input-row {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  background: #F5F3EB;
  border: 1px solid rgba(28,28,27,0.10);
  border-radius: 14px;
  padding: 7px 7px 7px 14px;
  transition: border-color 0.18s ease;
}
.pw-input-row:focus-within { border-color: #5A693A; }
.pw-input {
  flex: 1;
  border: none;
  background: transparent;
  resize: none;
  outline: none;
  font-family: 'Instrument Sans', system-ui, sans-serif;
  font-size: 14.5px;
  line-height: 1.45;
  color: #1C1C1B;
  max-height: 96px;
  padding: 5px 0;
}
.pw-input::placeholder { color: #A39A8F; }
.pw-send {
  flex: none;
  width: 38px; height: 38px;
  border: none;
  border-radius: 11px;
  background: #5A693A;
  color: #F5F3EB;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
}
.pw-send:hover { background: #48552E; }
.pw-send:disabled { opacity: 0.45; cursor: default; }
.pw-send svg { width: 18px; height: 18px; }
.pw-disclaimer {
  margin: 9px 2px 0;
  font-size: 11px;
  line-height: 1.4;
  color: #A39A8F;
  text-align: center;
}

@media (max-width: 480px) {
  .pw-root { right: 16px; bottom: 16px; }
  .pw-launcher-label { display: none; }
  .pw-launcher { padding: 12px; }
  .pw-panel {
    width: calc(100vw - 24px);
    height: calc(100vh - 32px);
    max-height: calc(100vh - 24px);
  }
}

/* ===================== MODAL SIMULADOR IA ===================== */
.ia-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: stretch;
  justify-content: center;
  background: rgba(28,28,27,0.6);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}
.ia-modal-overlay.ia-modal-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.ia-modal-frame-wrap {
  position: relative;
  width: min(1280px, 100vw);
  height: 100%;
  overflow: hidden;
  background: #F5F3EB;
  box-shadow: 0 0 140px rgba(0,0,0,0.55);
  transform: scale(0.98);
  transition: transform 0.32s cubic-bezier(0.22,1,0.36,1);
}
.ia-modal-overlay.ia-modal-open .ia-modal-frame-wrap {
  transform: scale(1);
}
.ia-modal-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  background: #F5F3EB;
}
.ia-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(28,28,27,0.86);
  color: #F5F3EB;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(0,0,0,0.28);
  transition: background 0.18s ease, transform 0.18s ease;
}
.ia-modal-close:hover { background: #5A693A; transform: scale(1.07); }

/* =========================================================
   RESPONSIVIDADE GERAL DA LP
   Os grids/seções usam estilos inline; usamos seletores de
   atributo + !important para reorganizar em tablets e celulares.
   ========================================================= */
html, body { overflow-x: hidden; }
img, svg { max-width: 100%; }
* { min-width: 0; }

/* ---------- TABLET / até 920px ---------- */
@media (max-width: 920px) {
  /* Grids de 2 colunas (texto + visual) viram 1 coluna */
  [style*="grid-template-columns:1.05fr 0.95fr"],
  [style*="grid-template-columns:0.95fr 1.05fr"],
  [style*="grid-template-columns:1fr 0.9fr"],
  [style*="grid-template-columns:0.85fr 1fr"],
  [style*="grid-template-columns:0.92fr 1.08fr"],
  [style*="grid-template-columns:1.1fr 0.9fr"],
  [style*="grid-template-columns:1.4fr 1fr"],
  .pr-split2 {
    grid-template-columns: 1fr !important;
    gap: 40px !important;
  }

  /* Funcionalidades: 4 -> 2 colunas */
  [style*="grid-template-columns:repeat(4,1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Planos: 3 -> 1 coluna, centralizado e sem o card do meio deslocado */
  [style*="grid-template-columns:1fr 1.08fr 1fr"] {
    grid-template-columns: 1fr !important;
    max-width: 460px;
    margin-left: auto !important;
    margin-right: auto !important;
  }
  [style*="translateY(-12px)"] { transform: none !important; }

  /* Header: some com os links do meio e o "Já sou cliente" */
  .pr-navlinks, .pr-hide-mobile { display: none !important; }
  [style*="height:96px"] { height: 74px !important; }

  /* Reduz paddings verticais grandes */
  [style*="padding:96px 32px"] { padding: 64px 26px !important; }
  [style*="padding:40px 32px 36px"] { padding: 44px 26px 40px !important; }
  [style*="padding:96px 32px 104px"] { padding: 64px 26px 72px !important; }
  [style*="padding:88px 32px 40px"] { padding: 60px 26px 36px !important; }
  [style*="padding:44px"] { padding: 30px !important; }
  [style*="padding:40px 34px"] { padding: 34px 28px !important; }

  /* Reduz títulos grandes */
  [style*="font-size:42px"] { font-size: 34px !important; }
  [style*="font-size:40px"] { font-size: 32px !important; }
  [style*="font-size:38px"] { font-size: 30px !important; }
  [style*="font-size:32px"] { font-size: 27px !important; }
}

/* ---------- MOBILE / até 560px ---------- */
@media (max-width: 560px) {
  /* Funcionalidades: 2 -> 1 coluna */
  [style*="grid-template-columns:repeat(4,1fr)"] {
    grid-template-columns: 1fr !important;
  }
  /* Cards da Secretária IA e colunas do footer: 2 -> 1 */
  .pr-cards2, .pr-footer-cols {
    grid-template-columns: 1fr !important;
  }

  /* Paddings ainda menores */
  [style*="padding:96px 32px"] { padding: 46px 18px !important; }
  [style*="padding:40px 32px 36px"] { padding: 32px 18px 36px !important; }
  [style*="padding:96px 32px 104px"] { padding: 46px 18px 60px !important; }
  [style*="padding:88px 32px 40px"] { padding: 48px 18px 32px !important; }
  [style*="padding:44px"] { padding: 24px 20px !important; }
  [style*="padding:40px"] { padding: 26px 22px !important; }
  [style*="padding:36px 30px"] { padding: 28px 24px !important; }
  [style*="padding:40px 34px"] { padding: 28px 24px !important; }

  /* Títulos em telas pequenas */
  [style*="font-size:42px"] { font-size: 28px !important; }
  [style*="font-size:40px"] { font-size: 26px !important; }
  [style*="font-size:38px"] { font-size: 25px !important; }
  [style*="font-size:32px"] { font-size: 24px !important; }
  [style*="font-size:26px"] { font-size: 21px !important; }
  [style*="font-size:19px"] { font-size: 16.5px !important; }

  /* Diagrama "Visão Panorâmica": encolhe o núcleo e as pílulas */
  [style*="width:140px;height:140px"] { width: 104px !important; height: 104px !important; }
  [style*="border-radius:11px;padding:11px 15px"] { padding: 7px 9px !important; }

  /* Formulário: telefone + clínica empilham */
  .pr-form2 { grid-template-columns: 1fr !important; }
}
