/* ==================================================================
   TRATOREX LP DESIGN SYSTEM — v2.0.0
   Shared CSS for LPs v2 (Café v2.2 / Pecuária v2.0 / Grãos v2.0)
   Built from Tratorex DS in Infusion OS Supabase
   Tokens: TRX Lima + Carbono + Inter + Monument Extended
   Briefing: design_system/dev-briefing-lps-v2.md
   ================================================================== */

/* --- CSS Custom Properties (DS Tokens) --- */
:root {
  /* Primary — TRX Lima (master) */
  --tx-lima:             #C8C010;  /* CTA buttons over dark backgrounds (AAA 9.12:1 vs Carbono) */
  --tx-lima-dark:        #A09810;  /* hover/pressed states */
  --tx-lima-accessible:  #5C5800;  /* text over white (AA 7.37:1) */

  /* Secondary — Carbono */
  --tx-carbon:           #1A1A1A;  /* primary text + backgrounds */
  --tx-carbon-medium:    #282828;  /* dark surface bg */
  --tx-carbon-light:     #404040;  /* dark surface elevated */

  /* Accent — Vertical (semantic) */
  --tx-agro:             #60A078;  /* success / agro vertical */
  --tx-maquina:          #E80818;  /* error / urgência */
  --tx-parafuso:         #2098C0;  /* info */
  --tx-parceira:         #E0A010;  /* warning */

  /* Neutrals */
  --tx-white:            #FFFFFF;
  --tx-surface-light:    #F5F5F5;
  --tx-border-gray:      #E0E0E0;
  --tx-text-gray:        #666666;
  --tx-text-gray-2:      #4A4A4A;

  /* Gradients */
  --tx-gradient-dark:    linear-gradient(180deg, #1A1A1A 0%, #282828 100%);
  --tx-gradient-cta:     linear-gradient(135deg, #C8C010 0%, #A09810 100%);

  /* Typography */
  --font-heading: 'Monument Extended', 'Inter', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  /* Spacing scale (base 4px) */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px;  --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px;  --sp-10: 40px;
  --sp-12: 48px; --sp-16: 64px; --sp-20: 80px; --sp-24: 96px;

  /* Borders */
  --radius-sm: 4px;  --radius-md: 8px;  --radius-lg: 12px;
  --radius-xl: 16px; --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-xl: 0 8px 30px rgba(0,0,0,0.18);
  --shadow-cta: 0 6px 20px rgba(200,192,16,0.45);
}

/* --- Self-hosted Monument Extended (fallback to Inter if missing) --- */
@font-face {
  font-family: 'Monument Extended';
  src: url('../fonts/MonumentExtended-Regular.otf') format('opentype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Monument Extended';
  src: url('../fonts/MonumentExtended-Ultrabold.otf') format('opentype');
  font-weight: 800;
  font-display: swap;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--tx-carbon);
  background: var(--tx-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--tx-lima-accessible);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover { color: var(--tx-carbon); }

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--tx-carbon);
  line-height: 1.15;
  letter-spacing: -0.01em;
}
h1 { font-size: 30px; font-weight: 800; }
h2 { font-size: 26px; font-weight: 800; line-height: 1.2; }
h3 { font-size: 21px; font-weight: 700; line-height: 1.3; }
h4 { font-size: 18px; font-weight: 700; line-height: 1.35; }

@media (min-width: 768px) {
  h1 { font-size: 46px; line-height: 1.1; }
  h2 { font-size: 36px; line-height: 1.2; }
  h3 { font-size: 26px; line-height: 1.3; }
  h4 { font-size: 21px; }
}

p { font-size: 16px; line-height: 1.65; }
@media (min-width: 768px) { p { font-size: 17px; } }

.text-mono { font-family: var(--font-mono); }
.text-center { text-align: center; }

/* --- Layout --- */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--sp-5);
}
@media (min-width: 768px) { .container { padding: 0 var(--sp-8); } }

.section { padding: var(--sp-12) 0; }
@media (min-width: 768px) { .section { padding: var(--sp-20) 0; } }

.section--gray  { background: var(--tx-surface-light); }
.section--white { background: var(--tx-white); }
.section--dark  { background: var(--tx-gradient-dark); color: var(--tx-white); }
.section--dark h1, .section--dark h2, .section--dark h3, .section--dark h4 { color: var(--tx-white); }

.section__inner-narrow { max-width: 720px; margin: 0 auto; }

