/* ============================================================
   FNX STRATEGIC INTELLIGENCE — DESIGN SYSTEM v2.0
   Status: Auditoria Premium Black/Silver
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant:ital,wght@0,300;0,400;0,500;1,300&family=Archivo:wght@300;400;500;600&family=JetBrains+Mono:wght@300;400&display=swap');

:root {
  /* — BACKGROUNDS — */
  --bg-base:     #0a0a0a;
  --bg-surface:  #111111;
  --bg-elevated: #181818;

  /* — TEXT — */
  --text-primary:   #F0EEE8;
  --text-secondary: #888880;
  --text-tertiary:  #444440;
  
  /* — ACCENT — */
  --silver:         #B8B4AA;
  --silver-bright:  #D4D0C8;
  --gold:           #A8883C; /* Uso rigorosamente interno. UI pública deve abster. */

  /* — BORDERS — */
  --border:         rgba(255,255,255,0.07);
  --border-mid:     rgba(255,255,255,0.10);
  --border-hi:      rgba(255,255,255,0.14);

  /* — TYPE — */
  --font-display: 'Cormorant', serif;
  --font-body:    'Archivo', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  /* — PROPORTIONAL SPACING (8px Grid) — */
  --gap-xs: 8px;
  --gap-sm: 16px;
  --gap-md: 24px;
  --gap-lg: 48px;
  --gap-xl: 64px;

  /* — RADIUS — */
  --r-sm: 4px;
  --r-md: 4px; /* Arquitetura exige limites de 4px, máx 8px */
  --r-lg: 8px;
}

/* ==================== GLOBAL RESET ==================== */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-weight: 300;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========================================
   2.1. HIGH-END TEXTURE (AESTHETIC NOISE)
   ======================================== */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* ========================================
   2.2. MOTION (STAGGERED REVEAL)
   ======================================== */
@keyframes luxuryReveal {
    0% { opacity: 0; transform: translateY(10px); filter: blur(4px); }
    100% { opacity: 1; transform: translateY(0); filter: blur(0); }
}

.fnx-metric-card, .fnx-table tbody tr, .fnx-section {
    animation: luxuryReveal 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.fnx-metric-card:nth-child(1) { animation-delay: 0.1s; }
.fnx-metric-card:nth-child(2) { animation-delay: 0.2s; }
.fnx-metric-card:nth-child(3) { animation-delay: 0.3s; }
.fnx-metric-card:nth-child(4) { animation-delay: 0.4s; }

/* ==================== CORE SHELL / WRAPPER ==================== */
.fnx-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--gap-lg) 40px;
  padding-bottom: 120px;
}

/* ==================== HEADER (BOUTIQUE) ==================== */
.fnx-header {
  padding-top: var(--gap-lg);
  padding-bottom: var(--gap-md);
  margin-bottom: var(--gap-lg);
  border-bottom: 0.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fnx-logo {
  display: block;
  text-decoration: none;
  flex-shrink: 0;
  line-height: 0;
}
.fnx-logo img {
  /* O canvas do PNG é 3:2. O logotipo ocupa ~65% do centro.
     160px de largura = wordmark visível de ~104px — proporcional para nav. */
  width: 160px;
  height: auto;
  display: block;
  mix-blend-mode: screen;
  opacity: 0.9;
  transition: opacity .25s;
  object-fit: contain;
}
.fnx-logo img:hover { opacity: 1; }
/* Nav centrado: wrapper precisa de position: relative */
.fnx-logo--center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
/* Legado */
.fnx-logo div { display: none; }

.fnx-header-title {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 300;
  letter-spacing: .02em;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: var(--gap-xs);
}

.fnx-section-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 300;
  color: var(--text-primary);
  margin-bottom: var(--gap-xs);
}

.fnx-header-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 12px;
}

.fnx-header-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ==================== HUB CARDS ==================== */
.fnx-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 0.5px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: var(--gap-xl);
  overflow: hidden;
}

.fnx-hub-cell {
  background: var(--bg-surface);
  padding: var(--gap-md) 20px;
  cursor: pointer;
  transition: background .15s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 160px;
  text-decoration: none;
  color: inherit;
}

.fnx-hub-cell:hover {
  background: var(--bg-elevated);
}

.fnx-cell-eyebrow {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.fnx-cell-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: .05em;
}

.fnx-cell-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.6;
  flex: 1;
}

.fnx-cell-arrow {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--silver);
  letter-spacing: .08em;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}
.fnx-cell-arrow::after {
  content: '→';
}

.fnx-hub-cell.restricted {
  background: var(--bg-surface);
  opacity: 0.8;
}

/* ==================== GRID & METRICS ==================== */
.fnx-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: var(--gap-lg);
}

.fnx-metric-card {
    background-color: var(--bg-surface);
    border: .5px solid var(--border);
    padding: var(--gap-md);
    border-radius: var(--r-md);
    display: flex;
    flex-direction: column;
    gap: var(--gap-xs);
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.fnx-metric-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at top right, rgba(255,255,255,0.03), transparent 60%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.fnx-metric-card:hover {
    border-color: var(--border-hi);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.5);
}

