/* ---------- Tokens ---------- */
:root {
  color-scheme: dark;
  --brand: #5B47F5;
  --brand-hover: #7462FF;

  --page: #0A0E17;
  --header: rgba(10, 14, 23, 0.85);
  --line: #1A2133;
  --line2: #1E2638;
  --grid: #141B2B;
  --btn-line: #2A3348;
  --btn-line-hover: #4A5570;
  --text: #E6E9F0;
  --strong: #FFFFFF;
  --body: #D5DAE6;
  --muted: #A3ACBF;
  --muted2: #8B94A8;
  --dim: #6B7590;
  --accent: #AA9CFF;
  --panel: #0D121D;
  --panel2: #0B0F19;
  --panel3: #0F1420;
  --panel-line: #222B3F;
  --tag-line: #3B3274;
  --code-bg: #111726;
  --check: #7B6AFF;
  --off-icon: #3E4659;
  --off-text: #545D72;
  --featured-bg: #14122B;
  --ent-on: #B9A6FF;
  --ent-on-line: #4B3E8A;
  --ent-off: #4A5266;
  --ent-off-line: #262D3E;

  --font-sans: 'Geist', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

:root[data-theme="light"] {
  color-scheme: light;
  --page: #F6F7FA;
  --header: rgba(246, 247, 250, 0.88);
  --line: #E1E4EC;
  --line2: #E1E4EC;
  --grid: #EAECF2;
  --btn-line: #CDD2DE;
  --btn-line-hover: #8F97AA;
  --text: #0F1420;
  --strong: #0F1420;
  --body: #1F2533;
  --muted: #4A5266;
  --muted2: #5E6679;
  --dim: #5E6679;
  --accent: #4A32D4;
  --panel: #FFFFFF;
  --panel2: #FFFFFF;
  --panel3: #FFFFFF;
  --panel-line: #E1E4EC;
  --tag-line: #D4CCF7;
  --code-bg: #F0F3FA;
  --check: #5B47F5;
  --off-icon: #B5BBC8;
  --off-text: #8A92A3;
  --featured-bg: #F2EFFF;
  --ent-on: #5B3FD0;
  --ent-on-line: #CFC4F5;
  --ent-off: #9AA2B5;
  --ent-off-line: #E1E4EC;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }

button { font: inherit; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.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;
}

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

/* Theme-dependent visibility (logos, toggle label) */
:root[data-theme="light"] .when-dark,
:root:not([data-theme="light"]) .when-light { display: none !important; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-family: var(--font-sans);
  transition: background-color .15s, border-color .15s, color .15s;
}

.btn--sm { font-size: 14px; padding: 9px 16px; }
.btn--lg { font-size: 15px; padding: 14px 22px; }

.btn--primary {
  font-weight: 600;
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}
.btn--primary:hover { color: #fff; background: var(--brand-hover); border-color: var(--brand-hover); }

.btn--outline {
  font-weight: 500;
  color: var(--text);
  border-color: var(--btn-line);
}
.btn--outline:hover { color: var(--strong); border-color: var(--btn-line-hover); }

.btn--filled { background: var(--panel3); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--header);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; }

.logo { height: 34px; width: auto; display: block; }

.nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 14px;
  flex-wrap: wrap;
}
.nav a { color: var(--muted); transition: color .15s; }
.nav a:hover { color: var(--strong); }

.header-actions { display: flex; align-items: center; gap: 10px; }

.theme-toggle {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--btn-line);
  border-radius: 6px;
  padding: 9px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: border-color .15s;
}
.theme-toggle:hover { border-color: var(--btn-line-hover); }

/* ---------- Shared section bits ---------- */
.section { border-bottom: 1px solid var(--line); }

.section__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 96px 24px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.section__head { display: flex; flex-direction: column; gap: 14px; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--accent);
  text-transform: uppercase;
}

.h2 {
  margin: 0;
  font-size: clamp(30px, 3.6vw, 44px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 600;
  color: var(--strong);
  text-wrap: balance;
}

.tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--accent);
  border: 1px solid var(--tag-line);
  border-radius: 4px;
  padding: 3px 8px;
}

