/* ============================================================
   Finvoult — design system
   Palette per spec: green buttons, black foreground, white/grey background.
   Brand navy + teal come from the logo and are used for accents only.
   ============================================================ */
:root {
  --bg: #f3f5f7;
  --surface: #ffffff;
  --surface-2: #f8fafb;
  --line: #e2e8ec;
  --line-strong: #cbd5dc;

  --ink: #0d1117;          /* foreground: black */
  --ink-2: #3d4a56;
  --ink-3: #6b7a88;

  --green: #16a34a;        /* buttons */
  --green-dark: #15803d;
  --green-soft: #e8f7ee;
  --green-glow: rgba(22, 163, 74, .35);

  --navy: #17475f;         /* logo */
  --teal: #17807a;
  --navy-soft: #e8f1f5;

  --warn: #d97706;  --warn-soft: #fdf3e3;
  --danger: #dc2626; --danger-soft: #fdeceb;
  --info: #0369a1;  --info-soft: #e6f2fa;

  --shadow-sm: 0 1px 2px rgba(13, 17, 23, .05);
  --shadow: 0 1px 3px rgba(13, 17, 23, .06), 0 8px 24px -14px rgba(13, 17, 23, .22);
  --shadow-lg: 0 24px 60px -24px rgba(13, 17, 23, .3);

  --r-sm: 8px; --r: 12px; --r-lg: 18px;
  --sidebar: 252px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

html[data-theme="dark"] {
  --bg: #0b0f14;
  --surface: #131a22;
  --surface-2: #19222c;
  --line: #24303c;
  --line-strong: #33424f;

  --ink: #eef3f7;
  --ink-2: #aebccb;
  --ink-3: #728697;

  --green: #22c55e;
  --green-dark: #16a34a;
  --green-soft: #10291b;
  --green-glow: rgba(34, 197, 94, .45);

  --navy-soft: #112530;
  --warn-soft: #2a2011; --danger-soft: #2c1517; --info-soft: #0d2233;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow: 0 2px 6px rgba(0, 0, 0, .5), 0 12px 32px -16px rgba(0, 0, 0, .8);
  --shadow-lg: 0 30px 70px -28px rgba(0, 0, 0, .9);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background .35s var(--ease), color .35s var(--ease);
}
h1, h2, h3, h4, h5 { margin: 0; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
::selection { background: var(--green); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; border: 3px solid var(--bg); }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--r-sm); font-weight: 600; font-size: 13.5px;
  border: 1px solid transparent; transition: .2s var(--ease); white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; flex: 0 0 auto; }
