/* =====================================================================
   FAMAPI — "Verification Ledger" design system
   -----------------------------------------------------------------
   Direction: this is a payment-verification instrument, not a generic
   SaaS dashboard — so the language borrows from private banking and
   wax-seal document verification rather than app-bubble UI: warm ink
   and parchment tones, a brass accent instead of default blue, hairline
   rules instead of soft drop shadows, tabular figures for money, and a
   circular "seal" mark that is both the brand mark AND the visual for
   a verified/completed payment — the one signature element the product
   is actually about.
   ===================================================================== */

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

:root {
  /* Ink & surface */
  --ink: #110d09;
  --ink-soft: #171310;
  --surface: #1d1712;
  --surface-raised: #272017;
  --hairline: rgba(198, 162, 92, 0.16);
  --hairline-strong: rgba(198, 162, 92, 0.34);

  /* Text */
  --parchment: #ece3d3;
  --parchment-dim: #a99e8c;
  --parchment-faint: #6e6555;

  /* Accents */
  --brass: #c7a25c;
  --brass-bright: #e0c583;
  --seal: #4f7a6c;
  --seal-bright: #6fa090;
  --oxblood: #9b4c43;
  --oxblood-bright: #c06a5e;
  --sapphire: #5c7a9c;

  --radius: 3px;
  --shadow-lift: 0 14px 32px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--parchment);
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
code, pre { font-family: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace; }

h1, h2, h3 { font-family: 'Fraunces', Georgia, serif; font-weight: 600; letter-spacing: -0.01em; margin: 0; }

::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--hairline-strong); border-radius: 3px; }

:focus-visible { outline: 1.5px solid var(--brass); outline-offset: 2px; }

/* ---- Seal mark: brand mark + "verified" motif, drawn in pure CSS ---- */
.seal-mark {
  display: inline-block;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1.5px solid var(--brass);
  box-shadow: 0 0 0 3px var(--ink), 0 0 0 4px var(--hairline-strong);
  position: relative;
  vertical-align: middle;
  margin-right: 3px;
  flex-shrink: 0;
}
.seal-mark::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--brass);
}
.seal-mark.lg { width: 30px; height: 30px; border-width: 2px; box-shadow: 0 0 0 5px var(--ink), 0 0 0 6.5px var(--hairline-strong); }
.seal-mark.lg::after { inset: 6px; }
.seal-mark.stamped { animation: seal-stamp .45s cubic-bezier(.2,1.4,.4,1); }
@keyframes seal-stamp {
  0% { transform: scale(1.9); opacity: 0; }
  60% { transform: scale(.92); opacity: 1; }
  100% { transform: scale(1); }
}

/* ---- Eyebrow label: small tracked-out caption above a heading ---- */
.eyebrow {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 10px;
}

/* ---- Layout shells ---- */
.app-shell { display: flex; min-height: 100vh; }
.app-main { flex: 1; min-width: 0; overflow-y: auto; padding: 28px; }
.container-narrow { max-width: 640px; margin: 0 auto; }
.container-md { max-width: 800px; margin: 0 auto; }
.container-lg { max-width: 1040px; margin: 0 auto; }

/* ---- Sidebar ---- */
.sidebar {
  width: 232px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--hairline);
  background: var(--ink-soft);
  min-height: 100vh;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 20px 18px;
  border-bottom: 1px solid var(--hairline);
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .01em;
}
.sidebar-nav { flex: 1; padding: 18px 14px; display: flex; flex-direction: column; gap: 2px; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 2px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--parchment-dim);
  border-left: 2px solid transparent;
}
.nav-link:hover { color: var(--parchment); border-left-color: var(--hairline-strong); }
.nav-link.active { color: var(--brass); border-left-color: var(--brass); background: linear-gradient(90deg, rgba(198,162,92,.09), transparent); }
.sidebar-footer { border-top: 1px solid var(--hairline); padding: 14px; }
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 2px;
  font-size: 12px;
  color: var(--parchment-dim);
}
.sidebar-user img, .avatar-circle {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; object-fit: cover;
}
.avatar-circle { display: flex; align-items: center; justify-content: center; background: var(--surface-raised); border: 1px solid var(--hairline-strong); color: var(--brass); font-family: 'Fraunces', serif; font-size: 12px; font-weight: 600; }

