/* ═══════════════════════════════════════════════════════
   RÊS — Design System Compartilhado
   Importar em todos os HTMLs antes do CSS específico
═══════════════════════════════════════════════════════ */

/* ── TOKENS ──────────────────────────────────────────── */
:root {
  /* Laranja — acento investidor / marca */
  --o:  #C96000;
  --o2: #E07000;
  --op: rgba(201,96,0,0.10);
  --ob: rgba(201,96,0,0.20);

  /* Esmeralda — acento produtor (uso esporádico) */
  --e:  #1A6B47;
  --e2: #238055;
  --ep: rgba(26,107,71,0.09);
  --eb: rgba(26,107,71,0.20);

  /* Backgrounds calorosos */
  --c1: #F5EEE3;
  --c2: #EDE4D0;
  --c3: #E3D6BE;
  --c4: #D8C9AF;
  --dark: #1C1208;
  --dark2: #2C1E0E;
  --surface: rgba(255,255,255,0.65);
  --surface2: rgba(255,255,255,0.88);

  /* Texto */
  --t1: #1C1208;
  --t2: #4C3820;
  --t3: #8C7050;
  --t4: #B89870;

  /* Linhas */
  --ln:  rgba(28,18,8,0.08);
  --ln2: rgba(28,18,8,0.14);
  --lno: rgba(201,96,0,0.18);
  --lne: rgba(26,107,71,0.18);

  /* Sombras */
  --sh:  0 1px 4px rgba(28,18,8,0.06), 0 6px 20px rgba(28,18,8,0.05);
  --sh2: 0 4px 16px rgba(28,18,8,0.10), 0 20px 60px rgba(28,18,8,0.07);

  /* Status */
  --red:    #C0392B; --red-bg:    rgba(192,57,43,0.09);
  --blue:   #2E6DA4; --blue-bg:   rgba(46,109,164,0.09);
  --yellow: #B8860B; --yellow-bg: rgba(184,134,11,0.09);
  --green:  #1A6B47; --green-bg:  rgba(26,107,71,0.09);

  /* Misc */
  --r:   10px;
  --r2:  16px;
  --r3:  20px;
  --pad: 64px;
}

/* ── RESET ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0 }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: 'Hanken Grotesk', sans-serif;
  color: var(--t1);
  background: var(--c1);
  overflow-x: hidden;
  line-height: 1.6;
}
a   { color: inherit; text-decoration: none }
img { display: block; max-width: 100% }
button, input, select, textarea { font: inherit; cursor: pointer }
textarea { cursor: text }

/* ── TIPOGRAFIA ──────────────────────────────────────── */
.font-display { font-family: 'Bebas Neue', sans-serif }
.font-mono    { font-family: 'DM Mono', monospace; font-feature-settings: 'tnum' 1 }

/* ── NAV TOPO (compartilhado investidor / produtor) ──── */
.top-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 500;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--pad); height: 66px;
  background: rgba(245,238,227,0.93);
  backdrop-filter: blur(24px) saturate(130%);
  border-bottom: 1px solid var(--ln2);
  transition: background .3s;
}
.top-nav-logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
}
.top-nav-logo img {
  height: 40px; width: auto; display: block;
}
.top-nav-logo-text {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px; letter-spacing: .05em; color: #1C1208;
  display: flex; flex-direction: column; gap: 1px;
}
.top-nav-logo-sub {
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 8px; letter-spacing: .26em;
  text-transform: uppercase; color: #8C7050; line-height: 1;
}
.top-nav-links {
  display: flex; align-items: center; gap: 28px; list-style: none;
}
.top-nav-links a {
  font-size: 11px; font-weight: 500; letter-spacing: .12em;
  text-transform: uppercase; color: var(--t3); transition: color .2s;
}
.top-nav-links a:hover, .top-nav-links a.active { color: var(--t1) }
.top-nav-right { display: flex; align-items: center; gap: 12px }

