/* ---------- Design tokens ---------- */
:root {
  --ink: #121d16;
  --surface: #1b2a20;
  --surface-2: #22331f;
  --surface-hover: #253829;
  --border: #2c4130;
  --border-soft: #24371f;
  --accent: #8bc53f;
  --accent-dark: #74a934;
  --accent-fg: #10190f;
  --fg: #f4f7f1;
  --muted: #a3b39a;
  --muted-2: #7c8c76;
  --danger: #e0665a;
  --warning: #e0b23f;
  --radius: 1rem;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, p { margin: 0; }
button { font-family: inherit; }
::selection { background: var(--accent); color: var(--accent-fg); }

.container { max-width: 80rem; margin: 0 auto; padding: 0 1.25rem; }
@media (min-width: 1024px) { .container { padding: 0 2rem; } }
.section { padding: 5rem 0; }
.section-tight { padding: 3rem 0; }

.muted { color: var(--muted); }
.muted-2 { color: var(--muted-2); }
.text-accent { color: var(--accent); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.eyebrow { color: var(--accent); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.h1 { font-size: clamp(2rem, 4vw, 3.25rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; }
.h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); font-weight: 800; line-height: 1.15; letter-spacing: -0.01em; }
.h3 { font-size: 1.25rem; font-weight: 700; }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 42rem; }
.center { text-align: center; margin-left: auto; margin-right: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-weight: 600; font-size: 0.9rem; padding: 0.7rem 1.25rem; border-radius: 0.85rem;
  border: 1px solid transparent; cursor: pointer; transition: background 0.15s, opacity 0.15s;
  white-space: nowrap;
}
.btn-lg { padding: 0.9rem 1.75rem; font-size: 1rem; border-radius: 0.9rem; }
.btn-sm { padding: 0.45rem 0.9rem; font-size: 0.82rem; border-radius: 0.65rem; }
.btn-primary { background: var(--accent); color: var(--accent-fg); }
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary { background: var(--surface-2); color: var(--fg); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface-hover); }
.btn-outline { background: transparent; color: var(--fg); border-color: var(--border); }
.btn-outline:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--fg); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: 0.9; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Cards / badges ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card-pad { padding: 1.75rem; }
.badge {
  display: inline-flex; align-items: center; gap: 0.35rem; border-radius: 999px;
  padding: 0.3rem 0.75rem; font-size: 0.75rem; font-weight: 600; border: 1px solid transparent;
}
.badge-accent { background: rgba(139,197,63,0.15); color: var(--accent); border-color: rgba(139,197,63,0.3); }
.badge-neutral { background: var(--surface-2); color: var(--muted); border-color: var(--border); }
.badge-warning { background: rgba(224,178,63,0.15); color: var(--warning); border-color: rgba(224,178,63,0.3); }
.badge-danger { background: rgba(224,102,90,0.15); color: var(--danger); border-color: rgba(224,102,90,0.3); }
.badge-outline { background: transparent; color: var(--fg); border-color: var(--border); }

/* ---------- Forms ---------- */
.field { margin-bottom: 1.1rem; }
.field label { display: block; margin-bottom: 0.4rem; font-size: 0.85rem; font-weight: 600; }
.field input[type=text], .field input[type=email], .field input[type=password],
.field input[type=number], .field input[type=date], .field input[type=tel],
.field textarea, .field select {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border); border-radius: 0.6rem;
  padding: 0.65rem 0.85rem; color: var(--fg); font-size: 0.92rem; font-family: inherit;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 5rem; }
.help { font-size: 0.78rem; color: var(--muted-2); margin-top: 0.35rem; }
.error-box { background: rgba(224,102,90,0.12); border: 1px solid rgba(224,102,90,0.35); color: var(--danger); border-radius: 0.6rem; padding: 0.75rem 1rem; font-size: 0.88rem; margin-bottom: 1.1rem; }
.success-box { background: rgba(139,197,63,0.12); border: 1px solid rgba(139,197,63,0.35); color: var(--accent); border-radius: 0.6rem; padding: 0.75rem 1rem; font-size: 0.88rem; margin-bottom: 1.1rem; }