/* ---- Typography ---- */
h1.page-title { font-size: 21px; font-weight: 600; margin: 0; }
.page-sub { margin: 5px 0 0; font-size: 13px; color: var(--parchment-dim); font-family: 'IBM Plex Mono', monospace; }
.section-title { font-family: 'Fraunces', serif; font-size: 15.5px; font-weight: 600; margin: 0 0 4px; }
.muted { color: var(--parchment-dim); }
.tiny { font-size: 12px; }
.mono { font-family: 'IBM Plex Mono', monospace; font-variant-numeric: tabular-nums; }

/* ---- Cards / grid ---- */
.card {
  border: 1px solid var(--hairline);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px;
}
.card + .card { margin-top: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } .app-main { padding: 16px; } }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row { display: flex; align-items: center; gap: 8px; }
.flex-1 { flex: 1; min-width: 0; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  font-family: 'Manrope', sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  border-radius: var(--radius);
  border: 1px solid var(--hairline-strong);
  cursor: pointer;
  background: transparent;
  color: var(--parchment);
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { border-color: var(--brass); color: var(--brass); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--brass); border-color: var(--brass); color: var(--ink); }
.btn-primary:hover { background: var(--brass-bright); border-color: var(--brass-bright); color: var(--ink); }
.btn-success { background: var(--seal); border-color: var(--seal); color: var(--parchment); }
.btn-success:hover { background: var(--seal-bright); border-color: var(--seal-bright); }
.btn-danger { background: transparent; border-color: rgba(155,76,67,.5); color: var(--oxblood-bright); }
.btn-danger:hover { background: rgba(155,76,67,.14); border-color: var(--oxblood-bright); }
.btn-danger-solid { background: var(--oxblood); border-color: var(--oxblood); color: var(--parchment); }
.btn-outline { background: transparent; border-color: var(--hairline-strong); color: var(--parchment); }
.btn-sm { padding: 7px 12px; font-size: 11px; }
.btn-block { width: 100%; }

/* ---- Forms ---- */
label.field-label { display: block; font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--parchment-dim); margin-bottom: 7px; }
.input, select.input, textarea.input {
  width: 100%;
  border: 1px solid var(--hairline-strong);
  background: var(--ink-soft);
  color: var(--parchment);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
}
.input:focus { outline: none; border-color: var(--brass); }
.input::placeholder { color: var(--parchment-faint); }

/* ---- Badges / status — quiet hairline pill with a seal-coloured dot ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 11px 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--hairline-strong);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--parchment-dim);
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.badge-accent { color: var(--brass); border-color: rgba(198,162,92,.4); }
.badge-success { color: var(--seal-bright); border-color: rgba(111,160,144,.4); }
.badge-warning { color: #d3a24a; border-color: rgba(211,162,74,.4); }
.badge-error { color: var(--oxblood-bright); border-color: rgba(192,106,94,.4); }
.badge-purple { color: #a68ed6; border-color: rgba(166,142,214,.4); }
.badge-cyan { color: var(--sapphire); border-color: rgba(92,122,156,.4); }
.text-success { color: var(--seal-bright); }
.text-warning { color: #d3a24a; }
.text-error { color: var(--oxblood-bright); }
.text-accent { color: var(--brass); }
.text-muted { color: var(--parchment-faint); }

/* ---- Table ---- */
table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data-table th {
  text-align: left;
  padding: 11px 14px;
  color: var(--brass);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--hairline-strong);
}
table.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--hairline);
  font-variant-numeric: tabular-nums;
}
table.data-table tr:last-child td { border-bottom: none; }
table.data-table tr:hover td { background: var(--surface-raised); }
.table-scroll { overflow-x: auto; }

/* ---- List rows (payments etc) ---- */
.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--hairline);
}
.list-row:last-child { border-bottom: none; }
.list { border: 1px solid var(--hairline); background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 52px 16px; color: var(--parchment-faint); font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; letter-spacing: .02em; }

/* ---- Toast / message ---- */
.toast {
  border: 1px solid var(--hairline-strong);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 13px 16px;
  font-size: 13px;
  border-left: 2px solid var(--brass);
}
.toast-fixed { position: fixed; top: 16px; right: 16px; z-index: 50; box-shadow: var(--shadow-lift); }

/* ---- Utility ---- */
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.text-center { text-align: center; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none; }

