@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --forest: #2C5F2D;
  --forest-deep: #16321A;
  --gold: #C89B2A;
  --gold-light: #E4C871;
  --cream: #F7F4EC;
  --sage: #E7EEE3;
  --ink: #16241A;
  --ink-soft: #4B5B4F;
  --white: #FFFFFF;
  --danger: #B23A2E;
  --radius: 18px;
  --shadow: 0 20px 50px -20px rgba(22, 50, 26, 0.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.display {
  font-family: 'Fraunces', serif;
  font-optical-sizing: auto;
}

.mono { font-family: 'IBM Plex Mono', monospace; }

a { color: inherit; }

/* ---------- Growth-ring signature motif ---------- */
.ring-mark {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--gold);
  position: relative;
  flex-shrink: 0;
}
.ring-mark::before {
  content: '';
  position: absolute; inset: -6px;
  border-radius: 50%;
  border: 1.5px solid rgba(200, 155, 42, 0.4);
}
.ring-mark::after {
  content: '';
  position: absolute; inset: -12px;
  border-radius: 50%;
  border: 1px solid rgba(200, 155, 42, 0.2);
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px clamp(20px, 5vw, 64px);
  background: var(--forest-deep);
  color: var(--cream);
}
.brand {
  display: flex; align-items: center; gap: 14px;
  font-family: 'Fraunces', serif; font-weight: 600; font-size: 20px; letter-spacing: 0.02em;
}
.tagline {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold-light); opacity: 0.9;
}

/* ---------- Layout ---------- */
.hero-wrap {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  padding: clamp(32px, 6vw, 72px) clamp(20px, 5vw, 64px);
  max-width: 1240px;
  margin: 0 auto;
}
@media (max-width: 880px) {
  .hero-wrap { grid-template-columns: 1fr; }
}

.hero-copy h1 {
  font-size: clamp(34px, 4.6vw, 54px);
  line-height: 1.05;
  margin: 0 0 20px;
  letter-spacing: -0.01em;
}
.hero-copy h1 .accent { color: var(--gold); }
.hero-copy p {
  font-size: 17px; line-height: 1.6; color: var(--ink-soft);
  max-width: 46ch; margin: 0 0 28px;
}

.badge-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.badge {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid rgba(22, 50, 26, 0.15);
  background: var(--white);
  padding: 8px 14px; border-radius: 999px;
  font-size: 12.5px; font-weight: 500; color: var(--ink-soft);
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--forest); }

.stats-strip { display: flex; gap: 32px; margin-top: 40px; }
.stat .num { font-family: 'Fraunces', serif; font-size: 30px; font-weight: 600; color: var(--forest); }
.stat .label { font-size: 12px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 2px; }