/* ---------- Grid helpers ---------- */
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(1, 1fr); }
.grid-3 { grid-template-columns: repeat(1, 1fr); }
.grid-4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) { .grid-4 { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 768px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Site header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(18,29,22,0.95); backdrop-filter: blur(6px); border-bottom: 1px solid var(--border); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 4rem; }
.logo { display: flex; align-items: center; gap: 0.5rem; font-weight: 800; font-size: 1.1rem; }
.logo-icon { display: flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: 0.5rem; background: var(--accent); color: var(--accent-fg); }
.nav-links { display: none; align-items: center; gap: 2rem; }
.nav-links a { font-size: 0.9rem; font-weight: 500; color: var(--muted); }
.nav-links a:hover { color: var(--fg); }
.nav-actions { display: none; align-items: center; gap: 0.75rem; }
.nav-toggle { display: flex; background: none; border: none; color: var(--fg); cursor: pointer; padding: 0.4rem; }
@media (min-width: 768px) {
  .nav-links, .nav-actions { display: flex; }
  .nav-toggle { display: none; }
}
.mobile-menu { display: none; border-top: 1px solid var(--border); padding: 1rem 1.25rem 1.25rem; }
.mobile-menu.open { display: flex; flex-direction: column; gap: 1rem; }
.mobile-menu a { font-size: 0.9rem; color: var(--muted); }
.mobile-menu .nav-actions { display: flex; flex-direction: column; margin-top: 0.5rem; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 4rem 0 2rem; }
.footer-grid { display: grid; gap: 2.5rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.footer-grid h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 1rem; }
.footer-grid ul li { margin-bottom: 0.6rem; }
.footer-grid ul a { font-size: 0.88rem; color: var(--muted); }
.footer-grid ul a:hover { color: var(--fg); }
.footer-bottom { border-top: 1px solid var(--border); margin-top: 3.5rem; padding-top: 2rem; font-size: 0.75rem; color: var(--muted-2); line-height: 1.6; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 6rem 0 4rem; text-align: center; overflow: hidden; }
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 50% at 70% 20%, rgba(139,197,63,0.12), transparent 60%),
    linear-gradient(160deg, #16221a 0%, #0f1712 100%);
}
.hero-pill { display: inline-block; padding: 0.4rem 1rem; border-radius: 999px; border: 1px solid var(--border); font-size: 0.8rem; color: var(--muted); margin-bottom: 1.5rem; }
.hero h1 { max-width: 50rem; margin: 0 auto 1.25rem; }
.hero .lead { margin: 0 auto 2rem; }
.hero-ctas { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-bottom: 2.5rem; }
.trust-badges { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
.trust-badge { display: flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.85rem; border-radius: 999px; border: 1px solid var(--border); font-size: 0.78rem; color: var(--muted); }

/* ---------- Stats bar ---------- */
.stats-bar { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.stats-bar .grid { grid-template-columns: repeat(2, 1fr); text-align: center; padding: 2.5rem 0; }
@media (min-width: 768px) { .stats-bar .grid { grid-template-columns: repeat(4, 1fr); } }
.stat-value { font-size: 1.9rem; font-weight: 800; color: var(--accent); }
.stat-label { font-size: 0.85rem; color: var(--muted); margin-top: 0.25rem; }

/* ---------- Feature / tier / step cards ---------- */
.feature-card, .tier-card, .step-card { padding: 1.75rem; }
.feature-icon, .tier-icon { display: flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; border-radius: 0.75rem; background: var(--surface-2); color: var(--accent); margin-bottom: 1rem; }
.step-number { color: var(--accent); font-weight: 700; font-size: 0.8rem; margin-bottom: 0.5rem; }

/* ---------- Deal visual placeholder ---------- */
.deal-visual {
  position: relative; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden;
  aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(135deg, var(--surface-2), var(--surface-2) 10px, var(--surface) 10px, var(--surface) 20px);
}
.deal-visual .icon-wrap { color: rgba(244,247,241,0.18); }
.deal-visual .icon-wrap svg { width: 4rem; height: 4rem; }
.deal-visual .badge-row { position: absolute; top: 0.85rem; left: 0.85rem; display: flex; gap: 0.5rem; }
.deal-visual .yield-badge {
  position: absolute; bottom: 0.85rem; right: 0.85rem; background: rgba(18,29,22,0.85);
  border-radius: 0.65rem; padding: 0.5rem 0.85rem; text-align: right;
}
.deal-visual .yield-badge .pct { font-size: 1.3rem; font-weight: 800; color: var(--accent); }
.deal-visual .yield-badge .pa { font-size: 0.7rem; color: var(--muted); }

/* ---------- Deal card ---------- */
.deal-card { display: flex; flex-direction: column; }
.deal-card .body { padding: 1.5rem; }
.deal-card h3 { margin-bottom: 0.25rem; }
.deal-card .loc { display: flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; color: var(--muted); margin-bottom: 0.75rem; }
.deal-card .devrisk { font-size: 0.8rem; color: var(--muted-2); margin: -0.5rem 0 0.75rem; }
.deal-card .stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem 1rem; border-top: 1px solid var(--border); padding-top: 0.9rem; margin-bottom: 1rem; }
.deal-card .stat-grid .label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted-2); }
.deal-card .stat-grid .value { font-weight: 700; font-size: 0.92rem; }
.progress { height: 0.4rem; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-bottom: 1rem; }
.progress .fill { height: 100%; background: var(--accent); }