/* ---------- Hero ---------- */
.hero {
  border-bottom: 1px solid var(--line);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: -1px -1px;
}

.hero__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 88px 24px 96px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr));
  gap: 56px;
  align-items: center;
}

.hero__copy { display: flex; flex-direction: column; gap: 28px; }

.hero__eyebrow { display: flex; align-items: center; gap: 10px; }
.hero__eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--brand);
  display: inline-block;
}

.hero__title {
  margin: 0;
  font-size: clamp(40px, 5.4vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 600;
  color: var(--strong);
  text-wrap: balance;
}

.hero__lead {
  margin: 0;
  font-size: 18px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 520px;
  text-wrap: pretty;
}

.hero__ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.hero__ctas .arrow { font-family: var(--font-mono); }

.hero__note { font-family: var(--font-mono); font-size: 13px; color: var(--dim); }

/* Code card: dark in both themes */
.code-card {
  background: #0D121D;
  border: 1px solid #222B3F;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 30px 80px -30px rgba(91, 71, 245, 0.35);
  min-width: 0;
}

.code-card__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 0 8px 0 14px;
  border-bottom: 1px solid #1E2638;
}

.lang-tabs { display: flex; }

.lang-tab {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #6B7590;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 12px 12px 10px;
  cursor: pointer;
  transition: color .15s;
}
.lang-tab:hover { color: #A3ACBF; }
.lang-tab[aria-pressed="true"] { color: #fff; border-bottom-color: var(--brand); }

.doc-tabs {
  display: flex;
  gap: 4px;
  background: #141A28;
  border-radius: 6px;
  padding: 3px;
}

.doc-tab {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #8B94A8;
  background: transparent;
  border: 0;
  border-radius: 4px;
  padding: 5px 10px;
  cursor: pointer;
}
.doc-tab[aria-pressed="true"] { color: #fff; background: var(--brand); }

.code {
  margin: 0;
  padding: 18px 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.65;
  color: #C9D1E3;
  white-space: pre;
  overflow-x: auto;
}
.code--request { border-bottom: 1px solid #1E2638; }
.code--response { color: #AA9CFF; }

.code-card__status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #6B7590;
  background: #0B0F19;
  border-bottom: 1px solid #1E2638;
}
.code-card__status .ok { color: #3DD68C; }

/* ---------- Pillars ---------- */
.pillars { container-type: inline-size; }

.pillars__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
}

.pillar {
  padding: 48px 32px 48px 0;
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.pillar:first-child { border-right: 1px solid var(--line); }
.pillar + .pillar { padding-left: 32px; }

/* Single column: divider becomes horizontal */
@container (width < 888px) {
  .pillar { padding: 40px 0; }
  .pillar + .pillar { padding-left: 0; }
  .pillar:first-child { border-right: 0; border-bottom: 1px solid var(--line); }
}

.pillar__glyph {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: var(--brand);
  border-radius: 6px;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pillar__body { display: flex; flex-direction: column; gap: 8px; }

.pillar__title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--strong);
  letter-spacing: -0.01em;
}

.pillar__text {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
  text-wrap: pretty;
}

.tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }

/* ---------- Dados ---------- */
.dados .section__inner { container-type: inline-size; }

.dados__head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  flex-wrap: wrap;
}
.dados__head .h2 { max-width: 620px; }

.dados__intro {
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 380px;
}

.groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 1px;
  background: var(--line2);
  border: 1px solid var(--line2);
  border-radius: 10px;
  overflow: hidden;
}

/* Two columns: let the third group span the row instead of leaving an empty cell */
@container (683px <= width < 1024px) {
  .group:last-child { grid-column: 1 / -1; }
}

.group {
  background: var(--panel);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.group__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.group__title { margin: 0; font-size: 18px; font-weight: 600; color: var(--strong); }

.group__tag { letter-spacing: 0.08em; }

.group__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }

.group__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
  font-size: 15px;
  color: var(--body);
}
.group__input { font-family: var(--font-mono); font-size: 12px; color: var(--dim); }