.btn-primary { background: var(--green); color: #fff; box-shadow: 0 8px 18px -10px var(--green-glow); }
.btn-primary:hover { background: var(--green-dark); transform: translateY(-1px); box-shadow: 0 12px 24px -10px var(--green-glow); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { border-color: var(--green); color: var(--green); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 7px 12px; font-size: 12.5px; }
.btn-lg { padding: 13px 24px; font-size: 15px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ---------------- shell ---------------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 40;
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 16px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
.brand img, .brand .mark { width: 36px; height: 36px; flex: 0 0 auto; border-radius: 9px; }
.brand .mark { background: linear-gradient(140deg, var(--navy), var(--teal)); display: grid; place-items: center; color: #fff; font-weight: 800; }
.brand b { font-size: 16.5px; font-weight: 800; display: block; line-height: 1.1; letter-spacing: -.03em; }
.brand span { font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }

.nav-label { font-size: 10px; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; padding: 14px 12px 6px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--r-sm);
  color: var(--ink-2); font-weight: 500; transition: .18s var(--ease);
}
.nav a svg { width: 17px; height: 17px; opacity: .8; flex: 0 0 auto; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.active { background: var(--green); color: #fff; box-shadow: 0 8px 18px -12px var(--green-glow); }
.nav a.active svg { opacity: 1; }
.nav a .count { margin-left: auto; font-size: 11px; font-weight: 700; background: var(--surface-2); color: var(--ink-3); padding: 1px 7px; border-radius: 99px; }
.nav a.active .count { background: rgba(255, 255, 255, .22); color: #fff; }

.side-foot { margin-top: auto; padding-top: 14px; }
.plan-card { background: linear-gradient(140deg, var(--navy), var(--teal)); color: #fff; border-radius: var(--r); padding: 13px; margin-bottom: 10px; position: relative; overflow: hidden; }
.plan-card::after { content: ""; position: absolute; width: 110px; height: 110px; border-radius: 50%; background: rgba(255, 255, 255, .14); top: -46px; right: -30px; }
.plan-card b { font-size: 12.5px; position: relative; }
.plan-card p { margin: 2px 0 0; font-size: 11px; opacity: .88; position: relative; }
.plan-card .bar { height: 4px; border-radius: 99px; background: rgba(255, 255, 255, .25); margin-top: 8px; position: relative; overflow: hidden; }
.plan-card .bar i { display: block; height: 100%; background: #fff; border-radius: 99px; }

.me { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r-sm); border-top: 1px solid var(--line); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(140deg, var(--navy), var(--teal)); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: 0 0 auto; }
.me b { font-size: 12.5px; display: block; }
.me small { color: var(--ink-3); font-size: 11px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px;
  padding: 12px 24px; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px);
}
.topbar h1 { font-size: 18px; }
.topbar .crumb { font-size: 11px; color: var(--ink-3); }
.spacer { margin-left: auto; }
.content { padding: 22px 24px 60px; max-width: 1540px; width: 100%; }

/* theme switch (spec 1.1) */
.theme-switch { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 3px; gap: 2px; }
.theme-switch button {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border-radius: 99px;
  font-size: 12px; font-weight: 600; color: var(--ink-3); transition: .2s var(--ease);
}
.theme-switch button svg { width: 14px; height: 14px; }
.theme-switch button.on { background: var(--ink); color: var(--surface); }
html[data-theme="dark"] .theme-switch button.on { background: var(--surface-2); color: var(--ink); }

.icon-btn { width: 36px; height: 36px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; transition: .2s var(--ease); }
.icon-btn:hover { color: var(--green); border-color: var(--green); }
.icon-btn svg { width: 16px; height: 16px; }

/* ---------------- surfaces ---------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.card-head h3 { font-size: 14.5px; }
.card-head p { margin: 2px 0 0; font-size: 11.5px; color: var(--ink-3); }
.pad { padding: 18px; }
.muted { color: var(--ink-3); }
.grid { display: grid; gap: 16px; }
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.g3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.g4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { font-size: 21px; }
.page-head p { margin: 3px 0 0; color: var(--ink-3); font-size: 12.5px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------- forms ---------------- */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field label { font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
.field label .req { color: var(--danger); }
.input, .select, textarea.input {
  width: 100%; padding: 9px 12px; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--surface-2); outline: none; transition: .18s var(--ease);
}
.input:focus, .select:focus, textarea.input:focus {
  border-color: var(--green); background: var(--surface);
  box-shadow: 0 0 0 3px var(--green-soft);
}
.input[readonly] { color: var(--ink-3); }
.hint { font-size: 11px; color: var(--ink-3); }
.error { font-size: 11.5px; color: var(--danger); }
.checkbox { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--green); }

.alert { padding: 11px 14px; border-radius: var(--r-sm); font-size: 13px; margin-bottom: 16px; display: flex; gap: 9px; align-items: flex-start; }
.alert svg { width: 17px; height: 17px; flex: 0 0 auto; margin-top: 1px; }
.alert-ok { background: var(--green-soft); color: var(--green-dark); }
.alert-error { background: var(--danger-soft); color: var(--danger); }
html[data-theme="dark"] .alert-ok { color: var(--green); }

/* ---------------- table ---------------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data th {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3);
  font-weight: 700; text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data td { padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
table.data tbody tr { transition: .15s; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { text-align: center; padding: 48px 20px; color: var(--ink-3); }
.empty svg { width: 40px; height: 40px; opacity: .4; margin-bottom: 10px; }

.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 99px; white-space: nowrap; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip-ok { background: var(--green-soft); color: var(--green-dark); }
html[data-theme="dark"] .chip-ok { color: var(--green); }
.chip-warn { background: var(--warn-soft); color: var(--warn); }
.chip-danger { background: var(--danger-soft); color: var(--danger); }
.chip-info { background: var(--info-soft); color: var(--info); }
.chip-brand { background: var(--navy-soft); color: var(--teal); }
.chip-muted { background: var(--surface-2); color: var(--ink-3); }

.tabs { display: inline-flex; gap: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 3px; }
.tabs a, .tabs button { padding: 6px 13px; border-radius: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); transition: .18s; }
.tabs a.on, .tabs button.on { background: var(--green-soft); color: var(--green-dark); }
html[data-theme="dark"] .tabs a.on, html[data-theme="dark"] .tabs button.on { color: var(--green); }

.pagination { display: flex; gap: 5px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 32px; height: 32px; padding: 0 9px; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--surface); display: inline-flex; align-items: center; justify-content: center; font-size: 12.5px;
}
.pagination .current { background: var(--green); color: #fff; border-color: var(--green); }
.pagination .disabled { opacity: .45; }

/* ---------------- stats ---------------- */
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; position: relative; overflow: hidden; transition: .25s var(--ease); }
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stat .ico { width: 34px; height: 34px; border-radius: var(--r-sm); display: grid; place-items: center; margin-bottom: 10px; }
.stat .ico svg { width: 17px; height: 17px; }
.stat .label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.stat .value { font-size: 24px; font-weight: 800; letter-spacing: -.03em; margin: 3px 0 4px; }
.stat .sub { font-size: 11.5px; color: var(--ink-3); }

/* ---------------- charts (spec 2.1 / 2.2) ---------------- */
.chart { padding: 16px 18px 6px; }
.chart-bars { display: flex; align-items: flex-end; gap: 10px; height: 200px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; justify-content: flex-end; min-width: 0; }
.bar-pair { display: flex; gap: 3px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.bar {
  width: 13px; max-width: 40%; border-radius: 4px 4px 2px 2px; height: 0; position: relative;
  transition: height .9s var(--ease); cursor: default;
}
.bar.invoiced { background: linear-gradient(180deg, var(--teal), var(--navy)); }
.bar.collected { background: var(--green); }
.bar:hover::after {
  content: attr(data-label); position: absolute; bottom: calc(100% + 7px); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--surface); font-size: 10.5px; font-weight: 600; padding: 4px 8px;
  border-radius: 6px; white-space: nowrap; z-index: 5; box-shadow: var(--shadow);
}
.bar-col small { font-size: 10.5px; color: var(--ink-3); font-weight: 600; white-space: nowrap; }
.legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--ink-2); }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 5px; }

/* stacked status chart */
.stack-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; justify-content: flex-end; }
.stack { width: 26px; display: flex; flex-direction: column-reverse; border-radius: 5px; overflow: hidden; transition: height .9s var(--ease); height: 0; }
.stack span { display: block; width: 100%; position: relative; }
.stack .s-paid { background: var(--green); }
.stack .s-unpaid { background: var(--warn); }
.stack .s-overdue { background: var(--danger); }
.stack .s-draft { background: var(--line-strong); }

