/* =========================================================
   Centro Médico Vitalle — Visual v2
   Camada puramente visual. Nenhuma classe/ID usada pelo
   script.js foi removida ou renomeada.
   ========================================================= */

/* ---------- Design tokens ---------- */
:root {
  /* Marca (teal/azul — confiança + cuidado) */
  --brand-700: #0b7d79;
  --brand-600: #0e9f9a;
  --brand-500: #14b8a6;
  --brand-400: #2dd4bf;
  --brand-soft: #e7f7f5;

  --accent-600: #0284c7;
  --accent-500: #0ea5e9;

  --whatsapp: #25d366;
  --whatsapp-dark: #1ebe5d;

  /* Neutros */
  --ink: #0f172a;
  --ink-soft: #334155;
  --muted: #64748b;
  --line: #e6edf2;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --bg: #eef6f6;

  /* Tipografia */
  --font-head: "Poppins", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;

  /* Raios e sombras */
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-pill: 999px;

  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 10px 28px rgba(13, 148, 136, 0.08);
  --shadow-lg: 0 18px 44px rgba(13, 148, 136, 0.14);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --maxw: 600px;

  /* Ícone WhatsApp (mask) */
  --wa-ico: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3E%3Cpath%20d='M19.05%204.91A9.82%209.82%200%200%200%2012.04%202C6.58%202%202.13%206.45%202.13%2011.91c0%201.75.46%203.45%201.32%204.95L2%2022l5.25-1.38a9.9%209.9%200%200%200%204.79%201.22h.01c5.46%200%209.91-4.45%209.91-9.91%200-2.65-1.03-5.14-2.91-7.02zM12.05%2020.15h-.01a8.2%208.2%200%200%201-4.18-1.15l-.3-.18-3.12.82.83-3.04-.2-.31a8.2%208.2%200%200%201-1.26-4.38c0-4.54%203.7-8.23%208.24-8.23%202.2%200%204.27.86%205.82%202.42a8.18%208.18%200%200%201%202.41%205.82c0%204.54-3.69%208.23-8.23%208.23zm4.52-6.16c-.25-.12-1.47-.72-1.69-.81-.23-.08-.39-.12-.56.12-.16.25-.64.81-.79.97-.14.17-.29.19-.54.06-.25-.12-1.05-.39-1.99-1.23-.74-.66-1.23-1.47-1.38-1.72-.14-.25-.01-.38.11-.5.11-.11.25-.29.37-.43.13-.14.17-.25.25-.41.08-.17.04-.31-.02-.43-.06-.12-.56-1.34-.76-1.84-.2-.48-.41-.42-.56-.42-.14-.01-.31-.01-.48-.01-.16%200-.43.06-.66.31-.22.25-.86.85-.86%202.07%200%201.22.89%202.4%201.01%202.56.12.17%201.75%202.67%204.23%203.74.59.26%201.05.41%201.41.52.59.19%201.13.16%201.56.1.48-.07%201.47-.6%201.67-1.18.21-.58.21-1.07.14-1.18-.06-.1-.22-.16-.47-.28z'/%3E%3C/svg%3E");
}

/* ---------- Reset ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1100px 520px at 50% -180px, var(--brand-soft) 0%, transparent 70%),
    var(--bg);
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  padding-bottom: 2.5rem;
}

img {
  max-width: 100%;
  height: auto;
}

/* =========================================================
   HERO / HEADER
   ========================================================= */