/* ---------- Integração ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.step {
  border: 1px solid var(--line2);
  border-radius: 10px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--panel2);
}

.step__n { font-family: var(--font-mono); font-size: 13px; font-weight: 600; color: var(--brand); }

.step__title { margin: 0; font-size: 19px; font-weight: 600; color: var(--strong); }

.step__text { margin: 0; font-size: 15px; line-height: 1.55; color: var(--muted); }

.step__code {
  margin-top: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  background: var(--code-bg);
  border: 1px solid var(--line2);
  border-radius: 6px;
  padding: 10px 12px;
  overflow-x: auto;
  white-space: nowrap;
}

/* ---------- Planos ---------- */
.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 20px;
  align-items: stretch;
}

.plan {
  position: relative;
  border: 1px solid var(--line2);
  border-radius: 12px;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  background: var(--panel2);
}
.plan--featured { border-color: var(--brand); background: var(--featured-bg); }

.plan__badge {
  position: absolute;
  top: -12px;
  left: 28px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: var(--brand);
  padding: 5px 10px;
  border-radius: 4px;
}

.plan__head { display: flex; flex-direction: column; gap: 6px; }
.plan__name { margin: 0; font-size: 22px; font-weight: 600; color: var(--strong); }
.plan__desc { margin: 0; font-size: 14px; color: var(--muted2); }

.plan__price { display: flex; align-items: baseline; gap: 6px; color: var(--muted2); }
.plan__currency { font-size: 18px; font-weight: 600; }
.plan__value {
  font-size: 56px;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--strong);
}
.plan__period { font-size: 15px; }

.plan__limits {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--panel-line);
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  overflow: hidden;
  margin: 0;
}

.plan__limit {
  background: var(--panel);
  padding: 12px 14px;
  display: flex;
  flex-direction: column-reverse;
  gap: 2px;
  font-family: var(--font-mono);
}
.plan__limit dt { font-size: 11px; color: var(--dim); }
.plan__limit dd { margin: 0; font-size: 18px; font-weight: 600; color: var(--strong); }

.plan__features { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }

.feature { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--body); }
.feature::before {
  content: "✓";
  content: "✓" / "";
  font-family: var(--font-mono);
  color: var(--check);
  width: 14px;
  flex-shrink: 0;
}
.feature--off { color: var(--off-text); }
.feature--off::before { content: "×"; content: "×" / ""; color: var(--off-icon); }

.ent {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ent-on);
  border: 1px solid var(--ent-on-line);
  border-radius: 4px;
  padding: 2px 6px;
}
.feature--off .ent { color: var(--ent-off); border-color: var(--ent-off-line); }

.plan__cta {
  margin-top: auto;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  padding: 13px 18px;
  border-radius: 6px;
  color: var(--strong);
  background: transparent;
  border: 1px solid var(--btn-line);
  transition: border-color .15s;
}
.plan--featured .plan__cta { color: #fff; background: var(--brand); border-color: var(--brand); }
.plan__cta:hover,
.plan--featured .plan__cta:hover { border-color: var(--check); }

.plans__notes {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--dim);
}
.plans__notes p { margin: 0; }

/* ---------- CTA ---------- */
.cta__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 96px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
}
.cta__inner .h2 { max-width: 560px; }
.cta__actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Footer ---------- */
.site-footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.site-footer .logo { height: 26px; opacity: 0.85; }

.site-footer__links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--dim);
}
.site-footer__links a { color: var(--dim); transition: color .15s; }
.site-footer__links a:hover { color: var(--muted); }

/* ---------- Smaller screens ---------- */
/* Logo + nav + actions no longer fit on one row: drop the section nav */
@media (max-width: 820px) {
  .nav { display: none; }
}

@media (max-width: 640px) {
  .hero__inner { padding: 56px 24px 64px; }
  .section__inner, .cta__inner { padding: 64px 24px; }
}

/* Header: logo + theme icon on top, the two account buttons below */
@media (max-width: 560px) {
  .site-header__inner { padding: 12px 24px; row-gap: 0; column-gap: 12px; }
  .site-header__inner::after { content: ""; flex-basis: 100%; order: 2; }
  .header-actions { display: contents; }
  .theme-toggle { order: 1; margin-left: auto; }
  .theme-toggle .label { display: none; }
  .header-actions .btn { order: 3; flex: 1 1 0; justify-content: center; margin-top: 12px; }
}
