/* ==========================================================================
   ORFFIA — Design System
   Dark-first, técnico, sóbrio. Referências: Linear / Vercel / Stripe.
   ========================================================================== */

:root {
  --bg: #0e1117;
  --bg-footer: #0b0e13;
  --surface-1: #1b1f2a;
  --surface-2: #252a38;
  --text: #e6e8ec;
  --text-soft: #9ba3b4;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  --gradient: linear-gradient(135deg, #6c3cff 0%, #2d7bff 100%);
  --blue: #2d7bff;
  --blue-deep: #0d1f3d;
  --success: #3ddc97;
  --warning: #f5b544;
  --critical: #ff6b6b;

  --font-heading: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;

  --container: 1200px;
  --gutter: 24px;
  --radius: 16px;
  --radius-sm: 10px;

  --section-y: 120px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (max-width: 1199px) {
  :root { --section-y: 80px; }
}
@media (max-width: 767px) {
  :root { --section-y: 64px; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 26px;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

h1 { font-size: 64px; line-height: 68px; letter-spacing: -0.01em; }
h2 { font-size: 44px; line-height: 50px; }
h3 { font-size: 28px; line-height: 34px; }
h4 { font-size: 20px; line-height: 28px; }

p { margin: 0 0 16px; color: var(--text-soft); }
p:last-child { margin-bottom: 0; }

.body-lg { font-size: 18px; line-height: 30px; }
.body-sm { font-size: 14px; line-height: 22px; }

@media (max-width: 1199px) {
  h1 { font-size: 52px; line-height: 58px; }
  h2 { font-size: 36px; line-height: 42px; }
}
@media (max-width: 767px) {
  h1 { font-size: 42px; line-height: 46px; }
  h2 { font-size: 34px; line-height: 40px; }
  h3 { font-size: 24px; line-height: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- layout ---------- */

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
}
@media (max-width: 767px) {
  .container { padding: 0 20px; }
}

.section { padding: var(--section-y) 0; }
.section-tight { padding: calc(var(--section-y) * 0.6) 0; }

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gutter);
}

.text-gradient {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- eyebrow ---------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 16px;
}
.eyebrow::before {
  content: "";
  width: 24px;
  height: 2px;
  background: var(--gradient);
  display: inline-block;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  border: none;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient);
  color: #fff;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px -8px rgba(45, 123, 255, 0.5);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover { background: var(--surface-1); }

.btn-sm { height: 36px; padding: 0 16px; font-size: 14px; }
.btn-block { width: 100%; }

.link-arrow {
  color: var(--blue);
  font-weight: 600;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap 0.2s var(--ease);
}
.link-arrow:hover { gap: 10px; }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 72px;
  display: flex;
  align-items: center;
  background: rgba(14, 17, 23, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.01em;
  color: var(--text);
}
.logo svg { width: 28px; height: 28px; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 36px;
}
.main-nav a {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-soft);
  transition: color 0.2s var(--ease);
}
.main-nav a:hover, .main-nav a.active { color: var(--text); }

/* ---------- header: Produto dropdown ---------- */

.nav-item-dropdown { position: relative; }
.nav-dropdown-trigger {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none; padding: 0; cursor: pointer;
  font-family: var(--font-body); font-size: 15px; font-weight: 500; color: var(--text-soft);
  transition: color 0.2s var(--ease);
}
.nav-dropdown-trigger:hover, .nav-dropdown-trigger.active { color: var(--text); }
.nav-dropdown-trigger svg { transition: transform 0.2s var(--ease); }

.nav-dropdown-menu {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  padding-top: 16px; /* bridges the gap so the hover chain never breaks */
  opacity: 0; visibility: hidden;
  transition: opacity 0.15s var(--ease), visibility 0.15s;
}
.nav-item-dropdown:hover .nav-dropdown-menu,
.nav-item-dropdown:focus-within .nav-dropdown-menu {
  opacity: 1; visibility: visible;
}
.nav-item-dropdown:hover .nav-dropdown-trigger svg { transform: rotate(180deg); }

.nav-dropdown-menu-inner {
  min-width: 260px; background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px; box-shadow: 0 16px 40px -12px rgba(0,0,0,0.5);
}

.nav-dropdown-menu a {
  display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--text); transition: background 0.15s var(--ease);
}
.nav-dropdown-menu a:hover { background: var(--surface-2); }
.nav-dropdown-menu a strong { font-size: 14px; font-weight: 600; }
.nav-dropdown-menu a span { font-size: 12px; color: var(--text-soft); }

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

.nav-toggle { display: none; }

@media (max-width: 991px) {
  .main-nav { display: none; }
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    background: transparent; border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm); color: var(--text); cursor: pointer;
  }
  .header-actions .btn-primary { padding: 0 14px; font-size: 13px; height: 38px; }
}