.hero {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 2.6rem 1rem 1.4rem;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(420px 220px at 18% 0%, rgba(45, 212, 191, 0.22), transparent 70%),
    radial-gradient(460px 240px at 85% 10%, rgba(14, 165, 233, 0.16), transparent 72%);
  -webkit-mask: linear-gradient(180deg, #000 60%, transparent 100%);
  mask: linear-gradient(180deg, #000 60%, transparent 100%);
}

.header {
  text-align: center;
  max-width: var(--maxw);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fadeInUp 0.7s var(--ease) both;
}

.logo-wrap {
  display: grid;
  place-items: center;
  width: 210px;
  height: 210px;
  margin-bottom: 1rem;
  border-radius: 36px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--line);
}

.logo {
  width: 165px;
  height: auto;
  object-fit: contain;
  background: transparent;
}

.hero-handle,
h1 {
  font-family: var(--font-head);
  font-size: clamp(1.5rem, 5vw, 1.95rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.15;
  min-height: 1.2em;
}

.slogan {
  margin-top: 0.5rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--muted);
}

/* Caret do typewriter (script.js controla o texto) */
.typing-caret::after {
  content: "▍";
  margin-left: 2px;
  color: var(--brand-500);
  animation: blink 1s steps(1, end) infinite;
}

/* =========================================================
   CONVÊNIOS
   ========================================================= */
.convenios {
  width: 100%;
  max-width: var(--maxw);
  padding: 0 1rem;
  text-align: center;
  margin-bottom: 0.4rem;
}

.planos-title {
  font-family: var(--font-head);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.9rem;
}

.planos-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.plano-card {
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 8px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.plano-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.plano-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* =========================================================
   CONTAINER / SEÇÃO
   ========================================================= */
.container {
  width: 100%;
  max-width: var(--maxw);
  padding: 1.4rem 1rem 0;
  animation: fadeInUp 0.6s var(--ease) both;
}

.section-title {
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0.6rem 0 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.section-title::before {
  content: "";
  width: 6px;
  height: 22px;
  border-radius: var(--r-pill);
  background: linear-gradient(180deg, var(--brand-400), var(--brand-600));
}

/* =========================================================
   BOTÃO FALE CONOSCO / WHATSAPP
   (script.js recria este botão como ".fale-cta only-text")
   ========================================================= */
.fale-conosco,
#faleConoscoBtn {
  display: flex;
  justify-content: center;
  margin: 0 0 1.6rem;
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.fale-cta {
  width: 100%;
  gap: 0.6rem;
  padding: 1rem 1.4rem;
  border-radius: var(--r-md);
  border: 0;
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 700;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(135deg, var(--whatsapp), var(--whatsapp-dark));
  box-shadow: 0 10px 24px rgba(37, 211, 102, 0.32);
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease), filter 0.22s var(--ease);
}

.fale-cta .label {
  display: inline-flex;
  align-items: center;
  font-weight: 700;
}

/* Ícone do WhatsApp via mask — funciona mesmo no botão só-texto gerado pelo JS */
.fale-cta .label::before {
  content: "";
  width: 22px;
  height: 22px;
  margin-right: 0.55rem;
  flex: 0 0 22px;
  background-color: currentColor;
  -webkit-mask: var(--wa-ico) center / contain no-repeat;
  mask: var(--wa-ico) center / contain no-repeat;
}

.fale-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(37, 211, 102, 0.4);
  filter: saturate(1.05);
}

.fale-cta:focus-visible {
  outline: 3px solid rgba(37, 211, 102, 0.45);
  outline-offset: 3px;
}

/* Variante antiga de destaque (mantida por segurança) */
.link-button.destaque.fale-cta {
  color: #fff;
}

/* =========================================================
   CARDS / ACCORDION
   IMPORTANTE: a transição de max-height é usada pelo
   script.js (transitionend) para encadear abrir/fechar.
   ========================================================= */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin: 0 0 1rem;
  transition: box-shadow 0.28s var(--ease), transform 0.28s var(--ease), border-color 0.28s var(--ease);
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: #d6e6e6;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 1.05rem 1.25rem;
  background: var(--surface);
  border: 0;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-head);
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--ink);
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.card-header:hover {
  background: var(--surface-2);
  color: var(--brand-700);
}

.card-header:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--brand-400);
}

.card-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.card-title strong {
  font-weight: 600;
}

.card-chevron {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: var(--r-pill);
  background: var(--brand-soft);
  color: var(--brand-700);
  font-size: 1.1rem;
  line-height: 1;
  transition: transform 0.28s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease);
}

.card-header:hover .card-chevron {
  background: var(--brand-500);
  color: #fff;
}

/* JS adiciona .rotated; mantemos também o seletor por aria */
.card-chevron.rotated,
.card-header[aria-expanded="true"] .card-chevron {
  transform: rotate(90deg);
  background: var(--brand-500);
  color: #fff;
}

.card-body,
.subcard {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding: 0 1.25rem;
  pointer-events: none;
  background: var(--surface);
  transition:
    max-height 0.45s var(--ease),
    opacity 0.35s var(--ease),
    padding 0.35s var(--ease);
}

.card-body.expanded,
.subcard.expanded,
.card-body.active {
  max-height: 2200px;
  opacity: 1;
  padding: 1.1rem 1.25rem 1.25rem;
  pointer-events: auto;
  overflow-y: auto;
  border-top: 1px solid var(--line);
}

/* ----- Cards aninhados (JS injeta .card dentro do .subcard) ----- */
.subcard .card {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  box-shadow: none;
  margin: 0 0 0.7rem;
  background: var(--surface-2);
}

.subcard .card:last-child {
  margin-bottom: 0;
}

.subcard .card .card-header {
  background: transparent;
  font-size: 0.98rem;
  padding: 0.85rem 1rem;
}

.subcard .card .card-header:hover {
  background: rgba(20, 184, 166, 0.06);
}

.subcard .card .card-body,
.subcard .card .subcard {
  background: transparent;
}

