/* ============================================
   DESIGN SYSTEM — Thribus Tech
   Cores e variáveis baseadas no layout original
   ============================================ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: oklch(0.55 0.06 135);
  --primary-fg: oklch(0.98 0 0);
  --secondary: oklch(0.65 0.08 135);
  --secondary-fg: oklch(0.98 0 0);
  --bg: oklch(0.93 0.02 85);
  --fg: oklch(0.25 0.02 135);
  --card: oklch(0.97 0.01 85);
  --muted: oklch(0.88 0.03 85);
  --muted-fg: oklch(0.45 0.04 135);
  --border: oklch(0.85 0.03 85);
  --danger: #dc2626;
  --danger-fg: #fff;
  --radius: 0.5rem;
}

body {
  font-family: 'DM Sans', ui-sans-serif, system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
  min-height: 100vh;
}

.container { max-width: 1280px; margin: 0 auto; padding: 0 2rem; }

/* ============================================
   NAVIGATION
   ============================================ */
.nav {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.nav-logo { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.nav-logo img { height: 42px; width: auto; object-fit: contain; }
.nav-logo span { font-weight: 700; font-size: 0.8rem; color: var(--muted-fg); letter-spacing: 0.05em; text-transform: uppercase; }
.nav-actions { display: flex; align-items: center; gap: 10px; }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius);
  font-family: inherit; font-size: 0.875rem; font-weight: 600;
  border: none; cursor: pointer; transition: all 0.2s;
  text-decoration: none; white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--primary); color: var(--primary-fg); }
.btn-primary:hover { opacity: 0.9; }
.btn-secondary { background: var(--secondary); color: var(--secondary-fg); }
.btn-secondary:hover { opacity: 0.9; }
.btn-outline { background: transparent; color: var(--fg); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--muted); }
.btn-danger { background: var(--danger); color: var(--danger-fg); }
.btn-danger:hover { opacity: 0.9; }
.btn-ghost { background: transparent; color: var(--muted-fg); padding: 8px 12px; }
.btn-ghost:hover { color: var(--fg); background: var(--muted); }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }

/* ============================================
   VIEWS
   ============================================ */
.view { display: none; animation: fadeIn 0.3s ease; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================
   DASHBOARD
   ============================================ */
.dash-header { padding: 3rem 0 2rem; }
.dash-header h1 { font-size: 2rem; font-weight: 700; margin-bottom: 0.5rem; }
.dash-header p { color: var(--muted-fg); font-size: 1.05rem; }
.dash-stats { display: flex; gap: 1.5rem; margin-bottom: 2rem; flex-wrap: wrap; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 1.25rem 1.5rem; min-width: 160px; }
.stat-card .stat-num { font-size: 2rem; font-weight: 700; color: var(--primary); }
.stat-card .stat-label { font-size: 0.8rem; color: var(--muted-fg); text-transform: uppercase; letter-spacing: 0.05em; }
.proposals-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 1.5rem; padding-bottom: 4rem; }
.proposal-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; transition: box-shadow 0.2s, transform 0.2s; }
.proposal-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.1); transform: translateY(-2px); }
.proposal-card-head { padding: 1.25rem 1.5rem; background: var(--primary); color: var(--primary-fg); }
.proposal-card-head h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 2px; }
.proposal-card-head small { font-size: 0.8rem; opacity: 0.8; }
.proposal-card-body { padding: 1.25rem 1.5rem; }
.proposal-meta { display: flex; flex-direction: column; gap: 8px; margin-bottom: 1rem; }
.proposal-meta-row { display: flex; justify-content: space-between; align-items: center; font-size: 0.875rem; }
.proposal-meta-row .label { color: var(--muted-fg); }
.proposal-meta-row .value { font-weight: 600; }
.proposal-meta-row .value.green { color: var(--secondary); }
.proposal-card-actions { display: flex; gap: 8px; padding-top: 1rem; border-top: 1px solid var(--border); }
.proposal-card-actions .btn { flex: 1; justify-content: center; }

/* Empty state */
.empty-state { text-align: center; padding: 5rem 2rem; }
.empty-state svg { width: 64px; height: 64px; color: var(--muted-fg); margin-bottom: 1.5rem; opacity: 0.5; }
.empty-state h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }
.empty-state p { color: var(--muted-fg); margin-bottom: 1.5rem; }

