:root {
  --bg: #ffffff;
  --surface: #f9fafb; /* cinza muito claro */
  --surface-2: #f3f4f6;
  --text: #0b1320; /* texto principal escuro */
  --muted: #4b5563; /* texto secundário */
  /* Brand color set to HEX #607C5D (RGB 96,124,93) */
  --brand: #568261; /* rgb(86,130,97) */
  --brand-700: #4D7458; /* darker approx for hover */
  --brand-900: #415F4A; /* darker approx for header */
  --border: #e5e7eb; /* borda clara */
  --card: #ffffff;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

/* Skip-link para acessibilidade */
.skip-link {
  position: absolute;
  left: -9999px;
  top: -9999px;
  background: var(--brand);
  color: #fff;
  padding: 12px 20px;
  border-radius: 6px;
  z-index: 1000;
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.skip-link:focus {
  left: 16px;
  top: 16px;
  outline: 3px solid #fff;
  outline-offset: 2px;
}

/* Focus indicators para acessibilidade WCAG 2.1 AA */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus,
details summary:focus {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

/* Remove outline default só se estiver usando mouse */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
textarea:focus:not(:focus-visible) {
  outline: none;
}

/* Garante outline visível para navegação por teclado */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

.container { width: min(1120px, 100%); margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20; backdrop-filter: saturate(1.2) blur(8px);
  background: var(--brand);
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; }
.site-header .brand { color: #fff; }
.brand .logo { height: 64px; width: auto; object-fit: contain; border-radius: 6px; box-shadow: var(--shadow); display: block; }
.brand-name { letter-spacing: 0.3px; }

.nav { display: flex; align-items: center; gap: 24px; }
.nav ul { display: none; list-style: none; gap: 18px; padding: 0; margin: 0; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 500; }
.nav a:hover { color: var(--text); }
.site-header .nav a { color: rgba(255,255,255,0.9); }
.site-header .nav a:hover { color: #fff; }
.nav-cta { display: none; gap: 10px; }

.nav-toggle { background: transparent; border: 1px solid var(--border); border-radius: 10px; padding: 8px; display: grid; gap: 4px; }
.nav-toggle span { width: 22px; height: 2px; background: var(--text); display: block; border-radius: 2px; }
.site-header .nav-toggle { border-color: rgba(255,255,255,0.45); }
.site-header .nav-toggle span { background: #fff; }

@media (min-width: 900px) {
  .nav ul { display: flex; }
  .nav-cta { display: flex; }
  .nav-toggle { display: none; }
}

/* Ajuste responsivo do logo no header */
@media (min-width: 768px) {
  .brand .logo { height: 72px; }
}

/* Sections */
.section { padding: 48px 0; }
.section.alt { background: linear-gradient(180deg, #ffffff, #f9fafb); }
.section-header { text-align: center; margin-bottom: 28px; }
.section-header h2 { margin: 0 0 8px; font-size: clamp(1.4rem, 2vw + 0.8rem, 1.9rem); }
.section-header p { margin: 0; color: var(--muted); }

/* Hero */
.hero { padding: clamp(40px, 6vh, 72px) 0 clamp(40px, 6vh, 72px); }
.hero-inner { display: grid; gap: 24px; grid-template-columns: 1fr; align-items: stretch; }
.hero-copy { display: flex; flex-direction: column; justify-content: space-between; }
.hero-copy h1 { margin: 0 0 10px; font-size: clamp(1.6rem, 2.8vw + 0.8rem, 2.4rem); line-height: 1.15; }
.lead { color: var(--muted); font-size: 0.95rem; }
.hero-actions { display: flex; gap: 12px; margin: 18px 0 8px; flex-wrap: wrap; }
.hero-trust { display: grid; gap: 6px; list-style: none; padding: 0; margin: 16px 0 0; color: var(--muted); }
.hero-trust li { font-size: 0.95rem; }
.hero-trust strong { font-size: inherit; font-weight: 600; }

.hero-media { display: block; }
.carousel { position: relative; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--border); background: #fff; width: calc(100% + 180px); margin-left: 0; margin-right: -180px; min-height: 450px; }
.carousel::before { display: none; }
.carousel-track { position: absolute; inset: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 100%; transition: transform 0.35s ease; }
.carousel-slide { position: relative; width: 100%; height: 100%; }
.carousel-slide img, .carousel-slide video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: center center; }
.hero-video { background: #fff; }
.carousel-caption { position: absolute; left: 0; right: 0; bottom: 0; display: grid; gap: 6px; background: linear-gradient(180deg, rgba(11,19,32,0), rgba(11,19,32,0.75)); padding: 24px 16px 16px; border-radius: 0; color: #fff; z-index: 10; }
.carousel-caption p { margin: 0; font-size: 0.95rem; line-height: 1.35; text-shadow: 0 1px 3px rgba(0,0,0,0.5); background: rgba(200,200,200,0.25); padding: 8px 12px; border-radius: 8px; backdrop-filter: blur(4px); }
.caption-chip { align-self: start; display: inline-block; background: rgba(86,130,97,0.9); color: #fff; border: 1px solid rgba(255,255,255,0.3); padding: 4px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .2px; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.carousel-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.9); color: #0b1320; border: 1px solid var(--border); width: 36px; height: 36px; border-radius: 999px; display: grid; place-items: center; font-size: 20px; font-weight: 700; cursor: pointer; box-shadow: var(--shadow); }
.carousel-btn:hover { filter: brightness(0.98); }
.carousel-btn.prev { left: 10px; }
.carousel-btn.next { right: 10px; }
.carousel-dots { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; gap: 8px; justify-content: center; }
.dot { width: 8px; height: 8px; border-radius: 999px; border: 1px solid var(--border); background: rgba(255,255,255,0.9); cursor: pointer; }
.dot.is-active { background: var(--brand); border-color: var(--brand-700); }
.hero-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 18px; box-shadow: var(--shadow); }
.hero-kpi { display: flex; align-items: baseline; justify-content: space-between; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 12px; }
.kpi-label { color: var(--muted); font-size: 0.9rem; }
.kpi-value { font-weight: 700; }
.map-placeholder { height: 180px; border-radius: 12px; background: radial-gradient(600px 200px at 30% 20%, rgba(23,163,74,0.15), rgba(23,163,74,0.05)), linear-gradient(180deg, #ffffff, #f9fafb); border: 1px dashed var(--border); display: grid; place-items: center; color: var(--muted); font-size: 0.95rem; margin: 10px 0; }

@media (min-width: 992px) {
  .hero-inner { grid-template-columns: 1fr 1.3fr; align-items: stretch; }
}

/* Ajuste de âncora considerando altura do header */
.section { scroll-margin-top: var(--header-h, 88px); }

/* Ajuste específico para a seção de contato - scroll para mostrar o título completo */
#contato { scroll-margin-top: 100px; padding-top: 20px; }

/* Cards & grids */
.grid { display: grid; gap: 16px; }
.features { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 18px; }
.pricing { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-top: 18px; align-items: stretch; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 18px; box-shadow: var(--shadow); }
.feature h3 { margin-top: 0; }

.price { position: relative; }
.price .price-value { margin: 6px 0 14px; color: var(--text); }
.price .price-features { margin: 0; padding-left: 18px; color: var(--muted); }
.price .btn-block { width: 100%; margin-top: 14px; }
.price.highlight { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(23,163,74,0.25), var(--shadow); }
.badge { position: absolute; top: -10px; right: 12px; background: var(--brand); color: #fff; padding: 4px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }

/* Steps */
.steps { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.step { display: flex; gap: 12px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.step-num { width: 32px; height: 32px; border-radius: 8px; background: var(--brand-900); display: grid; place-items: center; font-weight: 700; }
.step h3 { margin: 0 0 4px; }
.step p { margin: 0; color: var(--muted); }

/* FAQ */
.faq details { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { color: var(--muted); margin: 10px 0 0; }

/* Form */
.contact-form { max-width: 920px; margin: 0 auto; }
.form-grid { grid-template-columns: 1fr; }
.form-grid .full { grid-column: 1 / -1; }
.contact-form label { display: grid; gap: 6px; font-weight: 600; color: var(--muted); font-size: 0.9rem; }

/* Indicadores de campo obrigatório */
.contact-form abbr {
  color: #dc2626;
  text-decoration: none;
  font-weight: 700;
  cursor: help;
}

/* Helper text para campos */
.contact-form small {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 400;
  margin-top: -2px;
}

input, textarea, select { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px; font: inherit; font-size: 0.95rem; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(23,163,74,0.2); }

.form-actions { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.form-note { color: var(--muted); font-size: 0.9rem; }

@media (min-width: 720px) { .form-grid { grid-template-columns: repeat(2, 1fr); } }

/* Buttons */
.btn { --btn-bg: var(--brand); --btn-fg: #fff; background: var(--btn-bg); color: var(--btn-fg); border: 1px solid transparent; border-radius: 12px; padding: 10px 14px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; box-shadow: var(--shadow); }
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(1px); }
.btn-ghost { --btn-bg: transparent; --btn-fg: var(--text); border-color: var(--border); }
.site-header .btn-ghost { --btn-fg: #fff; border-color: rgba(255,255,255,0.55); }

/* Ajustes de cores quando o menu mobile abre (dropdown branco) */
@media (max-width: 899px) {
  .site-header .nav.open a { color: var(--text); }
  .site-header .nav.open a:hover { color: var(--brand-900); }
  .site-header .nav.open .btn-ghost { --btn-fg: var(--text); border-color: var(--border); }
}
.btn-lg { padding: 12px 18px; font-size: 1.05rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0; background: #ffffff; }
.footer-inner { display: flex; gap: 32px; align-items: start; flex-wrap: wrap; }
.footer-brand { display: grid; gap: 8px; }
.footer-brand img { height: 56px; width: auto; object-fit: contain; border-radius: 8px; }
.footer-nav { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.footer-nav a { color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.footer-nav a:hover { color: var(--text); }
.footer-copy { color: var(--muted); margin-left: auto; max-width: 400px; text-align: right; }

@media (max-width: 767px) {
  .footer-copy { margin-left: 0; text-align: left; width: 100%; }
}

@media (min-width: 768px) {
  .footer-brand img { height: 72px; }
}

/* Como funciona o AgriLens */
.how-it-works { background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%); }
.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; margin-top: 32px; }

.step-card { 
  position: relative;
  background: #ffffff; 
  border: 2px solid var(--border); 
  border-radius: 16px; 
  padding: 28px 20px; 
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.step-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  border-color: var(--brand);
}

.step-number {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 32px;
  background: var(--brand);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  box-shadow: 0 2px 8px rgba(86,130,97,0.3);
}

.step-icon {
  margin: 16px 0 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: float-step 3s ease-in-out infinite;
}

@keyframes float-step {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-6px); }
}

.step-card h3 {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 700;
}

.step-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.how-it-works-cta {
  margin-top: 40px;
  text-align: center;
}

@media (min-width: 640px) {
  .steps-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 992px) {
  .steps-grid { grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .step-card { padding: 32px 18px; }
}

@media (min-width: 1200px) {
  .steps-grid { grid-template-columns: repeat(5, 1fr); gap: 16px; }
  .step-card { padding: 28px 16px; }
}

/* Toast */
#toast { position: fixed; bottom: 16px; right: 16px; background: var(--brand-900); color: #fff; padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); transition: 0.25s ease; pointer-events: none; }
#toast.show { opacity: 1; transform: translateY(0); }

/* Botão Saiba Mais NDVI */
.saiba-mais-btn {
  background: transparent;
  border: none;
  color: var(--brand);
  font-weight: 600;
  cursor: pointer;
  padding: 8px 0;
  margin-top: 12px;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
  position: relative;
}

.saiba-mais-btn:hover {
  color: var(--brand-700);
}

.saiba-mais-btn svg {
  width: 16px;
  height: 16px;
}

/* Feature Cards - Icons */
.card.feature h3 {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-icon {
  flex-shrink: 0;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-4px); }
}

/* Tooltip NDVI */
.card.feature {
  position: relative;
}

/* Overlay tooltip */
.tooltip-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  z-index: 999;
  visibility: visible;
  opacity: 1;
  transition: opacity 0.3s ease-out;
}

.tooltip-overlay[hidden] {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

/* Tooltip NDVI */
.tooltip {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--card);
  border: 2px solid var(--brand);
  border-radius: 16px;
  padding: 28px;
  width: 480px;
  max-width: 92vw;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  text-align: left;
  animation: tooltipSlideIn 0.3s ease-out;
  visibility: visible;
  opacity: 1;
}

.tooltip[hidden] {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  animation: none;
}

@keyframes tooltipSlideIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.tooltip-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s;
}

.tooltip-close:hover {
  background: var(--surface);
  color: var(--text);
}

.tooltip h4 {
  margin: 0 0 12px;
  color: var(--brand);
  font-size: 1.1rem;
}

.tooltip h5 {
  margin: 16px 0 8px;
  color: var(--text);
  font-size: 0.95rem;
}

.tooltip p {
  margin: 8px 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.tooltip ul {
  margin: 8px 0;
  padding-left: 20px;
  list-style: none;
}

.tooltip li {
  margin: 6px 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.tooltip strong {
  color: var(--text);
}

@media (max-width: 768px) {
  .tooltip {
    width: 90vw;
    max-height: 80vh;
    padding: 24px;
  }
}

/* Utilities */
.hidden { display: none !important; }