.fnx-metric-card:hover::before {
    opacity: 1;
}

.fnx-metric-label {
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: var(--gap-xs);
}

.fnx-metric-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 300;
  color: var(--text-primary);
  line-height: 1;
}
.fnx-metric-value.accent {
  color: var(--silver-bright);
}

/* ==================== BUTTONS & CTAS ==================== */
.fnx-btn {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  padding: 12px 16px;
  cursor: pointer;
  border-radius: var(--r-sm);
  transition: all .2s ease;
  display: inline-block;
  text-decoration: none;
  background: transparent;
}

/* O CTA principal não é sólido. É prateado e severo. */
.fnx-btn-primary {
    background: var(--text-primary);
    color: var(--deep-obsidian);
    border: transparent;
    font-weight: 500;
}

.fnx-btn-primary:hover {
    background: var(--silver);
    color: #000;
    box-shadow: 0 0 15px rgba(255,255,255,0.1);
}

.fnx-btn-ghost {
  color: var(--text-secondary);
  border: 0.5px solid transparent;
  padding: 8px 12px;
}
.fnx-btn-ghost:hover {
  color: var(--text-primary);
  border: 0.5px solid var(--border-hi);
}

.fnx-btn-ghost.active {
  color: var(--text-primary);
  border: 0.5px solid var(--border-hi);
  background: var(--bg-elevated);
}

/* Inputs */
.fnx-input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 0.5px solid rgba(255,255,255,0.08);
  border-radius: var(--r-sm);
  padding: 12px 16px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .12em;
  outline: none;
  transition: border-color .15s ease;
}
.fnx-input:focus { border-color: var(--border-hi); color: var(--text-primary); }
.fnx-input::placeholder { color: var(--text-tertiary); }

/* Badges & Tags */
.fnx-tag-mono {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  color: var(--silver);
  background: rgba(42,66,90,0.2);
  border: 0.5px solid rgba(42,66,90,0.5);
  padding: 2px 6px;
  border-radius: var(--r-sm);
  letter-spacing: .05em;
  display: inline-block;
}

.fnx-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 3px;
}
.fnx-status-ok { color: var(--ok-text); }
.fnx-status-bad { color: var(--danger-text); opacity: 0.7;}

/* ==================== LUXURY TABLE ==================== */
.fnx-table-wrapper {
  margin-bottom: var(--gap-lg);
}

.fnx-table {
  width: 100%;
  border-collapse: collapse;
}

.fnx-table th {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  padding: 12px 16px;
  text-align: left;
  border-bottom: 0.5px solid var(--border-hi);
  background: var(--bg-elevated);
}

.fnx-table th:first-child { border-radius: var(--r-sm) 0 0 0; }
.fnx-table th:last-child { border-radius: 0 var(--r-sm) 0 0; }

.fnx-table td {
  padding: 16px 16px;
  font-size: 12px;
  color: var(--text-secondary);
  border-bottom: 0.5px solid var(--border);
  vertical-align: top;
}

.fnx-table tr:last-child td {
  border-bottom: none;
}

.fnx-table tr {
  transition: background .15s;
}

.fnx-table-clickable-row {
  cursor: pointer;
}
.fnx-table-clickable-row:hover {
  background: var(--bg-surface);
}

.fnx-table tbody tr {
    border-bottom: .5px solid var(--border);
    font-size: 13px;
    position: relative;
    transition: background-color 0.4s ease, border-color 0.4s ease;
}

.fnx-table tbody tr:hover {
    background-color: rgba(255,255,255,0.02);
    border-bottom-color: var(--border-hi);
}

.fnx-td-primary {
  color: var(--text-primary) !important;
  font-weight: 500;
}
.fnx-td-silver {
  color: var(--silver-bright) !important;
}

/* ==================== VAULT ==================== */
.fnx-vault-overlay {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: var(--bg-base);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.fnx-vault-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-surface);
  border: 0.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 48px 52px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.fnx-vault-logo {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.fnx-vault-logo div {
  width: 0.5px; height: 18px; background: rgba(255,255,255,0.2);
}

.fnx-vault-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.fnx-vault-input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 0.5px solid rgba(255,255,255,0.08);
  border-radius: var(--r-sm);
  padding: 14px 16px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .12em;
  text-align: center;
  outline: none;
  margin-bottom: var(--gap-xs);
}

.fnx-vault-btn {
  width: 100%;
}

.fnx-vault-error {
  display: none;
  color: var(--danger-text);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .08em;
  margin-top: var(--gap-xs);
}

/* ==================== FOOTER ==================== */
.fnx-footer {
  padding: 60px 0;
  border-top: 0.5px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
.fnx-footer-brand {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 300;
  color: var(--text-secondary);
}
.fnx-footer-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
  text-align: right;
  line-height: 1.8;
}

.brand-logo-img { height: 28px; width: auto; object-fit: contain; filter: brightness(1) invert(0); margin-bottom: 8px; justify-content: flex-end; }

