/* ============================================
   Rede Clínicas de Recuperação
   Design Clean: Azul + Branco
   Domínio: https://redeclinicaderecuperacao.com/
   ============================================ */

:root {
  --primary: #0d6efd;
  --primary-dark: #0a58ca;
  --primary-light: #e7f1ff;
  --secondary: #198754;
  --whatsapp: #25d366;
  --text: #212529;
  --text-muted: #6c757d;
  --bg: #ffffff;
  --bg-light: #f8f9fa;
  --border: #dee2e6;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(13, 110, 253, 0.08);
  --shadow-lg: 0 10px 40px rgba(13, 110, 253, 0.12);
  --font: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
}

a { color: var(--primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary-dark); }

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

.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ========== HEADER ========== */
header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,.04);
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
}

.logo img { height: 48px; width: auto; }

nav { display: flex; gap: 28px; align-items: center; }

nav a {
  color: var(--text);
  font-weight: 500;
  font-size: 15px;
}

nav a:hover, nav a.active { color: var(--primary); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 15px;
  border: none;
  cursor: pointer;
  transition: all .25s;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn-whatsapp {
  background: var(--whatsapp);
  color: #fff;
}

.btn-whatsapp:hover {
  background: #1ebe57;
  color: #fff;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: #fff;
}

/* ========== HERO ========== */
.hero {
  background: linear-gradient(135deg, #e7f1ff 0%, #f0f7ff 50%, #ffffff 100%);
  padding: 60px 0 80px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  color: var(--text);
  max-width: 800px;
  margin: 0 auto 16px;
  line-height: 1.25;
}

.hero p {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 32px;
}

.search-box {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 24px;
  max-width: 720px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 12px;
}

.search-box select,
.search-box input {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  background: #fff;
  width: 100%;
}

.search-box select:focus,
.search-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13,110,253,.15);
}

.stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.stat-item { text-align: center; }

.stat-item strong {
  display: block;
  font-size: 1.8rem;
  color: var(--primary);
  font-weight: 700;
}

.stat-item span {
  font-size: 14px;
  color: var(--text-muted);
}

/* ========== SECTIONS ========== */
section { padding: 64px 0; }

.section-title {
  text-align: center;
  margin-bottom: 40px;
}

.section-title h2 {
  font-size: 1.9rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.section-title p {
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto;
}

.bg-light { background: var(--bg-light); }

/* Cards */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: all .3s;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: transparent;
}

.card-body { padding: 20px; }

.card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: var(--text);
}

.card .location {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.card .price {
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 16px;
}

.card-actions {
  display: flex;
  gap: 10px;
}

.card-actions .btn { flex: 1; padding: 10px; font-size: 14px; }

/* Tratamentos */
.treatment-card {
  text-align: center;
  padding: 32px 20px;
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: all .3s;
}

.treatment-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.treatment-card .icon {
  width: 64px;
  height: 64px;
  background: var(--primary-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 28px;
}

.treatment-card h3 { margin-bottom: 10px; font-size: 1.15rem; }
.treatment-card p { color: var(--text-muted); font-size: 14px; margin-bottom: 16px; }

/* Convênios */
.convenios-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.convenio-badge {
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 500;
}

/* FAQ */
.faq-list { max-width: 800px; margin: 0 auto; }

.faq-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}

.faq-item h3 {
  padding: 18px 20px;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0;
}

.faq-item h3::after {
  content: '+';
  font-size: 1.4rem;
  color: var(--primary);
  font-weight: 300;
}

.faq-item.open h3::after { content: '−'; }

.faq-item .answer {
  padding: 0 20px 18px;
  color: var(--text-muted);
  display: none;
}

.faq-item.open .answer { display: block; }

/* Form */
.form-group { margin-bottom: 20px; }

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
  font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13,110,253,.15);
}

.form-group textarea { min-height: 120px; resize: vertical; }

.required { color: #dc3545; }

/* WhatsApp Float — retangular, esquerda, piscante */
.whatsapp-float {
  position: fixed;
  left: 16px;
  bottom: 20px;
  min-width: 0;
  height: auto;
  padding: 12px 16px;
  background: var(--whatsapp);
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(37, 211, 102, .45);
  z-index: 9000;
  text-decoration: none !important;
  color: #fff !important;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  animation: wa-pulse 1.6s ease-in-out infinite;
  transition: transform .2s, box-shadow .2s;
}

.whatsapp-float:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 8px 28px rgba(37, 211, 102, .55);
  color: #fff !important;
}

.whatsapp-float svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.whatsapp-float .wa-text {
  white-space: nowrap;
  color: #fff;
}

@keyframes wa-pulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(37, 211, 102, .35); opacity: 1; }
  50% { box-shadow: 0 4px 28px rgba(37, 211, 102, .75), 0 0 0 8px rgba(37, 211, 102, .2); opacity: .92; }
}

/* Menu toggle (sanduíche) — lado direito */
.menu-toggle {
  display: none;
  position: relative;
  z-index: 1002;
  width: 44px;
  height: 44px;
  border: none;
  background: var(--primary);
  border-radius: 10px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  padding: 0;
  margin-left: auto;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2.5px;
  background: #fff;
  border-radius: 2px;
  transition: transform .25s, opacity .25s;
}