.subcard .card .card-body.expanded {
  background: var(--surface);
}

/* Esconde o card "Terapias" sem cabeçalho quando vazio (visual) */
.container > .card:has(> .subcard:only-child:empty) {
  display: none;
}

/* ----- Linha de médico / profissional ----- */
.card-body--doctors {
  text-align: left;
}

.doctor-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem;
  margin-bottom: 0.6rem;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.doctor-row:hover {
  border-color: #cfe7e5;
  box-shadow: var(--shadow-sm);
}

.doctor-row--with-button {
  flex-direction: column;
  align-items: stretch;
}

.doctor-avatar,
.card-avatar {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--surface);
  box-shadow: var(--shadow-sm);
}

.doctor-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.doctor-name,
.card-medico-nome {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--ink);
}

.doctor-crm,
.card-medico-crm {
  font-size: 0.82rem;
  color: var(--muted);
}

/* ----- Botões de agendamento (gerados pelo JS) ----- */
.whats-main-btn {
  width: 100%;
  margin-top: 0.7rem;
  padding: 0.85rem 1.1rem;
  border-radius: var(--r-sm);
  border: 1.5px solid rgba(37, 211, 102, 0.4);
  background: rgba(37, 211, 102, 0.08);
  color: #128c43;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.98rem;
  cursor: pointer;
  text-align: center;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}

.whats-main-btn:hover {
  background: var(--whatsapp);
  border-color: var(--whatsapp);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(37, 211, 102, 0.3);
}

.whats-main-btn:active {
  transform: translateY(0);
}

.whats-main-btn-label {
  display: block;
}

.btn-sub {
  display: block;
  font-size: 0.76rem;
  font-weight: 500;
  opacity: 0.85;
  margin-top: 3px;
}

/* Variante secundária / menor */
.whats-main-btn--small,
.whats-main-btn--secondary {
  font-size: 0.9rem;
}

/* =========================================================
   FOOTER
   ========================================================= */
.footer-clean {
  width: 100%;
  max-width: calc(var(--maxw) + 2rem);
  padding: 1.6rem 1rem 0;
  margin-top: 1.4rem;
}

.fc-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: 1.4rem 1.3rem;
}

.fc-topgrid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.2rem;
  text-align: center;
}

.fc-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.35rem;
}

.fc-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand-500);
  box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.16);
}

.fc-icon {
  font-size: 1.05rem;
}

.fc-text {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.fc-link {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 600;
  position: relative;
  transition: color 0.2s var(--ease);
}

.fc-link:hover {
  color: var(--brand-700);
}

.fc-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--brand-500), var(--accent-500));
  transition: width 0.24s var(--ease);
}

.fc-link:hover::after {
  width: 100%;
}

.fc-social {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 0.2rem;
}

.fc-sbtn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}

.fc-sbtn:hover {
  transform: translateY(-3px);
  border-color: #bdeae6;
  box-shadow: var(--shadow-md);
}

.fc-sbtn img {
  width: 20px;
  height: 20px;
}

.fc-mapcard {
  margin-top: 1.3rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface);
}

.fc-mapwrap {
  width: 100%;
  line-height: 0;
}

.map-iframe {
  width: 100%;
  border: 0;
  display: block;
}

.fc-sep {
  border: 0;
  border-top: 1px dashed var(--line);
  margin: 1.3rem 0 0.9rem;
}

.fc-bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.9rem;
}

.fc-credit {
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.6rem;
}

.fc-credit a {
  color: var(--accent-600);
  text-decoration: none;
  font-weight: 600;
}

.fc-credit a:hover {
  text-decoration: underline;
}

/* =========================================================
   ANIMAÇÕES
   ========================================================= */
@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(16px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* =========================================================
   RESPONSIVIDADE
   ========================================================= */
@media (min-width: 768px) {
  .fc-topgrid {
    grid-template-columns: repeat(3, 1fr);
    align-items: start;
  }

  .fc-topgrid .fc-col + .fc-col {
    position: relative;
  }

  .fc-topgrid .fc-col + .fc-col::before {
    content: "";
    position: absolute;
    left: -0.6rem;
    top: 6px;
    bottom: 6px;
    width: 1px;
    background: var(--line);
  }

  .plano-card {
    width: 72px;
    height: 72px;
  }
}

@media (min-width: 560px) {
  .doctor-row--with-button {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .doctor-row--with-button .doctor-info {
    flex: 1 1 auto;
  }
}

/* =========================================================
   ACESSIBILIDADE — preferência por menos movimento
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  /* mantém a transição de max-height para o accordion encadeado do JS */
  .card-body,
  .subcard {
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease !important;
  }

  .typing-caret::after {
    animation: none;
  }
}