/* Nav user info */
.nav-user { display: flex; align-items: center; gap: 10px }
.nav-user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
  border: 1.5px solid var(--ln2);
}
.nav-user-avatar.orange { background: var(--op); color: var(--o); border-color: var(--ob) }
.nav-user-avatar.green  { background: var(--ep); color: var(--e); border-color: var(--eb) }
.nav-user-name { font-size: 13px; color: var(--t1); font-weight: 500 }
.nav-user-role { font-size: 9px; letter-spacing: .14em; text-transform: uppercase }
.nav-user-role.orange { color: var(--o) }
.nav-user-role.green  { color: var(--e) }

/* ── BOTÕES ──────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 7px; border-radius: var(--r);
  font-size: 11px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; transition: all .2s; cursor: pointer;
  border: 1px solid transparent;
}
.btn-sm  { padding: 7px 14px; font-size: 10px }
.btn-md  { padding: 10px 20px }
.btn-lg  { padding: 14px 28px; font-size: 12px }
.btn-full { width: 100% }

.btn-orange {
  background: var(--o); color: #fff; border-color: var(--o);
}
.btn-orange:hover { background: var(--o2); border-color: var(--o2) }
.btn-orange:disabled { opacity: .45; cursor: not-allowed }

.btn-green {
  background: var(--e); color: #fff; border-color: var(--e);
}
.btn-green:hover { background: var(--e2); border-color: var(--e2) }
.btn-green:disabled { opacity: .45; cursor: not-allowed }

.btn-dark {
  background: var(--t1); color: #fff; border-color: var(--t1);
}
.btn-dark:hover { background: var(--t2); border-color: var(--t2) }

.btn-ghost {
  background: transparent; color: var(--t2);
  border-color: var(--ln2);
}
.btn-ghost:hover { border-color: var(--t2); color: var(--t1) }
.btn-ghost:disabled { opacity: .45; cursor: not-allowed }

.btn-ghost-orange {
  background: transparent; color: var(--o); border-color: var(--ob);
}
.btn-ghost-orange:hover { background: var(--op) }

.btn-ghost-green {
  background: transparent; color: var(--e); border-color: var(--eb);
}
.btn-ghost-green:hover { background: var(--ep) }

.btn-danger {
  background: transparent; color: var(--red); border-color: rgba(192,57,43,0.25);
}
.btn-danger:hover { background: var(--red-bg) }

/* Spinner dentro de botão */
.btn-spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff; border-radius: 50%;
  animation: spin .7s linear infinite; display: none;
}
.btn.loading .btn-spinner { display: block }
.btn.loading .btn-text  { opacity: .6 }
@keyframes spin { to { transform: rotate(360deg) } }

/* ── CARDS ───────────────────────────────────────────── */
.card {
  background: var(--surface2);
  border: 1px solid var(--ln);
  border-radius: var(--r3);
  box-shadow: var(--sh);
  overflow: hidden;
}
.card-sm  { border-radius: var(--r2) }

.card-header {
  padding: 16px 22px;
  background: var(--c2);
  border-bottom: 1px solid var(--ln);
  display: flex; align-items: center; justify-content: space-between;
}
.card-body { padding: 22px }
.card-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--ln);
  background: var(--c1);
}

/* ── FORMULÁRIOS ─────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px }
.field-label {
  font-size: 10px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--t3);
  font-family: 'DM Mono', monospace;
}
.field-input {
  background: #FFFFFF; border: 1px solid var(--ln2);
  border-radius: 8px; padding: 12px 16px;
  color: var(--t1); font-size: 14px;
  transition: border-color .2s, box-shadow .2s; outline: none;
  -webkit-appearance: none;
}
.field-input:focus {
  box-shadow: 0 0 0 3px rgba(201,96,0,0.08);
  border-color: var(--o);
}
.field-input.focus-green:focus {
  box-shadow: 0 0 0 3px rgba(26,107,71,0.08);
  border-color: var(--e);
}
.field-input.error { border-color: var(--red) }
.field-input.valid { border-color: var(--e) }
.field-input::placeholder { color: var(--t4) }
select.field-input option { background: #fff; color: var(--t1) }
.field-error { font-size: 11px; color: var(--red); display: none }
.field-error.show { display: block }
.field-hint  { font-size: 10px; color: var(--t4) }

/* Password toggle wrapper */
.pw-wrap { position: relative }
.pw-wrap .field-input { padding-right: 48px }
.pw-toggle {
  position: absolute; right: 14px; top: 50%;
  transform: translateY(-50%); background: none;
  border: none; color: var(--t3); cursor: pointer;
  padding: 4px; display: flex; align-items: center;
  transition: color .2s;
}
.pw-toggle:hover { color: var(--t1) }
.pw-toggle svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.5 }