.mobile-nav {
  display: none;
  position: fixed;
  inset: 72px 0 0 0;
  background: var(--bg);
  z-index: 99;
  padding: 24px 20px;
  overflow-y: auto;
}
.mobile-nav.open { display: block; }
.mobile-nav a {
  display: block;
  padding: 16px 0;
  font-size: 18px;
  font-weight: 500;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.mobile-nav-group { border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.mobile-nav-label { display: block; padding-top: 16px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-soft); font-weight: 600; }
.mobile-nav-group a.mobile-nav-sub { padding: 12px 0 12px 16px; border-bottom: none; font-size: 16px; color: var(--text-soft); }

/* ---------- cards ---------- */

.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.metric-card { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.metric-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-soft); font-weight: 600; margin-bottom: 12px; }
.metric-value { font-family: var(--font-heading); font-size: 36px; font-weight: 600; color: var(--text); }
.metric-delta { font-size: 13px; font-weight: 600; margin-left: 8px; }
.metric-delta.up { color: var(--success); }
.metric-delta.down { color: var(--critical); }

/* ---------- badges / pills ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-soft);
}
.badge-ai { border-color: rgba(45, 123, 255, 0.35); color: var(--blue); background: var(--blue-deep); }
.badge-success { color: var(--success); border-color: rgba(61, 220, 151, 0.3); background: rgba(61, 220, 151, 0.08); }
.badge-warning { color: var(--warning); border-color: rgba(245, 181, 68, 0.3); background: rgba(245, 181, 68, 0.08); }
.badge-critical { color: var(--critical); border-color: rgba(255, 107, 107, 0.3); background: rgba(255, 107, 107, 0.08); }
.badge-filter {
  cursor: pointer; background: transparent; border: 1px solid var(--border-strong); color: var(--text-soft);
  font-family: var(--font-body); transition: color .2s var(--ease), border-color .2s var(--ease);
}
.badge-filter.active { color: var(--text); border-color: transparent; background: var(--gradient); }

/* ---------- status rows ---------- */

.status-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.status-row:last-child { border-bottom: none; }
.status-dot { display: inline-flex; align-items: center; gap: 8px; }
.status-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.status-dot.warning::before { background: var(--warning); }
.status-dot.critical::before { background: var(--critical); }

/* ---------- callouts ---------- */

.callout {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 24px;
}
.callout-warning { border-color: rgba(245, 181, 68, 0.35); background: rgba(245, 181, 68, 0.06); }
.callout-title { font-weight: 600; color: var(--text); margin-bottom: 4px; }
.callout p { margin: 0; font-size: 14px; }

/* ---------- footer ---------- */

.site-footer { background: var(--bg-footer); border-top: 1px solid var(--border); padding: 72px 0 32px; }
.footer-top { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; padding-bottom: 56px; }
.footer-brand p { max-width: 280px; margin-top: 16px; font-size: 14px; }
.footer-col h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-soft); margin-bottom: 16px; font-family: var(--font-body); font-weight: 600; }
.footer-col a { display: block; font-size: 14px; color: var(--text-soft); padding: 6px 0; transition: color .2s var(--ease); }
.footer-col a:hover { color: var(--text); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; padding-top: 32px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-soft); flex-wrap: wrap; gap: 12px; }

@media (max-width: 991px) {
  .footer-top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .footer-top { grid-template-columns: 1fr; }
}

/* ---------- forms ---------- */

.field {
  height: 44px;
  padding: 0 16px;
  background: var(--surface-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  width: 100%;
}
.field::placeholder { color: var(--text-soft); }
.field:focus { outline: none; border-color: var(--blue); }

.form-row-inline { display: flex; gap: 12px; }
@media (max-width: 600px) {
  .form-row-inline { flex-direction: column; }
}

/* ---------- utility ---------- */

.text-soft { color: var(--text-soft); }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; } .mt-48 { margin-top: 48px; } .mt-64 { margin-top: 64px; }
.mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; } .mb-32 { margin-bottom: 32px; } .mb-48 { margin-bottom: 48px; }
.text-center { text-align: center; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }

.glow-bg { position: relative; overflow: hidden; }
.glow-bg::before {
  content: "";
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(108, 60, 255, 0.18) 0%, rgba(45, 123, 255, 0.06) 45%, transparent 70%);
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  pointer-events: none;
}

.fade-in-up {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.fade-in-up.in-view { opacity: 1; transform: translateY(0); }

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.data-table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-soft);
  font-weight: 600;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-strong);
}
table.data-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.table-scroll { overflow-x: auto; }

/* ---------- responsive grid-column utilities ---------- */

.col-span-4 { grid-column: span 4; }
.col-span-5 { grid-column: span 5; }
.col-span-6 { grid-column: span 6; }
.col-span-6-end { grid-column: 7 / span 6; }
@media (max-width: 991px) {
  .col-span-4, .col-span-5, .col-span-6, .col-span-6-end { grid-column: span 12; }
}

/* ---------- home: flow row ---------- */

.flow-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.flow-step {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 100px;
  padding: 10px 18px; font-size: 14px; font-weight: 500; color: var(--text-soft);
}
.flow-step-ai { border-color: rgba(45, 123, 255, 0.4); color: var(--blue); background: var(--blue-deep); }
.flow-arrow { color: var(--text-soft); font-size: 16px; }

