/* ────────────────────────────────────────────────────────────────
   Centro Sul Agro — Componentes base do design system
   Construído sobre tokens.css. Sem dependência de framework.
   ──────────────────────────────────────────────────────────── */

/* ════════════════════════════════════════
   CONTAINER
   ════════════════════════════════════════ */
.container {
  width: 100%;
  max-width: var(--container-xl);
  margin-inline: auto;
  padding-inline: var(--space-lg);
}

@media (min-width: 768px) {
  .container {
    padding-inline: var(--space-2xl);
  }
}

/* ════════════════════════════════════════
   TIPOGRAFIA — display + body
   ════════════════════════════════════════ */
.display-mega {
  font-family: var(--font-display);
  font-size: clamp(40px, 8vw, var(--text-4xl));
  font-weight: var(--weight-semibold);
  line-height: var(--lh-mega);
  letter-spacing: var(--ls-mega);
  color: var(--ink);
}

.display-xl {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, var(--text-3xl));
  font-weight: var(--weight-semibold);
  line-height: var(--lh-display);
  letter-spacing: var(--ls-display);
  color: var(--ink);
}

.display-lg {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.5vw, var(--text-2xl));
  font-weight: var(--weight-semibold);
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-display);
  color: var(--ink);
}

.display-md {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.8vw, var(--text-xl));
  font-weight: var(--weight-semibold);
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-heading);
  color: var(--ink);
}

.display-sm {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-heading);
  color: var(--ink);
}

.title-md {
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  line-height: 1.4;
  color: var(--ink);
}

.title-sm {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  line-height: 1.4;
  color: var(--ink);
}

.body-md {
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--lh-base);
  color: var(--body);
}

.body-sm {
  font-size: var(--text-sm);
  font-weight: var(--weight-regular);
  line-height: var(--lh-base);
  color: var(--body);
}

.lead {
  font-size: clamp(var(--text-base), 1.7vw, var(--text-md));
  line-height: var(--lh-loose);
  color: var(--body);
  max-width: 56ch;
}

.caption {
  font-size: var(--text-xs);
  line-height: 1.4;
  color: var(--muted);
}

.caption-up {
  font-size: var(--text-xxs);
  font-weight: var(--weight-semibold);
  line-height: 1.4;
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--body);
}

.text-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.text-ink { color: var(--ink); }
.text-body { color: var(--body); }
.text-muted { color: var(--muted); }
.text-primary { color: var(--primary); }
.text-on-dark { color: var(--on-dark); }

/* ════════════════════════════════════════
   LINKS
   ════════════════════════════════════════ */
.link-inline {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(25, 118, 210, 0.3);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--motion-fast) var(--easing-default);
}

.link-inline:hover {
  text-decoration-color: var(--accent);
}

/* ════════════════════════════════════════
   BOTÕES
   ════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  height: 44px;
  padding-inline: var(--space-lg);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: 1;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--motion-fast) var(--easing-default),
              border-color var(--motion-fast) var(--easing-default),
              color var(--motion-fast) var(--easing-default),
              transform var(--motion-fast) var(--easing-default);
  white-space: nowrap;
  user-select: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Primary — azul autoridade */
.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-primary:active:not(:disabled) {
  background: var(--primary-active);
}

/* Secondary — outline */
.btn-secondary {
  background: var(--surface-card);
  color: var(--ink);
  border-color: var(--hairline-strong);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--ink);
  background: var(--canvas-soft);
}

/* Ghost — sem fundo */
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-strong);
}

/* WhatsApp (verde sutil, segue padrão da LP) */
.btn-wpp {
  background: #16A34A;
  color: #FFFFFF;
  border-color: #16A34A;
}

.btn-wpp:hover:not(:disabled) {
  background: #15803D;
  border-color: #15803D;
}

/* Tamanhos */
.btn-sm {
  height: 36px;
  padding-inline: var(--space-base);
  font-size: var(--text-xs);
}

.btn-lg {
  height: 52px;
  padding-inline: var(--space-xl);
  font-size: var(--text-base);
}

/* ════════════════════════════════════════
   CARDS
   ════════════════════════════════════════ */
.card {
  background: var(--surface-card);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: transform var(--motion-base) var(--easing-out),
              box-shadow var(--motion-base) var(--easing-out),
              border-color var(--motion-base) var(--easing-default);
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--hairline-strong);
}

.card-dark {
  background: var(--surface-dark);
  color: var(--on-dark);
  border-color: transparent;
}

.card-padded {
  padding: var(--space-xl);
}

.card-padded-lg {
  padding: var(--space-2xl);
}

/* ════════════════════════════════════════
   BADGES E TAGS
   ════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xxs);
  padding: 4px 10px;
  font-size: var(--text-xxs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  border-radius: var(--radius-pill);
  background: var(--surface-strong);
  color: var(--ink);
}

.badge-primary {
  background: var(--primary-soft);
  color: var(--primary);
}

.badge-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ════════════════════════════════════════
   INPUTS / FORMS
   ════════════════════════════════════════ */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.field-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--ink);
}

.field-hint {
  font-size: var(--text-xs);
  color: var(--muted);
}

.input,
.textarea,
.select {
  width: 100%;
  height: 44px;
  padding: 0 var(--space-base);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--ink);
  background: var(--surface-card);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color var(--motion-fast) var(--easing-default),
              box-shadow var(--motion-fast) var(--easing-default);
}

.textarea {
  height: auto;
  min-height: 120px;
  padding: var(--space-sm) var(--space-base);
  line-height: var(--lh-base);
  resize: vertical;
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--primary);
  box-shadow: var(--shadow-focus);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--muted);
}

/* ════════════════════════════════════════
   UTILS DE SPACING
   ════════════════════════════════════════ */
.section {
  padding-block: clamp(64px, 10vw, var(--space-section));
}

.section-lg {
  padding-block: clamp(80px, 12vw, var(--space-section-lg));
}

.stack-xs > * + * { margin-top: var(--space-xs); }
.stack-sm > * + * { margin-top: var(--space-sm); }
.stack-base > * + * { margin-top: var(--space-base); }
.stack-md > * + * { margin-top: var(--space-md); }
.stack-lg > * + * { margin-top: var(--space-lg); }
.stack-xl > * + * { margin-top: var(--space-xl); }
.stack-2xl > * + * { margin-top: var(--space-2xl); }

/* ════════════════════════════════════════
   GRID HELPERS
   ════════════════════════════════════════ */
.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }

@media (max-width: 1024px) {
  .grid-4, .grid-5 { grid-template-columns: repeat(3, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════
   DIVISORES
   ════════════════════════════════════════ */
.divider {
  border: none;
  border-top: 1px solid var(--hairline);
}

.divider-strong {
  border-top-color: var(--hairline-strong);
}

/* ════════════════════════════════════════
   HERO ATMOSPHERIC BACKDROP (gradiente céu rural)
   ════════════════════════════════════════ */
.bg-sky-warm {
  background: linear-gradient(
    180deg,
    var(--gradient-sky-light) 0%,
    var(--gradient-sky-mid) 40%,
    var(--gradient-warm) 100%
  );
}