/* --- Sticky CTA top bar --- */
.sticky-cta {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--tx-carbon);
  color: var(--tx-white);
  padding: var(--sp-3) var(--sp-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
  font-size: 13px;
  flex-wrap: wrap;
}
.sticky-cta__text {
  font-weight: 600;
  color: var(--tx-white);
}
.sticky-cta__text strong { color: var(--tx-lima); }
.sticky-cta .btn { padding: 10px 18px; font-size: 14px; }
@media (max-width: 540px) {
  .sticky-cta { flex-direction: row; padding: var(--sp-2) var(--sp-3); }
  .sticky-cta__text { font-size: 12px; flex: 1; }
  .sticky-cta .btn { padding: 8px 14px; font-size: 13px; }
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font-family: var(--font-body);
  font-weight: 700;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  border: none;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

/* Lima CTA — main button used everywhere */
.btn-cta {
  background: var(--tx-lima);
  color: var(--tx-carbon);
  font-size: 18px;
  padding: 18px 36px;
  box-shadow: var(--shadow-cta);
}
.btn-cta:hover {
  background: var(--tx-lima-dark);
  color: var(--tx-carbon);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(200,192,16,0.55);
}
.btn-cta--lg {
  font-size: 20px;
  padding: 22px 48px;
}
@media (min-width: 768px) {
  .btn-cta { font-size: 19px; padding: 20px 44px; }
  .btn-cta--lg { font-size: 22px; padding: 24px 56px; }
}

.btn-cta--full { width: 100%; }

.btn--ghost-light {
  background: transparent;
  color: var(--tx-white);
  border: 2px solid rgba(255,255,255,0.4);
  padding: 14px 28px;
  font-size: 15px;
}
.btn--ghost-light:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--tx-white);
  color: var(--tx-white);
}

/* Center wrapper for inline CTAs between sections */
.cta-inline {
  text-align: center;
  margin-top: var(--sp-10);
}

/* --- Hero Section --- */
.hero {
  position: relative;
  background: var(--tx-carbon);
  color: var(--tx-white);
  padding: var(--sp-16) 0 var(--sp-16);
  overflow: hidden;
  min-height: 560px;
  display: flex;
  align-items: center;
}
@media (min-width: 768px) {
  .hero { padding: var(--sp-24) 0 var(--sp-20); min-height: 640px; }
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: var(--tx-carbon);
  background-size: cover;
  background-position: center;
}
.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(26,26,26,0.92) 0%, rgba(40,40,40,0.85) 100%);
  z-index: 1;
}
.hero .container {
  position: relative;
  z-index: 2;
  max-width: 1120px;
  text-align: left;
}
.hero__badge {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  margin-bottom: var(--sp-6);
  letter-spacing: 0.01em;
}
.hero h1 {
  color: var(--tx-white);
  max-width: 1040px;
  margin-bottom: var(--sp-5);
}
.hero h1 .lima { color: var(--tx-lima); }
.hero__sub {
  font-size: 17px;
  line-height: 1.55;
  color: rgba(255,255,255,0.92);
  max-width: 920px;
  margin-bottom: var(--sp-8);
}
@media (min-width: 768px) {
  .hero__sub { font-size: 20px; }
}

/* Texto secundário abaixo do botão CTA — quebra visual da subhead */
.hero__cta-meta {
  margin-top: var(--sp-5);
  font-size: 14px;
  line-height: 1.65;
  color: rgba(255,255,255,0.72);
  max-width: 760px;
}
@media (min-width: 768px) {
  .hero__cta-meta { font-size: 15px; }
}

/* Hero proofs — agora como badges visuais ao invés de texto solto */
.hero__proofs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-top: var(--sp-8);
}
.hero__proof-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(200,192,16,0.10);
  border: 1px solid rgba(200,192,16,0.32);
  color: var(--tx-white);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
}
.hero__proof-badge::before {
  content: '✓';
  color: var(--tx-lima);
  font-weight: 800;
  font-size: 13px;
}
@media (min-width: 768px) {
  .hero__proof-badge {
    font-size: 13px;
    padding: 9px 16px;
  }
}

/* --- Problema (cinza claro) --- */
.problema-body p {
  margin-bottom: var(--sp-5);
  font-size: 17px;
  line-height: 1.7;
  color: var(--tx-text-gray-2);
}
.problema-body p:last-child { margin-bottom: 0; }
@media (min-width: 768px) {
  .problema-body p { font-size: 18px; }
}