/* Alerta de erro global */
.form-alert {
  padding: 12px 16px;
  border-radius: 8px; font-size: 12px;
  display: none;
}
.form-alert.show { display: block }
.form-alert.error { background: var(--red-bg); border: 1px solid rgba(192,57,43,.2); color: var(--red) }
.form-alert.success { background: var(--green-bg); border: 1px solid rgba(26,107,71,.2); color: var(--e) }

/* ── BADGES / PILLS ──────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 4px;
  font-size: 9px; letter-spacing: .1em; text-transform: uppercase;
  font-family: 'DM Mono', monospace; font-weight: 500;
}
.badge-orange { background: var(--op); color: var(--o); border: 1px solid var(--ob) }
.badge-green  { background: var(--ep); color: var(--e); border: 1px solid var(--eb) }
.badge-red    { background: var(--red-bg); color: var(--red); border: 1px solid rgba(192,57,43,.2) }
.badge-blue   { background: var(--blue-bg); color: var(--blue); border: 1px solid rgba(46,109,164,.2) }
.badge-yellow { background: var(--yellow-bg); color: var(--yellow); border: 1px solid rgba(184,134,11,.2) }
.badge-gray   { background: rgba(28,18,8,.05); color: var(--t3); border: 1px solid var(--ln2) }

.pill {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 999px;
  font-size: 10px; letter-spacing: .06em;
  background: var(--c3); color: var(--t2); border: 1px solid var(--ln2);
}

/* Live dot */
.live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--e); display: inline-block;
  box-shadow: 0 0 8px rgba(26,107,71,.55);
  animation: livePulse 2s ease infinite;
}
@keyframes livePulse {
  0%,100% { opacity:1; box-shadow:0 0 8px rgba(26,107,71,.55) }
  50%      { opacity:.5; box-shadow:0 0 12px rgba(26,107,71,.25) }
}
.live-dot.orange {
  background: var(--o);
  box-shadow: 0 0 8px rgba(201,96,0,.5);
  animation-name: livePulseO;
}
@keyframes livePulseO {
  0%,100% { opacity:1; box-shadow:0 0 8px rgba(201,96,0,.5) }
  50%      { opacity:.5; box-shadow:0 0 12px rgba(201,96,0,.25) }
}

/* ── PROGRESS BAR ────────────────────────────────────── */
.progress-track {
  height: 4px; background: var(--c3);
  border-radius: 99px; overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: 99px;
  background: linear-gradient(to right, var(--o), var(--o2));
  transition: width .8s ease;
}
.progress-fill.green {
  background: linear-gradient(to right, var(--e), var(--e2));
}