/* ---------------- animated sample invoice (spec 1.2) ---------------- */
.preview-panel { position: sticky; top: 74px; }
.paper-frame { position: relative; border-radius: var(--r-lg); overflow: hidden; background: var(--surface); border: 1px solid var(--line); }
.mini-paper { background: #fff; color: #17202a; padding: 18px 18px 14px; font-size: 10px; line-height: 1.45; position: relative; }
.mini-paper .mp-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid var(--teal); padding-bottom: 9px; }
.mini-paper .mp-logo { width: 30px; height: 30px; border-radius: 7px; background: linear-gradient(140deg, var(--navy), var(--teal)); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.mini-paper b.mp-co { font-size: 12px; color: #111; display: block; }
.mini-paper .mp-title { font-size: 15px; font-weight: 800; color: var(--teal); text-transform: uppercase; letter-spacing: .03em; }
.mini-paper .mp-meta { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid #eef1f4; color: #55616d; }
.mini-paper table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.mini-paper th { background: var(--teal); color: #fff; font-size: 8px; padding: 5px 6px; text-align: left; font-weight: 600; letter-spacing: .04em; }
.mini-paper td { padding: 5px 6px; border-bottom: 1px solid #f0f3f5; font-size: 9.5px; color: #2c3742; }
.mini-paper tr.row-hi td { background: var(--green-soft); }
.mini-paper .mp-total { display: flex; justify-content: space-between; margin-top: 9px; background: var(--navy); color: #fff; padding: 7px 9px; border-radius: 5px; font-weight: 700; font-size: 11px; }
.mini-paper .mp-foot { margin-top: 9px; display: flex; justify-content: space-between; align-items: flex-end; color: #8c97a2; font-size: 8.5px; }
.mini-paper .mp-sign { text-align: right; }
.mini-paper .mp-sign .line { border-top: 1px solid #b3bcc5; width: 72px; margin-top: 16px; padding-top: 3px; }

/* the scanning beam runs top -> bottom, over and over */
.scan-beam {
  position: absolute; left: 0; right: 0; height: 74px; pointer-events: none; z-index: 3;
  background: linear-gradient(180deg, transparent, var(--green-glow) 55%, transparent);
  opacity: .5; animation: scan 4.5s var(--ease) infinite;
}
.scan-line {
  position: absolute; left: 0; right: 0; height: 2px; pointer-events: none; z-index: 4;
  background: linear-gradient(90deg, transparent, var(--green), transparent);
  box-shadow: 0 0 12px 2px var(--green-glow); animation: scan 4.5s var(--ease) infinite;
}
@keyframes scan {
  0%   { top: -80px; opacity: 0; }
  8%   { opacity: 1; }
  92%  { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}
/* glowing dot trail down the left edge */
.dot-trail { position: absolute; left: 7px; top: 14px; bottom: 14px; width: 3px; z-index: 4; pointer-events: none; }
.dot-trail i {
  position: absolute; left: 0; width: 3px; height: 3px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 6px 1px var(--green-glow); opacity: 0; animation: trail 4.5s linear infinite;
}
@keyframes trail {
  0%   { top: 0; opacity: 0; transform: scale(.6); }
  10%  { opacity: 1; transform: scale(1); }
  85%  { opacity: 1; }
  100% { top: 100%; opacity: 0; transform: scale(.6); }
}
/* blinking green highlight on data points */
.blink { animation: blink 2.6s ease-in-out infinite; border-radius: 3px; }
@keyframes blink {
  0%, 100% { background: transparent; box-shadow: none; }
  45%      { background: var(--green-soft); box-shadow: 0 0 0 2px var(--green-soft); }
}
.live-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 700; color: var(--green); letter-spacing: .05em; }
.live-badge i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.5); opacity: .5; } }
@media (prefers-reduced-motion: reduce) {
  .scan-beam, .scan-line, .dot-trail i, .blink, .live-badge i { animation: none; }
  .scan-beam, .scan-line { opacity: 0; }
}

/* ---------------- invoice builder ---------------- */
.builder { display: grid; grid-template-columns: 1fr 380px; gap: 16px; align-items: start; }
.section { padding: 16px 18px; border-bottom: 1px solid var(--line); }
.section:last-child { border-bottom: 0; }
.section h4 {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3);
  margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}
.section h4::before { content: ""; width: 3px; height: 12px; border-radius: 2px; background: var(--green); }
table.items { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
table.items th { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 700; text-align: left; padding: 0 6px 2px; }
table.items td { padding: 0 3px; vertical-align: middle; }
table.items tr.item-row td { background: var(--surface-2); padding: 7px 3px; }
table.items tr.item-row td:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); padding-left: 8px; }
table.items tr.item-row td:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; padding-right: 8px; }
table.items .input { padding: 6px 8px; font-size: 12.5px; background: var(--surface); }
.row-amount { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; font-size: 13px; white-space: nowrap; padding-right: 6px; }
.row-del { width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; color: var(--ink-3); transition: .18s; }
.row-del:hover { background: var(--danger-soft); color: var(--danger); }
.row-del svg { width: 14px; height: 14px; }
.totals-box { width: 300px; margin-left: auto; display: flex; flex-direction: column; gap: 7px; }
.total-line { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); }
.total-line b { font-variant-numeric: tabular-nums; color: var(--ink); }
.total-line.grand { border-top: 2px dashed var(--line-strong); padding-top: 10px; margin-top: 3px; font-size: 16px; font-weight: 800; color: var(--ink); }
.total-line.grand b { color: var(--green); font-size: 18px; }

/* signature pad */
.sign-pad { border: 2px dashed var(--line-strong); border-radius: var(--r); background: var(--surface-2); touch-action: none; display: block; width: 100%; cursor: crosshair; }
.sign-preview { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px; background: #fff; display: inline-block; }
.sign-preview img { max-height: 70px; }

/* ---------------- landing ---------------- */
.landing-nav { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.landing-nav .inner { max-width: 1180px; margin: 0 auto; padding: 14px 22px; display: flex; align-items: center; gap: 14px; }
.wrap-narrow { max-width: 1180px; margin: 0 auto; padding: 0 22px; }
.hero { padding: 66px 0 56px; position: relative; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 44px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--green-dark); background: var(--green-soft); padding: 5px 12px; border-radius: 99px; }
html[data-theme="dark"] .eyebrow { color: var(--green); }
.hero h1 { font-size: 44px; line-height: 1.08; margin: 16px 0 14px; letter-spacing: -.035em; }
.hero h1 .accent { background: linear-gradient(100deg, var(--teal), var(--green)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 16px; color: var(--ink-2); max-width: 520px; margin: 0 0 24px; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.trust { display: flex; gap: 20px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-3); }
.trust span { display: inline-flex; align-items: center; gap: 6px; }
.trust svg { width: 15px; height: 15px; color: var(--green); }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; transition: .25s var(--ease); }
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--green); }
.feature .ico { width: 38px; height: 38px; border-radius: 10px; background: var(--green-soft); color: var(--green-dark); display: grid; place-items: center; margin-bottom: 12px; }
html[data-theme="dark"] .feature .ico { color: var(--green); }
.feature .ico svg { width: 19px; height: 19px; }
.feature h3 { font-size: 15px; margin-bottom: 5px; }
.feature p { margin: 0; font-size: 13px; color: var(--ink-3); }