/* ---------- Tiers ---------- */
.tier-card .tier-badge { margin-bottom: 0.85rem; }
.tier-card h3 { margin-bottom: 0.6rem; }
.tier-card p { color: var(--muted); font-size: 0.92rem; }

/* ---------- Legal & security ---------- */
.legal-grid { display: grid; grid-template-columns: 1fr; gap: 3rem; }
@media (min-width: 1024px) { .legal-grid { grid-template-columns: 3fr 2fr; } }
.checklist li { display: flex; gap: 0.6rem; margin-bottom: 0.85rem; font-size: 0.92rem; }
.checklist svg { flex-shrink: 0; color: var(--accent); width: 1.1rem; height: 1.1rem; margin-top: 0.15rem; }
.info-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.info-tile { padding: 1.1rem; }
.info-tile .k { font-weight: 700; margin-bottom: 0.2rem; }
.info-tile .v { font-size: 0.82rem; color: var(--muted); }

/* ---------- Testimonials ---------- */
.testimonial p.quote { font-size: 0.95rem; margin-bottom: 1.25rem; }
.testimonial .name { font-weight: 700; }
.testimonial .role { font-size: 0.8rem; color: var(--muted); }

/* ---------- CTA banner ---------- */
.cta-banner { text-align: center; }
.cta-banner .lead { margin: 1rem auto 2rem; }

/* ---------- Opportunities toolbar ---------- */
.toolbar { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 2rem; }
@media (min-width: 640px) { .toolbar { flex-direction: row; } }
.toolbar .search-box { flex: 1; position: relative; }
.toolbar .search-box svg { position: absolute; left: 0.9rem; top: 50%; transform: translateY(-50%); color: var(--muted-2); width: 1.1rem; height: 1.1rem; }
.toolbar .search-box input { padding-left: 2.5rem; }
.toolbar select { width: auto; min-width: 12rem; }

/* ---------- Deal detail ---------- */
.deal-detail-grid { display: grid; grid-template-columns: 1fr; gap: 2.5rem; }
@media (min-width: 1024px) { .deal-detail-grid { grid-template-columns: 2fr 1fr; } }
.metric-tile { padding: 1rem 1.1rem; }
.metric-tile .label { font-size: 0.72rem; text-transform: uppercase; color: var(--muted-2); margin-bottom: 0.3rem; }
.metric-tile .value { font-weight: 700; }
.kv-row { display: flex; justify-content: space-between; padding: 0.6rem 0; border-bottom: 1px solid var(--border-soft); font-size: 0.9rem; }
.kv-row:last-child { border-bottom: none; }
.timeline-item { display: flex; align-items: flex-start; gap: 0.85rem; padding: 0.6rem 0; }
.timeline-dot { width: 0.7rem; height: 0.7rem; border-radius: 50%; margin-top: 0.35rem; flex-shrink: 0; border: 2px solid var(--muted-2); }
.timeline-dot.done { background: var(--accent); border-color: var(--accent); }
.doc-row { display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0; font-size: 0.88rem; color: var(--muted); border-bottom: 1px solid var(--border-soft); }
.doc-row:last-child { border-bottom: none; }
.sidebar-card { position: sticky; top: 5.5rem; }

/* ---------- Auth pages ---------- */
.auth-wrap { display: flex; flex-direction: column; align-items: center; padding: 5rem 1.25rem; }
.auth-icon { width: 3rem; height: 3rem; border-radius: 50%; background: var(--surface-2); color: var(--accent); display: flex; align-items: center; justify-content: center; margin-bottom: 1rem; }
.auth-card { width: 100%; max-width: 26rem; padding: 2rem; margin-top: 1.5rem; }
.auth-footer { text-align: center; margin-top: 1.25rem; font-size: 0.88rem; color: var(--muted); }

/* ---------- Portal ---------- */
.portal-header { position: sticky; top: 0; z-index: 40; background: var(--ink); border-bottom: 1px solid var(--border); }
.portal-header .container { display: flex; align-items: center; justify-content: space-between; height: 4rem; }
.kyc-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.25rem 1.5rem; margin-bottom: 2rem; }
.kyc-banner .msg { display: flex; align-items: center; gap: 0.75rem; }

