:root {
  --primary-color: #104e2d;
  /* Verde Escuro Institucional */
  --primary-light: #1a7a46;
  --primary-cta: #25d366;
  /* Verde WhatsApp */
  --primary-dark: #0a331e;
  --secondary-color: #f4f6f9;
  --accent-color: #ffd700;
  --text-main: #2b2b2b;
  --text-muted: #666;
  --white: #ffffff;
  --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 15px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 20px 25px rgba(0, 0, 0, 0.15);
  --radius: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: "Inter", sans-serif;
  color: var(--text-main);
  background-color: #fafafa;
  margin: 0;
  padding: 0;
  line-height: 1.6;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
  font-family: "Poppins", sans-serif;
  color: var(--primary-dark);
}

/* Header Glassmorphism */
header {
  background-color: rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 0.8rem 0;
  box-shadow: var(--shadow-sm);
  border-bottom: none;
  transition: transform 0.3s ease;
}

header.scrolled {
  padding: 0.5rem 0;
  box-shadow: var(--shadow-md);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 30px;
}

nav a {
  color: var(--text-main);
  text-decoration: none;
  font-weight: 500;
  font-family: "Poppins", sans-serif;
  font-size: 0.95rem;
  position: relative;
  padding: 5px 0;
  transition: var(--transition);
}

nav a::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: var(--primary-color);
  transition: width 0.3s;
}

nav a:hover {
  color: var(--primary-color);
}

nav a:hover::after {
  width: 100%;
}

nav a.btn-cta {
  background-color: var(--primary-cta);
  color: white;
  padding: 8px 20px;
  border-radius: 50px;
  box-shadow: 0 4px 10px rgba(37, 211, 102, 0.3);
}

nav a.btn-cta:hover {
  background-color: #128c7e;
  transform: translateY(-2px);
  color: white;
}

nav a.btn-cta::after {
  display: none;
}

/* Hero Section */
.hero {
  background: linear-gradient(
    135deg,
    var(--primary-dark) 0%,
    var(--primary-color) 100%
  );
  color: white;
  padding: 100px 0 80px;
  border-radius: 0 0 50px 50px;
  position: relative;
  overflow: hidden;
  text-align: center;
}

.hero::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -20%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 60%
  );
  pointer-events: none;
}

.hero h2 {
  color: white;
  font-size: 3.5rem;
  margin-bottom: 1rem;
  font-weight: 700;
  letter-spacing: -1px;
}

.hero p {
  font-size: 1.25rem;
  margin-bottom: 2.5rem;
  opacity: 0.9;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.hero-btn {
  background-color: var(--primary-cta);
  color: white;
  padding: 15px 40px;
  font-size: 1.1rem;
  font-weight: 600;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  transition: var(--transition);
  text-transform: uppercase;
  font-family: "Poppins", sans-serif;
}

.hero-btn:hover {
  background-color: #128c7e;
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Features/Services Section */
.section-title {
  text-align: center;
  margin: 60px 0 40px;
}

.section-title span {
  color: var(--primary-color);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 2px;
}

.section-title h3 {
  font-size: 2.5rem;
  margin-top: 10px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  padding-bottom: 60px;
}

/* Card Moderno */
.card {
  background: white;
  padding: 40px 30px;
  border-radius: var(--radius);
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: var(--primary-color);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.card:hover::before {
  transform: scaleX(1);
}

.card-icon {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 20px;
  background: rgba(16, 78, 45, 0.1);
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition);
}

.card:hover .card-icon {
  background: var(--primary-color);
  color: white;
  transform: rotateY(360deg);
}

.card h4 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 1.5rem;
}

.card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 0;
}

/* Footer */
footer {
  background-color: var(--primary-dark);
  color: rgba(255, 255, 255, 0.8);
  padding: 3rem 0;
  margin-top: auto;
}

/* Utils */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.8s ease-out,
    transform 0.8s ease-out;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* WhatsApp Floating Button */
.whatsapp-float {
  position: fixed;
  width: 60px;
  height: 60px;
  bottom: 20px;
  right: 20px;
  background-color: var(--primary-cta);
  color: #fff;
  border-radius: 50px;
  text-align: center;
  font-size: 30px;
  box-shadow: 2px 2px 3px #999;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.whatsapp-float:hover {
  background-color: #128c7e;
  transform: scale(1.1);
  color: white;
}

.whatsapp-pulse {
  animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
  0% {
    box-shadow: 0 0 0 0px rgba(37, 211, 102, 0.5);
  }

  100% {
    box-shadow: 0 0 0 20px rgba(37, 211, 102, 0);
  }
}

/* Section Accountants */
.section-accountants {
  background-color: #e9ecef;
  padding: 60px 0;
  text-align: center;
  border-radius: var(--radius);
  margin-bottom: 60px;
}

.section-accountants h3 {
  color: var(--primary-dark);
  margin-bottom: 20px;
}

/* =========================================
   RESPONSIVIDADE (Moderno)
   ========================================= */

/* Navbar Styling */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.brand-logo img {
  height: 50px;
  /* Ajuste para mobile */
  vertical-align: middle;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.8rem;
  color: var(--primary-color);
  cursor: pointer;
}