.impact-card {
  background: var(--tx-white);
  border: 2px solid var(--tx-maquina);
  border-left-width: 6px;
  border-radius: var(--radius-lg);
  padding: var(--sp-8);
  margin: var(--sp-10) auto 0;
  max-width: 720px;
  box-shadow: var(--shadow-md);
}
.impact-card__label {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--tx-maquina);
  margin-bottom: var(--sp-4);
}
.impact-card p {
  font-size: 17px;
  line-height: 1.65;
  color: var(--tx-carbon);
  margin-bottom: var(--sp-3);
}
.impact-card p:last-child { margin-bottom: 0; }
.impact-card strong { color: var(--tx-carbon); font-weight: 700; }
.impact-card .impact-line {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 19px;
  color: var(--tx-carbon);
  display: block;
  margin-top: var(--sp-2);
}
@media (min-width: 768px) {
  .impact-card { padding: var(--sp-10); }
  .impact-card .impact-line { font-size: 22px; }
}

/* --- Solução (dark section) --- */
.section--dark .solution-body {
  max-width: 760px;
  margin: 0 auto;
}
.section--dark .solution-body p {
  font-size: 17px;
  line-height: 1.75;
  color: rgba(255,255,255,0.88);
  margin-bottom: var(--sp-5);
}
.section--dark .solution-body p:last-of-type { margin-bottom: 0; }
@media (min-width: 768px) {
  .section--dark .solution-body p { font-size: 18px; }
}
.solution-closer {
  margin-top: var(--sp-8);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 20px;
  line-height: 1.4;
  color: var(--tx-lima);
  text-align: center;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}
@media (min-width: 768px) {
  .solution-closer { font-size: 24px; }
}

/* --- Stats grid (Section 4) --- */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-6);
  margin: var(--sp-10) 0;
  max-width: 920px;
  margin-left: auto;
  margin-right: auto;
}
@media (min-width: 768px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); gap: var(--sp-8); }
}
.stat-card {
  text-align: center;
  padding: var(--sp-8) var(--sp-4);
  background: var(--tx-white);
  border: 1px solid var(--tx-border-gray);
  border-top: 4px solid var(--tx-lima);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.stat-card__number {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 48px;
  line-height: 1;
  color: var(--tx-carbon);
  margin-bottom: var(--sp-2);
}
.stat-card__label {
  font-size: 14px;
  font-weight: 600;
  color: var(--tx-text-gray);
  line-height: 1.4;
}
@media (min-width: 768px) {
  .stat-card__number { font-size: 60px; }
  .stat-card__label { font-size: 15px; }
}

.benefits-text {
  max-width: 760px;
  margin: 0 auto;
  font-size: 17px;
  line-height: 1.7;
  color: var(--tx-text-gray-2);
}
@media (min-width: 768px) {
  .benefits-text { font-size: 18px; }
}

/* --- Como funciona (steps) --- */
.steps {
  display: grid;
  gap: var(--sp-8);
  counter-reset: step;
  max-width: 920px;
  margin: 0 auto;
}
@media (min-width: 768px) {
  .steps { grid-template-columns: repeat(3, 1fr); gap: var(--sp-8); }
}
.step {
  text-align: left;
  position: relative;
  padding: var(--sp-6);
  background: var(--tx-white);
  border: 1px solid var(--tx-border-gray);
  border-radius: var(--radius-lg);
}
.step__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--tx-carbon);
  color: var(--tx-lima);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 22px;
  border-radius: var(--radius-full);
  margin-bottom: var(--sp-4);
}
.step__title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 18px;
  margin-bottom: var(--sp-3);
  color: var(--tx-carbon);
}
.step__text {
  font-size: 15px;
  line-height: 1.65;
  color: var(--tx-text-gray-2);
}

/* --- Form (Lead Capture) --- */
.form-section { padding: var(--sp-12) 0; background: var(--tx-white); }
@media (min-width: 768px) { .form-section { padding: var(--sp-20) 0; } }

.form-card {
  max-width: 580px;
  margin: 0 auto;
  background: var(--tx-white);
  border: 1px solid var(--tx-border-gray);
  border-top: 4px solid var(--tx-lima);
  border-radius: var(--radius-xl);
  padding: var(--sp-8) var(--sp-5);
  box-shadow: var(--shadow-xl);
}
@media (min-width: 768px) {
  .form-card { padding: var(--sp-10) var(--sp-10); }
}

.form-card__header {
  text-align: center;
  margin-bottom: var(--sp-8);
}
.form-card__header h2 {
  font-size: 26px;
  margin-bottom: var(--sp-3);
}
@media (min-width: 768px) {
  .form-card__header h2 { font-size: 30px; }
}
.form-card__header p {
  font-size: 15px;
  color: var(--tx-text-gray-2);
  line-height: 1.6;
}