.menu-toggle.active span:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}
.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}
.menu-toggle.active span:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

/* Drawer mobile à direita */
.nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 37, 64, .45);
  z-index: 1000;
}

.nav-backdrop.show { display: block; }

/* Footer */
footer {
  background: #0a2540;
  color: #cbd5e1;
  padding: 48px 0 24px;
}

footer a { color: #94a3b8; }
footer a:hover { color: #fff; }

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 40px;
}

.footer-brand p { margin-top: 12px; font-size: 14px; line-height: 1.7; }

.footer-col h4 {
  color: #fff;
  font-size: 15px;
  margin-bottom: 16px;
}

.footer-col ul { list-style: none; }

.footer-col li { margin-bottom: 8px; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 20px;
  text-align: center;
  font-size: 13px;
}

/* Page content */
.page-hero {
  background: var(--primary-light);
  padding: 40px 0;
  text-align: center;
}

.page-hero h1 { font-size: 1.9rem; margin-bottom: 8px; }
.page-hero p { color: var(--text-muted); }

.content-long {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px;
}

.content-long h2 {
  font-size: 1.5rem;
  margin: 32px 0 16px;
  color: var(--primary-dark);
}

.content-long h3 {
  font-size: 1.2rem;
  margin: 24px 0 12px;
}

.content-long p {
  margin-bottom: 16px;
  color: #374151;
}

.content-long ul, .content-long ol {
  margin: 0 0 20px 24px;
}

.content-long li { margin-bottom: 8px; }

/* Admin */
.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.admin-sidebar {
  background: #0a2540;
  color: #fff;
  padding: 24px 0;
}

.admin-sidebar a {
  display: block;
  padding: 12px 24px;
  color: #94a3b8;
}

.admin-sidebar a:hover,
.admin-sidebar a.active {
  background: rgba(255,255,255,.08);
  color: #fff;
}

.admin-content { padding: 32px; background: var(--bg-light); }

.admin-table {
  width: 100%;
  background: #fff;
  border-radius: var(--radius);
  border-collapse: collapse;
  overflow: hidden;
}

.admin-table th,
.admin-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.admin-table th { background: var(--bg-light); font-weight: 600; }

/* Responsive + menu mobile direita */
@media (max-width: 900px) {
  .search-box {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .menu-toggle {
    display: inline-flex;
  }
  header .container {
    position: relative;
  }
  nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    position: fixed;
    top: 0;
    right: 0;
    width: min(320px, 88vw);
    height: 100vh;
    background: #0a2540;
    padding: 80px 20px 24px;
    box-shadow: -8px 0 32px rgba(0,0,0,.25);
    transform: translateX(105%);
    transition: transform .3s ease;
    z-index: 10050;
    overflow-y: auto;
  }
  nav.open {
    transform: translateX(0);
  }
  nav a {
    color: #e2e8f0 !important;
    padding: 14px 12px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    font-size: 16px;
  }
  nav a:hover,
  nav a.active {
    color: #fff !important;
    background: rgba(255,255,255,.06);
  }
  nav .btn-whatsapp {
    margin-top: 16px;
    justify-content: center;
    border: none;
  }
  .admin-layout { grid-template-columns: 1fr; }
  /* side-menu estados também empilha no mobile */
  .estado-layout { grid-template-columns: 1fr !important; }
  .side-menu { position: static !important; margin-top: 16px; }
}

@media (max-width: 600px) {
  .stats { gap: 24px; }
  .footer-grid { grid-template-columns: 1fr; }
  .whatsapp-float {
    left: 12px;
    bottom: 14px;
    padding: 10px 12px;
    font-size: 13px;
  }
  .whatsapp-float svg { width: 24px; height: 24px; }
  .logo img { height: 40px; }
}


/* Validação busca */
select.field-error,
input.field-error {
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.25) !important;
  outline: none;
}


/* Botão voltar */
.btn-voltar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 12px 0 8px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  color: #0b4f8a;
  background: #e7f1ff;
  border: 1px solid #c5ddf7;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
}
.btn-voltar:hover { background: #0d6efd; color: #fff; border-color: #0d6efd; }

/* Garantir links do menu mobile clicáveis */
header nav a {
  pointer-events: auto !important;
  position: relative;
  z-index: 2;
}
.nav-backdrop {
  pointer-events: auto;
}
header nav.open {
  pointer-events: auto !important;
  z-index: 10050 !important;
}
.menu-toggle {
  z-index: 10060 !important;
}


/* Menu mobile SEMPRE acima do WhatsApp flutuante */
header nav {
  z-index: 10050 !important;
}
header nav.open {
  z-index: 10050 !important;
  pointer-events: auto !important;
}
.nav-backdrop {
  z-index: 10040 !important;
}
.nav-backdrop.show {
  z-index: 10040 !important;
}
.menu-toggle {
  z-index: 10060 !important;
}
.menu-toggle.active {
  z-index: 10060 !important;
}
/* Esconde WhatsApp enquanto o menu mobile está aberto */
body.menu-open .whatsapp-float,
body.menu-open a.whatsapp-float {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
.whatsapp-float {
  z-index: 9000 !important;
}