/* ---------- home: hero dashboard mock ---------- */

.dash-grid { display: block; }

/* ---------- home: how it works steps ---------- */

.how-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; text-align: left; }
.how-step { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.how-step-n { font-family: var(--font-heading); font-size: 28px; font-weight: 600; }
@media (max-width: 991px) {
  .how-steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .how-steps { grid-template-columns: 1fr; }
}

/* ---------- home: check / cross lists ---------- */

.check-list, .cross-list { list-style: none; margin: 0; padding: 0; }
.check-list li, .cross-list li {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--border);
  color: var(--text); font-size: 15px;
}
.check-list li:last-child, .cross-list li:last-child { border-bottom: none; }
.check-list li::before { content: ""; width: 18px; height: 18px; flex-shrink: 0; border-radius: 50%; background: rgba(61, 220, 151, 0.12); border: 1px solid var(--success); }
.cross-list li::before { content: ""; width: 18px; height: 18px; flex-shrink: 0; border-radius: 50%; background: rgba(255, 107, 107, 0.1); border: 1px solid var(--critical); }

.multiselect-trigger {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  cursor: pointer; text-align: left; color: var(--text-soft);
}
.multiselect-trigger svg { flex-shrink: 0; color: var(--text-soft); }
.multiselect-panel {
  display: none; position: absolute; top: 100%; left: 0; right: 0; margin-top: 6px;
  background: var(--surface-1); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 8px; z-index: 10; box-shadow: 0 16px 40px -12px rgba(0,0,0,0.5);
}
.multiselect-panel.open { display: block; }
.multiselect-option {
  display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 6px;
  cursor: pointer; font-size: 14px; color: var(--text);
}
.multiselect-option:hover { background: var(--surface-2); }
.multiselect-option input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--blue); flex-shrink: 0; }

.link-list { list-style: none; margin: 0; padding: 0; }
.link-list li { padding: 10px 0; border-bottom: 1px solid var(--border); }
.link-list li:last-child { border-bottom: none; }
.link-list a { color: var(--text); font-size: 15px; transition: color 0.2s var(--ease); }
.link-list a:hover { color: var(--blue); }

/* ---------- rich content (legal pages / blog body) ---------- */

.prose h2 { font-size: 22px; line-height: 30px; margin: 40px 0 16px; scroll-margin-top: 96px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 18px; line-height: 26px; margin: 28px 0 12px; }
.prose p { color: var(--text-soft); font-size: 16px; line-height: 26px; margin-bottom: 16px; }
.prose ul, .prose ol { color: var(--text-soft); font-size: 16px; line-height: 26px; padding-left: 20px; margin-bottom: 16px; }
.prose li { margin-bottom: 8px; }
.prose a { color: var(--blue); text-decoration: underline; }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 32px 0; }
.prose strong { color: var(--text); }
.prose img { border-radius: var(--radius); margin: 24px 0; border: 1px solid var(--border); }

/* ---------- legal page layout ---------- */

.legal-layout { display: grid; grid-template-columns: 260px 1fr; gap: 48px; align-items: start; }
.legal-layout.article-layout { grid-template-columns: 1fr 260px; }
.legal-layout.legal-layout-no-index { grid-template-columns: 1fr; max-width: 760px; margin: 0 auto; }
.legal-content { max-width: 760px; }

.legal-sidebar-toggle { display: none; }

.legal-index { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.legal-index li { margin: 0; }
.legal-index a {
  display: block; padding: 8px 0 8px 16px; font-size: 14px; color: var(--text-soft);
  border-left: 2px solid transparent; margin-left: -1px; transition: color .2s var(--ease), border-color .2s var(--ease);
}
.legal-index a:hover { color: var(--text); }
.legal-index a.active { color: var(--blue); border-left-color: var(--blue); }

@media (min-width: 992px) {
  .legal-sidebar { position: sticky; top: 96px; }
}

@media (max-width: 991px) {
  .legal-layout { grid-template-columns: 1fr; gap: 16px; }
  .legal-sidebar-toggle {
    display: flex; align-items: center; justify-content: space-between; width: 100%;
    background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 14px 16px; color: var(--text); font-family: var(--font-body); font-weight: 600; font-size: 14px; cursor: pointer;
  }
  .legal-sidebar-inner { display: none; padding: 16px; background: var(--surface-1); border: 1px solid var(--border); border-top: none; border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
  .legal-sidebar-inner.open { display: block; }
}

/* ---------- blog ---------- */

.featured-post { display: grid; padding: 24px; align-items: center; }
.featured-post:hover { border-color: var(--border-strong); }

.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gutter); }
.blog-card { padding: 0; overflow: hidden; transition: border-color .2s var(--ease), transform .2s var(--ease); }
.blog-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.blog-card-thumb { aspect-ratio: 16/9; overflow: hidden; }
.blog-card > *:not(.blog-card-thumb) { margin-left: 24px; margin-right: 24px; }
.blog-card > *:last-child { margin-bottom: 24px; }

@media (max-width: 991px) {
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
  .featured-post { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .blog-grid { grid-template-columns: 1fr; }
}