/* ── TABLE ───────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse }
.data-table th {
  padding: 9px 14px;
  font-size: 9px; letter-spacing: .15em; text-transform: uppercase;
  color: var(--t3); font-family: 'DM Mono', monospace; font-weight: 400;
  text-align: left; border-bottom: 1px solid var(--ln); white-space: nowrap;
}
.data-table td {
  padding: 12px 14px;
  font-size: 12px; color: var(--t2);
  border-bottom: 1px solid var(--ln); vertical-align: middle;
}
.data-table tbody tr { transition: background .15s; cursor: pointer }
.data-table tbody tr:hover { background: var(--c2) }
.data-table tbody tr:last-child td { border-bottom: none }
.td-mono { font-family: 'DM Mono', monospace; font-size: 11px; font-feature-settings: 'tnum' 1 }

/* ── TOAST ───────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 999;
  background: var(--surface2); border: 1px solid var(--ln2);
  border-radius: 10px; padding: 12px 18px;
  font-size: 13px; color: var(--t1);
  display: flex; align-items: center; gap: 10px;
  box-shadow: var(--sh2);
  transform: translateY(60px); opacity: 0;
  transition: all .3s; pointer-events: none;
}
.toast.show { transform: none; opacity: 1 }
.toast.ok  { border-color: var(--eb); color: var(--e) }
.toast.err { border-color: rgba(192,57,43,.3); color: var(--red) }

/* ── MODAL ───────────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(28,18,8,0.35);
  backdrop-filter: blur(4px);
  z-index: 600; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex }
.modal {
  background: var(--surface2); border: 1px solid var(--ln2);
  border-radius: var(--r3); width: 100%; max-width: 600px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 8px 40px rgba(28,18,8,0.18);
  position: relative;
}
.modal::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--o), transparent);
  opacity: .4; border-radius: var(--r3) var(--r3) 0 0;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; border-bottom: 1px solid var(--ln);
}
.modal-title { font-family: 'Bebas Neue', sans-serif; font-size: 20px; letter-spacing: .04em; color: var(--t1) }
.modal-close {
  width: 30px; height: 30px; background: var(--c2);
  border: none; border-radius: 6px; color: var(--t3);
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.modal-close:hover { background: var(--c3); color: var(--t1) }
.modal-close svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2 }
.modal-body { padding: 24px }
.modal-foot { padding: 14px 24px; border-top: 1px solid var(--ln); display: flex; justify-content: flex-end; gap: 10px }

/* Confirm overlay */
.confirm-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(28,18,8,0.35); z-index: 700;
  align-items: center; justify-content: center;
}
.confirm-overlay.open { display: flex }
.confirm-box {
  background: var(--surface2); border: 1px solid rgba(192,57,43,.2);
  border-radius: var(--r3); padding: 28px; max-width: 360px; width: 100%;
  text-align: center; box-shadow: var(--sh2);
}
.confirm-title { font-family: 'Bebas Neue', sans-serif; font-size: 20px; margin-bottom: 8px; color: var(--t1) }
.confirm-text  { font-size: 13px; color: var(--t3); margin-bottom: 24px; line-height: 1.6 }
.confirm-text strong { color: var(--t1) }

/* ── SECTION EYEBROW ─────────────────────────────────── */
.eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 10px; letter-spacing: .25em; text-transform: uppercase;
  color: var(--o); display: flex; align-items: center; gap: 8px;
  margin-bottom: 16px;
}
.eyebrow::before { content: ''; width: 18px; height: 1px; background: var(--o) }
.eyebrow.green { color: var(--e) }
.eyebrow.green::before { background: var(--e) }
.eyebrow.center { justify-content: center }
.eyebrow.center::before, .eyebrow.center::after { content: ''; width: 20px; height: 1px; background: currentColor; opacity: .5 }

/* ── BACK LINK ───────────────────────────────────────── */
.back-link {
  position: fixed; top: 20px; left: clamp(16px, 3vw, 28px); z-index: 600;
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 16px 0 11px; border-radius: 999px;
  background: rgba(255,255,255,0.6); border: 1px solid var(--ln2);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  font-size: 13px; font-weight: 500; letter-spacing: .01em;
  color: var(--t2); transition: color .2s, background .2s, border-color .2s;
}
.back-link:hover { color: var(--t1); background: rgba(255,255,255,0.9); border-color: rgba(28,18,8,0.28) }
.back-link svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round }

/* ── RESPONSIVE PAD ──────────────────────────────────── */
@media (max-width: 960px) {
  :root { --pad: 20px }
  .top-nav-links { display: none }
}

/* ── ANIMAÇÕES ───────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px) }
  to   { opacity: 1; transform: none }
}
@keyframes fadeIn {
  from { opacity: 0 } to { opacity: 1 }
}
.anim-up  { animation: fadeUp .55s ease both }
.anim-in  { animation: fadeIn .5s ease both }
.anim-d1  { animation-delay: .06s }
.anim-d2  { animation-delay: .12s }
.anim-d3  { animation-delay: .18s }