/* ---------- Phone frame chat widget ---------- */
.phone {
  width: 100%; max-width: 380px; margin: 0 auto;
  background: var(--forest-deep);
  border-radius: 36px;
  padding: 14px;
  box-shadow: var(--shadow);
}
.phone-screen {
  background: var(--sage);
  border-radius: 24px;
  overflow: hidden;
  display: flex; flex-direction: column;
  height: 640px;
}
.chat-header {
  background: var(--forest);
  color: var(--white);
  padding: 16px 18px;
  display: flex; align-items: center; gap: 12px;
}
.chat-header .avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Fraunces', serif; font-weight: 700; color: var(--forest-deep);
}
.chat-header .who .name { font-weight: 600; font-size: 15px; }
.chat-header .who .status { font-size: 11.5px; color: var(--gold-light); }
.restart-btn {
  margin-left: auto;
  background: rgba(255,255,255,0.12);
  color: var(--gold-light);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.restart-btn:hover { background: rgba(255,255,255,0.2); }

/* ---------- Landing channel choice ---------- */
.channel-choice { padding: 24px 20px; }
.choice-intro { text-align: center; font-weight: 600; color: var(--ink); margin-bottom: 16px; font-size: 14.5px; }
.choice-btn {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 14px 16px; margin-bottom: 12px; border-radius: 12px; border: none;
  cursor: pointer; text-align: left; font-family: inherit;
}
.choice-btn strong { display: block; font-size: 14px; }
.choice-sub { display: block; font-size: 12px; opacity: 0.85; margin-top: 2px; }
.choice-icon { font-size: 22px; flex-shrink: 0; }
.choice-btn-primary { background: var(--forest); color: var(--white); }
.choice-btn-primary:hover { background: var(--forest-deep); }
.choice-btn-gold { background: var(--gold); color: var(--forest-deep); }
.choice-btn-gold:hover { filter: brightness(0.95); }

.chat-body {
  flex: 1; overflow-y: auto;
  padding: 16px 14px;
  display: flex; flex-direction: column; gap: 10px;
  background-image: radial-gradient(rgba(44,95,45,0.05) 1px, transparent 1px);
  background-size: 16px 16px;
}
.bubble {
  max-width: 82%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 14.2px; line-height: 1.45;
  white-space: pre-wrap;
  box-shadow: 0 1px 1px rgba(0,0,0,0.04);
}
.bubble.bot {
  align-self: flex-start;
  background: var(--white);
  border-bottom-left-radius: 4px;
  color: var(--ink);
}
.bubble.user {
  align-self: flex-end;
  background: var(--gold-light);
  border-bottom-right-radius: 4px;
  color: var(--forest-deep);
}
.bubble.system {
  align-self: center;
  background: rgba(22,50,26,0.08);
  color: var(--ink-soft);
  font-size: 12px;
  border-radius: 999px;
  padding: 5px 12px;
}

.chat-input-row {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  background: var(--white);
  border-top: 1px solid rgba(22,50,26,0.08);
}
.chat-input-row input, .chat-input-row select {
  flex: 1;
  border: 1px solid rgba(22,50,26,0.15);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  background: var(--cream);
}
.chat-input-row input:focus, .chat-input-row select:focus { border-color: var(--forest); }
.send-btn {
  width: 40px; height: 40px; border-radius: 50%;
  border: none; background: var(--forest);
  color: var(--white); font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s ease, background 0.15s ease;
}
.send-btn:hover { background: var(--forest-deep); transform: scale(1.04); }
.send-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.quick-replies { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 14px 10px; }
.quick-reply {
  border: 1px solid var(--forest);
  color: var(--forest);
  background: var(--white);
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 12.5px; font-weight: 500;
  cursor: pointer;
}
.quick-reply:hover { background: var(--forest); color: var(--white); }

/* ---------- Sections below fold ---------- */
.section {
  max-width: 1240px; margin: 0 auto;
  padding: 48px clamp(20px, 5vw, 64px);
}
.section-title {
  font-family: 'Fraunces', serif;
  font-size: 28px; margin: 0 0 8px;
}
.section-sub { color: var(--ink-soft); font-size: 15px; margin: 0 0 32px; max-width: 60ch; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 880px) { .grid-3 { grid-template-columns: 1fr; } }

.feature-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid rgba(22,50,26,0.08);
}
.feature-card .ring-mark { margin-bottom: 14px; }
.feature-card h3 { font-size: 16px; margin: 0 0 8px; }
.feature-card p { font-size: 13.5px; color: var(--ink-soft); line-height: 1.55; margin: 0; }

footer {
  padding: 28px clamp(20px, 5vw, 64px);
  background: var(--forest-deep);
  color: rgba(247,244,236,0.6);
  font-size: 12.5px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}

/* ---------- Admin dashboard ---------- */
.admin-shell { max-width: 1080px; margin: 0 auto; padding: 32px 24px 80px; }
.admin-login {
  max-width: 380px; margin: 80px auto; background: var(--white);
  border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow);
}
.admin-login h2 { font-family: 'Fraunces', serif; margin-top: 0; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; color: var(--ink-soft); margin-bottom: 6px; font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1px solid rgba(22,50,26,0.2); font-size: 14px; font-family: inherit;
}
.btn-primary {
  background: var(--forest); color: var(--white); border: none;
  padding: 11px 20px; border-radius: 10px; font-size: 14px; font-weight: 600;
  cursor: pointer; width: 100%;
}
.btn-primary:hover { background: var(--forest-deep); }
.error-msg { color: var(--danger); font-size: 13px; margin-top: 10px; }