/* Tablets e Smartphones (max-width: 768px) */
@media (max-width: 768px) {
  .mobile-toggle {
    display: block;
    /* Mostra o botão hambúrguer */
  }

  .nav-links {
    display: none;
    /* Esconde o menu por padrão */
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: white;
    flex-direction: column;
    padding: 20px 0;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
    border-top: 2px solid var(--primary-color);
  }

  .nav-links.active {
    display: flex;
    /* Mostra quando ativo via JS */
    animation: slideDown 0.3s ease forwards;
  }

  .nav-links li {
    margin: 15px 0;
  }

  .hero {
    padding: 50px 0;
  }

  .hero h2 {
    font-size: 2rem;
  }

  .cards-grid {
    grid-template-columns: 1fr;
    /* 1 coluna no mobile */
    padding: 0 20px 40px;
  }

  /* Ajuste Gatilho da Lei */
  .container.fade-up[style*="align-items: center"] {
    flex-direction: column-reverse;
    gap: 20px;
  }

  .whatsapp-float {
    z-index: 1001;
  }

  .hero-btn {
    display: inline-block;
    width: 90%;
    /* Largura fluida */
    max-width: 320px;
    /* Limite para não ficar gigante */
    padding: 15px 10px;
    /* Menos padding lateral */
    font-size: 1rem;
    /* Fonte um pouco menor */
    white-space: normal;
    /* Permitir quebra de linha */
    line-height: 1.4;
    z-index: 1001;
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Notebooks (apenas ajustes finos) */
@media (max-width: 992px) {
  .container {
    padding: 0 20px;
  }
}

/* =========================================
   CHAT WIDGET (AI)
   ========================================= */

/* Botão Flutuante */
.chat-widget-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  background-color: var(--primary-cta);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
  cursor: pointer;
  z-index: 1000;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: none;
}

.chat-widget-btn:hover {
  transform: scale(1.1);
}

.chat-widget-btn .icon-close {
  display: none;
}

.chat-widget-btn.active .icon-open {
  display: none;
}

.chat-widget-btn.active .icon-close {
  display: block;
  font-size: 24px;
}

.chat-widget-btn.active {
  background-color: var(--text-muted);
}

/* Janela do Chat */
.chat-window {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 380px;
  height: 550px;
  max-height: 80vh;
  background-color: #fff;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 999;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chat-window.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* Header */
.chat-header {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--primary-light) 100%
  );
  padding: 20px;
  color: white;
  display: flex;
  align-items: center;
  gap: 15px;
}

.chat-avatar {
  position: relative;
  width: 48px;
  height: 48px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.chat-status-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  background-color: #2ecc71;
  border: 2px solid var(--primary-color);
  border-radius: 50%;
}

.chat-info h4 {
  color: white;
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.chat-info p {
  margin: 0;
  font-size: 0.8rem;
  opacity: 0.9;
}

/* Body */
.chat-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background-color: #f5f7fb;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* Messages */
.message {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.95rem;
  line-height: 1.5;
  position: relative;
  word-wrap: break-word; /* Garante que palavras longas quebrem */
  word-break: break-word; /* Compatibilidade extra */
  overflow-wrap: break-word;
}

.message.bot {
  align-self: flex-start;
  background-color: white;
  color: var(--text-main);
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.message.user {
  align-self: flex-end;
  background-color: var(--primary-cta);
  color: white;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 5px rgba(37, 211, 102, 0.2);
}

/* Typing Indicator */
.typing-indicator {
  padding: 10px 15px;
  background-color: white;
  align-self: flex-start;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  display: none;
}

.typing-indicator span {
  display: inline-block;
  width: 6px;
  height: 6px;
  background-color: #ccc;
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out both;
  margin: 0 2px;
}

.typing-indicator span:nth-child(1) {
  animation-delay: -0.32s;
}
.typing-indicator span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes typing {
  0%,
  80%,
  100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

/* Footer (Input) */
.chat-footer {
  padding: 15px;
  background-color: white;
  border-top: 1px solid #eee;
  display: flex;
  gap: 10px;
}

.chat-input {
  flex: 1;
  border: 1px solid #eee;
  border-radius: 25px;
  padding: 12px 20px;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.3s;
}

.chat-input:focus {
  border-color: var(--primary-color);
}

.chat-send-btn {
  width: 45px;
  height: 45px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: transform 0.2s;
}

.chat-send-btn:hover {
  transform: scale(1.05);
}

.chat-send-btn:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
  .chat-window {
    width: 100%;
    height: 100%;
    max-height: 100%;
    bottom: 0;
    right: 0;
    border-radius: 0;
  }

  .chat-widget-btn {
    bottom: 20px;
    right: 20px;
  }

  /* Ajuste Botão Fechar no Mobile (Topo Direito) */
  .chat-widget-btn.active {
    position: fixed;
    top: 20px;
    right: 20px;
    bottom: auto; /* Anula o bottom */
    z-index: 1002; /* Acima de tudo */
    background-color: rgba(0, 0, 0, 0.5); /* Fundo mais discreto */
    color: white;
  }
}
