/* RecuperaPay — design tokens */
:root {
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-display: "Instrument Serif", "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --radius: 8px;
  --radius-lg: 14px;
}

/* Theme: Light (default) — warm paper */
:root, [data-theme="light"] {
  --bg: #fafaf7;
  --bg-elev: #ffffff;
  --bg-sunken: #f1f0eb;
  --ink: #0a0a09;
  --ink-soft: #2a2a27;
  --muted: #5a5a55;
  --subtle: #8a8a83;
  --line: rgba(10, 10, 9, 0.10);
  --line-strong: rgba(10, 10, 9, 0.18);
  --accent: #0d6b3f;
  --accent-hover: #0a5532;
  --accent-soft: #d8ebe0;
  --loss: #b8321b;
  --loss-soft: #fce7e1;
  --gain: #0d6b3f;
  --shadow-sm: 0 1px 2px rgba(10, 10, 9, 0.04);
  --shadow: 0 4px 14px -4px rgba(10, 10, 9, 0.10), 0 2px 4px rgba(10, 10, 9, 0.04);
  --shadow-lg: 0 24px 48px -16px rgba(10, 10, 9, 0.16);
}

/* Theme: Dark — deep ink */
[data-theme="dark"] {
  --bg: #0c0d0b;
  --bg-elev: #151714;
  --bg-sunken: #08090a;
  --ink: #f4f3ee;
  --ink-soft: #cfcec8;
  --muted: #9a9a93;
  --subtle: #6a6a63;
  --line: rgba(244, 243, 238, 0.10);
  --line-strong: rgba(244, 243, 238, 0.20);
  --accent: #4ade80;
  --accent-hover: #6ee599;
  --accent-soft: rgba(74, 222, 128, 0.16);
  --loss: #f87171;
  --loss-soft: rgba(248, 113, 113, 0.14);
  --gain: #4ade80;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 14px -4px rgba(0, 0, 0, 0.4), 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 24px 48px -16px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.011em;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: 0; background: transparent; color: inherit; }
input, textarea, select { font-family: inherit; color: inherit; }

.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.container-tight { max-width: 920px; margin: 0 auto; padding: 0 24px; }

/* Type */
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; }
.display {
  font-family: var(--font-display);
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.02em;
}
.mono { font-family: var(--font-mono); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: var(--radius);
  font-size: 14px; font-weight: 500; letter-spacing: -0.005em;
  transition: background 120ms ease, color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn-primary {
  background: var(--ink); color: var(--bg);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 1px 2px rgba(0,0,0,0.1);
}
.btn-primary:hover { background: var(--accent); color: var(--bg); }
[data-theme="dark"] .btn-primary:hover { color: var(--bg); }
.btn-secondary {
  background: var(--bg-elev); color: var(--ink);
  border-color: var(--line-strong);
}
.btn-secondary:hover { background: var(--bg-sunken); }
.btn-ghost { color: var(--muted); padding: 8px 12px; }
.btn-ghost:hover { color: var(--ink); }
.btn-lg { padding: 14px 22px; font-size: 15px; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 6px; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--bg) 85%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.02em; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 6px;
  background: var(--ink); color: var(--bg);
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
  font-family: var(--font-mono);
}
.nav-link { padding: 8px 12px; border-radius: 6px; color: var(--muted); font-size: 14px; }
.nav-link:hover { color: var(--ink); }

/* Pill / badge */
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted);
  padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg-elev);
}
.pill .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 22%, transparent);
}

/* Card */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

/* Inputs */
.input, .select {
  width: 100%;
  background: var(--bg-elev); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 11px 14px; font-size: 14px;
  transition: border-color 120ms, box-shadow 120ms;
}
.input:focus, .select:focus {
  outline: 0; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 22%, transparent);
}

/* Section */
section { padding-block: 96px; }
section.tight { padding-block: 64px; }

/* Subtle grid background */
.bg-grid {
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 80%);
}

::selection { background: var(--ink); color: var(--bg); }

/* ====== Integrations section ====== */
.integra-section {
  background: var(--bg-sunken);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.integra-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 56px;
  align-items: start;
}
.integra-title {
  font-size: clamp(28px, 3.5vw, 40px);
  margin-top: 16px;
  margin-bottom: 14px;
}
.integra-lead {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
  max-width: 460px;
}
.integra-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.integra-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}
.integra-card:hover { border-color: var(--line-strong); }
.integra-card.is-soon { opacity: 0.6; }
.integra-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.integra-mark {
  width: 36px; height: 36px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.integra-name {
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.integra-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 9px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}
.integra-badge.is-ready { background: var(--accent-soft); color: var(--accent); }
.integra-badge.is-soon { background: var(--bg-sunken); color: var(--subtle); }

/* ====== Mobile responsive ====== */
@media (max-width: 900px) {
  section { padding-block: 64px; }
  section.tight { padding-block: 48px; }
  .container, .container-tight { padding: 0 20px; }

  .integra-grid { grid-template-columns: 1fr; gap: 32px; }
  .integra-lead { max-width: 100%; }
}

/* Theme toggle button */
.theme-toggle {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--muted);
  transition: border-color 120ms, color 120ms;
}
.theme-toggle:hover { border-color: var(--line-strong); color: var(--ink); }

@media (max-width: 720px) {
  .nav-inner { height: 56px; }
  .nav nav { display: none; }
  .brand .pill { display: none; }
  .nav-inner .btn-ghost { display: none; }
  .nav-cta-text { display: none !important; }
  .nav-cta-short { display: inline !important; }

  h1 { font-size: clamp(32px, 8.4vw, 44px) !important; }
  h2 { font-size: clamp(24px, 5.8vw, 32px) !important; }

  /* Calc — stack columns */
  #calc .container > div[style*="grid-template-columns"],
  #integra .container,
  #faq .container,
  #preco .container > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }

  #como-funciona div[style*="repeat(5"],
  #preco div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  #faq .container { display: block !important; }
  #faq .container > div:first-child { margin-bottom: 28px; }

  .integra-cards { grid-template-columns: 1fr; }
  .integra-card { padding: 14px 16px; }
  .integra-mark { width: 32px; height: 32px; font-size: 11px; }
  .integra-name { font-size: 14px; }

  .btn-lg { padding: 12px 18px; font-size: 14px; }

  /* Hero meta — wrap row, tighter */
  section { padding-block: 56px !important; }

  /* Comparison table → stack */
  .container-tight .card > div[style*="grid-template-columns: 1.6fr"] {
    grid-template-columns: 2fr 0.5fr 0.5fr !important;
    padding: 12px 14px !important;
    font-size: 13px !important;
  }

  /* Calc card padding */
  #calc .card { padding: 20px !important; }
  #calc .card > div[style*="display: \"grid\""] { display: block !important; }

  /* Pricing card padding */
  #preco .card { padding: 24px !important; }

  /* Headline alts details */
  details { font-size: 11px !important; }

  /* Footer stack */
  footer .container { flex-direction: column; align-items: flex-start !important; gap: 12px !important; }
}

@media (max-width: 420px) {
  .integra-card {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .integra-badge { margin-left: 48px; }
  .container, .container-tight { padding: 0 16px; }
  .nav-cta-text { display: none; }
}

/* Money type */
.money {
  font-family: var(--font-mono);
  font-feature-settings: "tnum";
  letter-spacing: -0.02em;
}

/* Spinner */
.spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