.stat-cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 28px; }
@media (max-width: 880px) { .stat-cards { grid-template-columns: repeat(2, 1fr); } }
.stat-card { background: var(--white); border-radius: 14px; padding: 16px; border: 1px solid rgba(22,50,26,0.08); }
.stat-card .num { font-family: 'Fraunces', serif; font-size: 24px; color: var(--forest); }
.stat-card .label { font-size: 11.5px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.06em; }

.app-table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: 14px; overflow: hidden; }
.app-table th, .app-table td { text-align: left; padding: 12px 14px; font-size: 13px; border-bottom: 1px solid rgba(22,50,26,0.07); }
.app-table th { background: var(--sage); font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: 0.05em; color: var(--ink-soft); }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.pill.approved, .pill.active, .pill.completed { background: rgba(44,95,45,0.12); color: var(--forest); }
.pill.manual_review, .pill.awaiting_signature { background: rgba(200,155,42,0.18); color: #8a6a1c; }
.pill.declined, .pill.cancelled { background: rgba(178,58,46,0.12); color: var(--danger); }
.pill.pending_kyc { background: rgba(200,155,42,0.18); color: #8a6a1c; }

/* ---------- KYC review modal ---------- */
.kyc-modal-overlay {
  position: fixed; inset: 0; background: rgba(22,50,26,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 20px;
}
.kyc-modal {
  background: var(--white); border-radius: var(--radius);
  max-width: 520px; width: 100%; max-height: 90vh; overflow-y: auto;
  padding: 28px;
}
.kyc-docs { margin: 12px 0; }
.kyc-doc-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid rgba(22,50,26,0.08);
  font-size: 14px;
}
.kyc-doc-row button.view-doc {
  border: 1px solid var(--forest); color: var(--forest); background: var(--white);
  padding: 5px 12px; border-radius: 8px; font-size: 12.5px; cursor: pointer;
}
.kyc-doc-row button.view-doc:hover { background: var(--forest); color: var(--white); }
.field label { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink); cursor: pointer; }
.field textarea { resize: vertical; font-family: inherit; }
.row-actions button.review-kyc {
  border: 1px solid var(--gold); color: #8a6a1c; background: var(--white);
  border-radius: 8px; padding: 5px 10px; font-size: 12px; cursor: pointer;
  margin-right: 4px;
}
.kyc-quote-box, .kyc-payout-box, .kyc-bureau-box {
  background: var(--sage); border-radius: 10px; padding: 12px 14px;
  font-size: 12.5px; color: var(--ink); margin: 10px 0; line-height: 1.6;
}
.kyc-bureau-pending { background: rgba(200,155,42,0.12); }

/* ---------- Admin tabs ---------- */
.tab-btn {
  border: 1px solid rgba(22,50,26,0.15); background: var(--white); color: var(--ink-soft);
  padding: 8px 18px; border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.tab-btn.active { background: var(--forest); color: var(--white); border-color: var(--forest); }
.pill.inactive { background: rgba(22,50,26,0.1); color: var(--ink-soft); }
.row-actions button {
  border: 1px solid rgba(22,50,26,0.2); background: var(--white); border-radius: 8px;
  padding: 5px 10px; font-size: 12px; cursor: pointer; margin-right: 6px;
}
.row-actions button.approve { border-color: var(--forest); color: var(--forest); }
.row-actions button.decline { border-color: var(--danger); color: var(--danger); }

/* ---------- Document upload page ---------- */
.upload-shell { max-width: 560px; margin: 0 auto; padding: 48px 20px 80px; }
.upload-card { background: var(--white); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); }
.upload-card h2 { margin-top: 0; }
.upload-intro { color: var(--ink-soft); font-size: 14px; margin-bottom: 24px; }
.upload-note { font-size: 12.5px; color: var(--ink-soft); margin-top: 18px; text-align: center; }

.doc-slot { border: 1px solid rgba(22,50,26,0.12); border-radius: 14px; padding: 16px; margin-bottom: 14px; }
.doc-slot-done { border-color: var(--forest); background: rgba(44,95,45,0.04); }
.doc-slot-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.doc-slot-title { font-weight: 600; font-size: 14.5px; }
.doc-slot-status { font-size: 12.5px; color: var(--forest); font-weight: 600; }
.doc-slot-hint { font-size: 12.5px; color: var(--ink-soft); margin: 0 0 10px; }
.doc-slot input[type="file"] { width: 100%; font-size: 13px; }