/* ---- Landing page ---- */
.hero {
  position: relative;
  background:
    repeating-linear-gradient(180deg, rgba(198,162,92,.035) 0px, rgba(198,162,92,.035) 1px, transparent 1px, transparent 40px),
    radial-gradient(ellipse 900px 480px at 50% -10%, rgba(198,162,92,.14) 0%, transparent 60%),
    var(--ink);
  border-bottom: 1px solid var(--hairline);
  overflow: hidden;
}
.hero-inner { max-width: 780px; margin: 0 auto; padding: 96px 24px 108px; text-align: center; position: relative; }
.hero h1 {
  font-size: clamp(34px, 5.6vw, 60px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 18px 0 22px;
  color: var(--parchment);
}
.hero h1 em { color: var(--brass); font-style: italic; }
.hero p.lede { font-family: 'IBM Plex Mono', monospace; font-size: 14px; line-height: 1.8; color: var(--parchment-dim); max-width: 520px; margin: 0 auto 40px; }
.pill-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 28px; border-radius: var(--radius); font-weight: 700; font-size: 12.5px;
  letter-spacing: .04em; text-transform: uppercase;
  border: 1px solid transparent;
}
.pill-btn-solid { background: var(--brass); color: var(--ink); border-color: var(--brass); }
.pill-btn-solid:hover { background: var(--brass-bright); }
.pill-btn-outline { border-color: var(--hairline-strong); color: var(--parchment); }
.pill-btn-outline:hover { border-color: var(--brass); color: var(--brass); }
.top-nav { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px; max-width: 1080px; margin: 0 auto; position: relative; z-index: 1; }
.section { padding: 76px 24px; border-top: 1px solid var(--hairline); }
.section-inner { max-width: 860px; margin: 0 auto; }
.section h2 { text-align: center; font-size: 26px; font-weight: 600; margin: 0 0 48px; }
.step { display: flex; gap: 20px; margin-bottom: 30px; align-items: flex-start; }
.step-num {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--hairline-strong);
  color: var(--brass); display: flex; align-items: center; justify-content: center;
  font-family: 'Fraunces', serif; font-weight: 600; font-size: 14px;
}
.price-card { border: 1px solid var(--hairline); background: var(--surface); border-radius: var(--radius); padding: 30px 26px; text-align: center; position: relative; }
.price-card.popular { border-color: var(--brass); box-shadow: 0 16px 40px rgba(198,162,92,.08); }
.price-card .amount { font-family: 'Fraunces', serif; font-size: 38px; font-weight: 600; color: var(--parchment); }
.price-card ul { list-style: none; padding: 0; margin: 22px 0; text-align: left; }
.price-card li { display: flex; gap: 9px; font-size: 13px; color: var(--parchment-dim); margin-bottom: 9px; }
footer.site-footer { border-top: 1px solid var(--hairline); padding: 26px 24px; }
.footer-inner { max-width: 1040px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; font-family: 'IBM Plex Mono', monospace; color: var(--parchment-faint); }

/* ---- Auth / legal pages ---- */
.auth-shell { min-height: 100vh; display: flex; flex-direction: column; }
.auth-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid var(--hairline); font-family: 'Fraunces', serif; font-weight: 600; }
.auth-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-box { width: 100%; max-width: 380px; }
.auth-box h1 { font-size: 22px; }
.legal-page { max-width: 720px; margin: 0 auto; padding: 64px 24px; }
.legal-page h1 { font-size: 28px; margin-bottom: 6px; }
.legal-page section { margin-top: 34px; }
.legal-page h2 { font-family: 'Fraunces', serif; font-size: 17px; margin-bottom: 11px; }
.legal-page h3 { font-size: 14px; margin: 14px 0 6px; }
.legal-page p, .legal-page li { color: var(--parchment-dim); line-height: 1.75; }
.legal-page ul { padding-left: 20px; }

/* ---- Bar chart (usage) ---- */
.bar-chart { display: flex; align-items: flex-end; gap: 2px; height: 100px; }
.bar-chart .bar { flex: 1; background: rgba(198,162,92,.55); border-radius: 1px 1px 0 0; min-height: 2px; }
.bar-chart .bar:hover { background: var(--brass); }

/* ---- Entrance motion (hero only, respects reduced-motion via rule above) ---- */
@keyframes rise-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.hero-inner > * { animation: rise-in .6s ease both; }
.hero-inner .seal-mark { animation-delay: 0s; }
.hero-inner .eyebrow { animation-delay: .07s; }
.hero-inner h1 { animation-delay: .14s; }
.hero-inner .lede { animation-delay: .21s; }
.hero-inner .row { animation-delay: .28s; }