/* ============================================
   FORM
   ============================================ */
.form-header { padding: 2rem 0 1.5rem; display: flex; align-items: center; justify-content: space-between; }
.form-header h2 { font-size: 1.5rem; font-weight: 700; }
.form-body { padding-bottom: 4rem; }
.form-section { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 1.5rem 2rem; margin-bottom: 1.5rem; }
.form-section-title { font-size: 1.1rem; font-weight: 700; color: var(--primary); margin-bottom: 1rem; display: flex; align-items: center; gap: 8px; }
.form-section-title svg { width: 20px; height: 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.form-row.full { grid-template-columns: 1fr; }
.form-row.triple { grid-template-columns: 1fr 1fr 1fr; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 0.8rem; font-weight: 600; color: var(--muted-fg); text-transform: uppercase; letter-spacing: 0.03em; }
.form-group input, .form-group textarea, .form-group select {
  padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius);
  font-family: inherit; font-size: 0.9rem; background: var(--bg); color: var(--fg);
  transition: border-color 0.2s; resize: vertical;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(100,140,80,0.1);
}
.form-group textarea { min-height: 80px; }
.form-help { font-size: 0.75rem; color: var(--muted-fg); margin-top: 2px; }

/* Repeatable groups */
.repeatable-group { border: 1px dashed var(--border); border-radius: var(--radius); padding: 1rem; margin-bottom: 0.75rem; position: relative; background: rgba(0,0,0,0.01); }
.repeatable-group .remove-btn { position: absolute; top: 8px; right: 8px; background: none; border: none; color: var(--danger); cursor: pointer; padding: 4px; border-radius: 4px; font-size: 1rem; }
.repeatable-group .remove-btn:hover { background: rgba(220,38,38,0.1); }
.add-btn { display: flex; align-items: center; gap: 6px; padding: 8px 16px; border: 1px dashed var(--border); border-radius: var(--radius); background: transparent; color: var(--muted-fg); font-family: inherit; font-size: 0.85rem; cursor: pointer; width: 100%; justify-content: center; transition: all 0.2s; }
.add-btn:hover { border-color: var(--primary); color: var(--primary); background: rgba(100,140,80,0.05); }
.form-footer { display: flex; justify-content: flex-end; gap: 12px; padding: 1.5rem 0; border-top: 1px solid var(--border); margin-top: 1rem; }

/* ============================================
   PREVIEW
   ============================================ */