table.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted-2); padding: 0.85rem 1rem; border-bottom: 1px solid var(--border); }
.data-table td { padding: 0.9rem 1rem; border-bottom: 1px solid var(--border-soft); font-size: 0.9rem; }
.data-table tr:last-child td { border-bottom: none; }
.data-table a.row-link { font-weight: 600; }
.empty-state { text-align: center; padding: 3rem 1.5rem; color: var(--muted); }

/* ---------- Admin shell ---------- */
.admin-body { display: flex; min-height: 100vh; }
.admin-sidebar { width: 16rem; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 1.5rem 1rem; }
.admin-sidebar .logo { padding: 0 0.5rem; margin-bottom: 2rem; }
.admin-nav a { display: flex; align-items: center; gap: 0.75rem; padding: 0.65rem 0.75rem; border-radius: 0.6rem; font-size: 0.9rem; color: var(--muted); margin-bottom: 0.15rem; }
.admin-nav a:hover { background: var(--surface-2); color: var(--fg); }
.admin-nav a.active { background: var(--surface-2); color: var(--accent); font-weight: 600; }
.admin-sidebar-footer { margin-top: auto; padding: 0.75rem 0.5rem 0; border-top: 1px solid var(--border); }
.admin-main { flex: 1; padding: 2.5rem; min-width: 0; }
.admin-topline { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem; }
.stat-card { padding: 1.5rem; }
.stat-card .top { display: flex; justify-content: space-between; align-items: flex-start; }
.stat-card .icon-box { width: 2.25rem; height: 2.25rem; border-radius: 0.6rem; background: var(--surface-2); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.stat-card .value { font-size: 1.9rem; font-weight: 800; margin: 0.75rem 0 0.2rem; }
.stat-card .sub { font-size: 0.8rem; color: var(--muted-2); }
.funnel-row { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.9rem; }
.funnel-row .name { width: 6rem; font-size: 0.85rem; color: var(--muted); }
.funnel-row .track { flex: 1; height: 0.55rem; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.funnel-row .track .fill { height: 100%; background: var(--accent); }
.funnel-row .count { width: 1.5rem; text-align: right; font-weight: 700; }

.detail-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 1024px) { .detail-grid { grid-template-columns: 1fr 1.4fr; } }
.dl-row { display: flex; justify-content: space-between; padding: 0.5rem 0; font-size: 0.9rem; border-bottom: 1px solid var(--border-soft); }
.dl-row:last-child { border-bottom: none; }
.note-item { padding: 0.85rem 0; border-bottom: 1px solid var(--border-soft); font-size: 0.88rem; }
.note-item:last-child { border-bottom: none; }
.note-item .meta { color: var(--muted-2); font-size: 0.75rem; margin-top: 0.3rem; }

.repeater-row { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; align-items: flex-start; }
.repeater-row input, .repeater-row .field { flex: 1; margin-bottom: 0; }
.icon-btn { background: none; border: 1px solid var(--border); color: var(--muted); border-radius: 0.5rem; width: 2.2rem; height: 2.2rem; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.icon-btn:hover { background: var(--surface-2); color: var(--danger); }

@media (max-width: 900px) {
  .admin-body { flex-direction: column; }
  .admin-sidebar { width: 100%; flex-direction: row; align-items: center; flex-wrap: wrap; }
  .admin-nav { display: flex; flex-wrap: wrap; }
  .admin-main { padding: 1.5rem; }
}

/* ---------- Icon size utilities ----------
   icon() emits a bare <svg> with no width/height attributes; give it a sane
   default plus a few size utilities (Tailwind-style w-4/h-4 etc used across
   the public pages) for the many spots not already covered by a scoped rule
   like .deal-visual .icon-wrap svg or .checklist svg. */
svg { width: 1.25rem; height: 1.25rem; flex-shrink: 0; }
.w-4 { width: 1rem; }
.h-4 { height: 1rem; }
.w-5 { width: 1.25rem; }
.h-5 { height: 1.25rem; }
.w-6 { width: 1.5rem; }
.h-6 { height: 1.5rem; }

/* ---------- Toolbar controls ----------
   The opportunities toolbar's search input/select sit directly under
   .toolbar rather than inside a .field wrapper, so give them the same
   dark, bordered look as .field inputs. */
.toolbar input[type=text], .toolbar select {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 0.6rem;
  padding: 0.65rem 0.85rem; color: var(--fg); font-size: 0.92rem; font-family: inherit;
}
.toolbar input[type=text]:focus, .toolbar select:focus { outline: none; border-color: var(--accent); }