.form-group { margin-bottom: var(--sp-4); }
.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--tx-carbon);
  margin-bottom: 6px;
}
.form-field {
  width: 100%;
  font-family: var(--font-body);
  font-size: 16px;
  padding: 14px 16px;
  border: 1px solid var(--tx-border-gray);
  border-radius: var(--radius-md);
  background: var(--tx-white);
  color: var(--tx-carbon);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}
.form-field:focus {
  outline: none;
  border-color: var(--tx-lima-accessible);
  box-shadow: 0 0 0 3px rgba(200,192,16,0.20);
}
.form-field::placeholder { color: #B0B0B0; }
.form-field[aria-invalid="true"] {
  border-color: var(--tx-maquina);
  box-shadow: 0 0 0 3px rgba(232,8,24,0.12);
}

select.form-field {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%231A1A1A' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
  cursor: pointer;
}

.form-error {
  display: none;
  margin-top: 6px;
  font-size: 13px;
  color: var(--tx-maquina);
  font-weight: 600;
}
.form-field[aria-invalid="true"] + .form-error { display: block; }

.btn-form {
  width: 100%;
  margin-top: var(--sp-4);
}
.form-meta {
  text-align: center;
  font-size: 13px;
  color: var(--tx-text-gray);
  margin-top: var(--sp-4);
  line-height: 1.5;
}

.form-success {
  text-align: center;
  padding: var(--sp-8) var(--sp-4);
  display: none;
}
.form-success.is-visible { display: block; }
.form-success__icon {
  display: inline-flex;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background: var(--tx-agro);
  color: var(--tx-white);
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
  margin-bottom: var(--sp-4);
}
.form-success h3 {
  color: var(--tx-carbon);
  margin-bottom: var(--sp-3);
  font-size: 22px;
}
.form-success p {
  color: var(--tx-text-gray-2);
  font-size: 15px;
  line-height: 1.65;
  max-width: 420px;
  margin: 0 auto;
}

/* Hide form when success is visible */
.form-card.is-submitted .form-card__header,
.form-card.is-submitted form { display: none; }

/* --- FAQ Accordion --- */
.faq-list {
  max-width: 800px;
  margin: 0 auto;
}
.faq-item {
  border-bottom: 1px solid var(--tx-border-gray);
}
.faq-item:first-child {
  border-top: 1px solid var(--tx-border-gray);
}
.faq-question {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-5) 0;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 16px;
  color: var(--tx-carbon);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  gap: var(--sp-4);
}
@media (min-width: 768px) {
  .faq-question { font-size: 17px; padding: var(--sp-6) 0; }
}
.faq-question:hover { color: var(--tx-lima-accessible); }
.faq-question::after {
  content: '+';
  font-size: 28px;
  font-weight: 300;
  color: var(--tx-text-gray);
  transition: transform 0.2s ease;
  flex-shrink: 0;
  line-height: 1;
}
.faq-item.is-open .faq-question::after {
  content: '−';
  color: var(--tx-lima-accessible);
}
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.faq-item.is-open .faq-answer {
  max-height: 600px;
}
.faq-answer__inner {
  padding: 0 0 var(--sp-6);
  font-size: 16px;
  line-height: 1.7;
  color: var(--tx-text-gray-2);
  max-width: 95%;
}

/* --- CTA Final --- */
.cta-final {
  text-align: center;
  background: var(--tx-gradient-dark);
  color: var(--tx-white);
}
.cta-final h2 {
  max-width: 720px;
  margin: 0 auto var(--sp-5);
  color: var(--tx-white);
}
.cta-final p {
  max-width: 640px;
  margin: 0 auto var(--sp-8);
  color: rgba(255,255,255,0.85);
  font-size: 17px;
  line-height: 1.65;
}
@media (min-width: 768px) {
  .cta-final p { font-size: 18px; }
}
.cta-final__meta {
  margin-top: var(--sp-6);
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  line-height: 1.6;
}

/* --- Footer --- */
.footer {
  background: var(--tx-carbon);
  color: rgba(255,255,255,0.5);
  padding: var(--sp-8) 0;
  font-size: 13px;
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* --- Mobile fixed bottom CTA bar (always visible on mobile) --- */
.cta-mobile {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--tx-white);
  padding: var(--sp-3) var(--sp-4);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
  z-index: 100;
  display: flex;
  gap: var(--sp-3);
}
.cta-mobile .btn-cta {
  flex: 1;
  font-size: 15px;
  padding: 14px 16px;
}
@media (min-width: 768px) {
  .cta-mobile { display: none; }
}
@media (max-width: 767px) {
  body { padding-bottom: 78px; }
}

/* --- Accessibility --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 3px solid var(--tx-lima);
  outline-offset: 2px;
  border-radius: 4px;
}