.preview-toolbar { position: sticky; top: 72px; z-index: 50; background: var(--fg); color: var(--primary-fg); padding: 12px 0; box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.preview-toolbar-inner { display: flex; align-items: center; justify-content: space-between; }
.preview-toolbar-inner span { font-size: 0.85rem; opacity: 0.8; }
.preview-toolbar-actions { display: flex; gap: 8px; }

/* Proposal render styles */
.prop-hero { background: var(--primary); color: var(--primary-fg); padding: 5rem 0; }
.prop-hero-badge { display: inline-flex; align-items: center; border-radius: 9999px; border: 1px solid rgba(255,255,255,0.3); background: rgba(255,255,255,0.1); padding: 4px 12px; font-size: 0.875rem; margin-bottom: 1.5rem; }
.prop-hero-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--secondary); margin-right: 8px; }
.prop-hero h1 { font-size: 3.5rem; font-weight: 700; letter-spacing: -0.025em; margin-bottom: 1.5rem; line-height: 1.1; }
.prop-hero p { font-size: 1.25rem; color: rgba(255,255,255,0.8); max-width: 640px; line-height: 1.6; }
.prop-benefits { margin-top: -3rem; position: relative; z-index: 10; margin-bottom: 3rem; }
.prop-benefits-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.prop-b-card { background: var(--card); border-radius: 12px; padding: 1.5rem; box-shadow: 0 4px 12px rgba(0,0,0,0.08); border: 1px solid var(--border); }
.prop-b-card-icon { height: 48px; width: 48px; background: var(--muted); border-radius: 8px; display: flex; align-items: center; justify-content: center; margin-bottom: 1rem; color: var(--primary); }
.prop-b-card h3 { font-weight: 700; font-size: 1.125rem; margin-bottom: 0.5rem; }
.prop-b-card p { font-size: 0.875rem; color: var(--muted-fg); }
.prop-main { padding: 3rem 0 5rem; }
.prop-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 3rem; }
.prop-left { display: flex; flex-direction: column; gap: 3rem; }
.prop-sec-title { font-size: 1.5rem; font-weight: 700; color: var(--primary); display: flex; align-items: center; gap: 8px; margin-bottom: 1.5rem; }
.prop-sec-title svg { width: 24px; height: 24px; flex-shrink: 0; }
.prop-text { color: var(--muted-fg); line-height: 1.7; margin-bottom: 1rem; }
.prop-inc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.prop-inc-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.prop-inc-card-head { padding: 1.25rem 1.25rem 0.75rem; }
.prop-inc-card-head h3 { font-size: 1.05rem; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.prop-inc-card-head h3 svg { width: 20px; height: 20px; color: var(--secondary); flex-shrink: 0; }
.prop-inc-card-body { padding: 0 1.25rem 1.25rem; font-size: 0.875rem; color: var(--muted-fg); line-height: 1.6; }
.prop-timeline { position: relative; margin-left: 12px; padding-left: 2rem; border-left: 2px solid var(--border); }
.prop-tl-item { position: relative; padding-bottom: 2rem; }
.prop-tl-item:last-child { padding-bottom: 0; }
.prop-tl-num { position: absolute; left: -41px; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.875rem; }
.prop-tl-num.pri { background: var(--primary); color: var(--primary-fg); }
.prop-tl-num.sec { background: var(--secondary); color: var(--secondary-fg); }
.prop-tl-item h3 { font-weight: 700; font-size: 1.125rem; }
.prop-tl-item p { color: var(--muted-fg); font-size: 0.875rem; margin-top: 4px; }

/* FAQ */
.prop-faq-item { border-bottom: 1px solid var(--border); }
.prop-faq-trigger { width: 100%; background: none; border: none; padding: 1rem 0; font-size: 1rem; font-weight: 600; text-align: left; cursor: pointer; display: flex; justify-content: space-between; align-items: center; color: var(--fg); font-family: inherit; }
.prop-faq-trigger:hover { color: var(--primary); }
.prop-faq-content { overflow: hidden; max-height: 0; transition: max-height 0.3s ease; }
.prop-faq-content-inner { padding: 0 0 1rem; color: var(--muted-fg); font-size: 0.9rem; line-height: 1.6; }
.prop-faq-item.open .prop-faq-content { max-height: 300px; }
.prop-faq-chevron { transition: transform 0.3s; font-size: 0.75rem; color: var(--muted-fg); }
.prop-faq-item.open .prop-faq-chevron { transform: rotate(180deg); }

/* Investment card */
.prop-right { position: relative; }
.prop-invest { position: sticky; top: 140px; background: var(--card); border: 1px solid rgba(125,160,107,0.2); border-radius: var(--radius); box-shadow: 0 4px 20px rgba(0,0,0,0.08); overflow: hidden; }
.prop-invest-head { padding: 1.25rem; background: rgba(125,160,107,0.05); border-bottom: 1px solid rgba(125,160,107,0.1); }
.prop-invest-head h2 { font-size: 1.25rem; font-weight: 700; color: var(--primary); }
.prop-invest-body { padding: 1.5rem; }
.prop-price-label { font-size: 0.875rem; color: var(--muted-fg); margin-bottom: 4px; }
.prop-price-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.prop-price-big { font-size: 1.875rem; font-weight: 700; color: var(--fg); }
.prop-price-huge { font-size: 2.25rem; font-weight: 700; color: var(--secondary); }
.prop-price-sub { font-size: 0.875rem; color: var(--muted-fg); }
.prop-plan-badge { background: rgba(0,0,0,0.03); padding: 8px; border-radius: 4px; text-align: center; font-size: 0.75rem; color: var(--muted-fg); margin-top: 4px; }
.prop-sep { height: 1px; background: var(--border); margin: 1rem 0; }
.prop-line { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; font-size: 0.875rem; }
.prop-line .v { font-weight: 500; }
.prop-inc-box { background: rgba(0,0,0,0.02); padding: 1rem; border-radius: 8px; margin-top: 1.5rem; font-size: 0.875rem; }
.prop-inc-box .hd { font-weight: 600; display: flex; align-items: center; gap: 8px; margin-bottom: 0.5rem; }
.prop-inc-box .hd svg { width: 16px; height: 16px; color: var(--secondary); }
.prop-inc-box ul { list-style: disc; padding-left: 1.25rem; color: var(--muted-fg); }
.prop-inc-box ul li { padding: 2px 0; }
.prop-cta { display: block; width: 100%; padding: 14px; font-size: 1.125rem; font-weight: 600; text-align: center; background: var(--secondary); color: var(--secondary-fg); border: none; border-radius: var(--radius); cursor: pointer; margin-top: 1.5rem; text-decoration: none; }
.prop-cta:hover { opacity: 0.9; }
.prop-foot { background: var(--card); border-top: 1px solid var(--border); padding: 2rem 0; text-align: center; font-size: 0.875rem; color: var(--muted-fg); }

/* ============================================
   MODAL
   ============================================ */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 200; align-items: center; justify-content: center; }