.section-title { text-align: center; max-width: 620px; margin: 0 auto 34px; }
.section-title h2 { font-size: 30px; letter-spacing: -.03em; }
.section-title p { color: var(--ink-3); margin: 10px 0 0; font-size: 14.5px; }
.block { padding: 62px 0; }
.block.alt { background: var(--surface); border-block: 1px solid var(--line); }

.step-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.step { position: relative; padding-top: 14px; }
.step .n { width: 30px; height: 30px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; margin-bottom: 11px; }
.step h4 { font-size: 14.5px; margin-bottom: 4px; }
.step p { margin: 0; font-size: 12.5px; color: var(--ink-3); }

.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.price { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; }
.price.featured { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); position: relative; }
.price.featured::before { content: "POPULAR"; position: absolute; top: -10px; left: 24px; background: var(--green); color: #fff; font-size: 9.5px; font-weight: 800; letter-spacing: .1em; padding: 3px 10px; border-radius: 99px; }
.price h3 { font-size: 16px; }
.price .amt { font-size: 32px; font-weight: 800; letter-spacing: -.03em; margin: 8px 0 2px; }
.price .amt small { font-size: 13px; font-weight: 500; color: var(--ink-3); }
.price ul { list-style: none; margin: 16px 0 20px; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.price li { font-size: 13px; display: flex; gap: 8px; align-items: flex-start; color: var(--ink-2); }
.price li svg { width: 15px; height: 15px; color: var(--green); flex: 0 0 auto; margin-top: 2px; }

.footer { border-top: 1px solid var(--line); padding: 30px 0; color: var(--ink-3); font-size: 12.5px; }
.footer .inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; }

/* auth pages */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 480px; }
.auth-side { background: linear-gradient(150deg, var(--navy), var(--teal)); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.auth-side::after { content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%; background: rgba(255, 255, 255, .08); bottom: -160px; left: -120px; }
.auth-side h2 { font-size: 32px; letter-spacing: -.03em; line-height: 1.15; position: relative; }
.auth-side p { opacity: .85; font-size: 15px; max-width: 420px; position: relative; }
.auth-points { list-style: none; padding: 0; margin: 26px 0 0; display: flex; flex-direction: column; gap: 13px; position: relative; }
.auth-points li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.auth-points svg { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 2px; }
.auth-form { padding: 44px 40px; display: flex; flex-direction: column; justify-content: center; background: var(--surface); overflow-y: auto; }
.auth-form .inner { width: 100%; max-width: 380px; margin: 0 auto; }

/* toasts */
.toast-wrap { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 9px; }
.toast { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--green); border-radius: var(--r-sm); padding: 11px 15px; box-shadow: var(--shadow-lg); font-size: 13px; animation: slide-in .4s var(--ease); max-width: 330px; }
@keyframes slide-in { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }

/* reveal on load */
.reveal { opacity: 0; transform: translateY(14px); }
.reveal.in { opacity: 1; transform: none; transition: opacity .5s var(--ease), transform .5s var(--ease); }

@media (max-width: 1250px) {
  .builder { grid-template-columns: 1fr; }
  .preview-panel { position: static; }
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .hero-grid { grid-template-columns: 1fr; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .g2, .g3, .g4, .feature-grid, .step-row, .price-grid { grid-template-columns: 1fr; }
  .content { padding: 18px 16px 50px; }
  .hero h1 { font-size: 32px; }
  .totals-box { width: 100%; }
}