.modal-overlay.active { display: flex; }
.modal { background: var(--card); border-radius: 12px; padding: 2rem; max-width: 420px; width: 90%; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.modal h3 { font-size: 1.25rem; margin-bottom: 0.75rem; }
.modal p { color: var(--muted-fg); margin-bottom: 1.5rem; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ============================================
   DROPDOWN
   ============================================ */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  display: none; position: absolute; top: 100%; right: 0; margin-top: 4px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12); min-width: 200px; z-index: 150;
  overflow: hidden;
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu button {
  display: block; width: 100%; padding: 10px 16px; border: none; background: none;
  font-family: inherit; font-size: 0.85rem; text-align: left; cursor: pointer;
  color: var(--fg); transition: background 0.15s;
}
.dropdown-menu button:hover { background: var(--muted); }
.dropdown-menu button + button { border-top: 1px solid var(--border); }

/* ============================================
   SHARE MODAL
   ============================================ */
.share-modal h3 { display: flex; align-items: center; gap: 8px; }
.share-modal h3 svg { color: var(--primary); flex-shrink: 0; }
.share-link-box {
  display: flex; gap: 8px; margin: 1rem 0;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 4px;
}
.share-link-box input {
  flex: 1; border: none; background: transparent;
  font-family: inherit; font-size: 0.85rem; color: var(--fg);
  padding: 8px 12px; outline: none; min-width: 0;
}
.share-link-box .btn { flex-shrink: 0; }
.share-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.btn-whatsapp {
  background: #25D366; color: #fff;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius);
  font-family: inherit; font-size: 0.875rem; font-weight: 600;
  border: none; cursor: pointer; transition: all 0.2s;
}
.btn-whatsapp:hover { background: #1da851; }
.btn-whatsapp svg { flex-shrink: 0; }

/* ============================================
   TOAST
   ============================================ */
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--fg); color: var(--primary-fg); padding: 14px 24px; border-radius: var(--radius); font-size: 0.9rem; font-weight: 500; box-shadow: 0 8px 24px rgba(0,0,0,0.2); z-index: 300; transform: translateY(100px); opacity: 0; transition: all 0.3s ease; }
.toast.show { transform: translateY(0); opacity: 1; }

/* ============================================
   LOADING
   ============================================ */
.loading { text-align: center; padding: 3rem; color: var(--muted-fg); }
.spinner { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.6s linear infinite; margin: 0 auto 1rem; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .prop-grid { grid-template-columns: 1fr; }
  .prop-benefits-grid { grid-template-columns: repeat(2, 1fr); }
  .prop-hero h1 { font-size: 2.5rem; }
  .proposals-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .prop-benefits-grid { grid-template-columns: 1fr; }
  .prop-inc-grid { grid-template-columns: 1fr; }
  .prop-hero h1 { font-size: 2rem; }
  .container { padding: 0 1rem; }
  .form-row, .form-row.triple { grid-template-columns: 1fr; }
  .nav-logo span { display: none; }
  .nav-actions { gap: 6px; }
  .nav-actions .btn-ghost span { display: none; }
}
