:root {
  color-scheme: light;
  --ink: #102a35;
  --ink-2: #294650;
  --paper: #f5f2ea;
  --white: #ffffff;
  --line: #d9ddd9;
  --green: #1f6b5b;
  --green-2: #dcebe6;
  --orange: #e86f42;
  --gold: #d5a743;
  --muted: #68777c;
  --danger: #a33b34;
  --shadow: 0 18px 60px rgba(16, 42, 53, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.site-header { min-height: 76px; padding: 14px clamp(20px, 4vw, 68px); display: flex; align-items: center; justify-content: space-between; gap: 24px; background: rgba(245, 242, 234, .94); border-bottom: 1px solid rgba(16,42,53,.1); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(14px); }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; line-height: 1.05; }
.brand-mark { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px 2px 10px 2px; color: white; font-weight: 900; letter-spacing: -.04em; background: var(--ink); box-shadow: inset -4px -4px 0 var(--green); }
.brand strong { display: block; font-size: 15px; letter-spacing: .02em; }
.brand small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .13em; }
nav { display: flex; align-items: center; gap: 22px; font-size: 14px; }
nav a { text-decoration: none; font-weight: 700; }
nav a:hover { color: var(--green); }

main { min-height: calc(100vh - 140px); }
.hero { min-height: 650px; display: grid; grid-template-columns: 1.15fr .85fr; align-items: stretch; background: var(--ink); color: white; overflow: hidden; }
.hero-copy { padding: clamp(76px, 10vw, 145px) clamp(28px, 7vw, 110px); position: relative; z-index: 1; }
.eyebrow { margin: 0 0 20px; color: #a8d9cc; font-size: 12px; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
h1, h2, h3 { margin-top: 0; line-height: 1.06; }
h1 { max-width: 780px; margin-bottom: 24px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(47px, 7vw, 88px); font-weight: 500; letter-spacing: -.045em; }
.hero p { max-width: 650px; margin: 0 0 34px; color: #d7e3e4; font-size: clamp(17px, 2vw, 21px); line-height: 1.6; }
.hero-art { position: relative; background: linear-gradient(135deg, var(--green), #163e47); min-height: 480px; overflow: hidden; }
.blueprint { position: absolute; inset: 10%; border: 1px solid rgba(255,255,255,.28); background-image: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px); background-size: 34px 34px; transform: rotate(-4deg); }
.blueprint::before, .blueprint::after { content: ""; position: absolute; border: 2px solid rgba(255,255,255,.52); }
.blueprint::before { inset: 16% 12% 22% 18%; }
.blueprint::after { width: 38%; height: 28%; right: 22%; top: 30%; }
.art-card { position: absolute; z-index: 2; width: min(320px, 75%); padding: 24px; border-radius: 14px; background: rgba(255,255,255,.95); color: var(--ink); box-shadow: var(--shadow); }
.art-card strong { display: block; font-size: 18px; }
.art-card span { color: var(--muted); font-size: 13px; }
.art-card.a { left: 8%; top: 18%; }
.art-card.b { right: 7%; bottom: 18%; border-left: 5px solid var(--orange); }

.btn { appearance: none; min-height: 44px; padding: 11px 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 7px 2px 7px 2px; background: var(--green); color: white; font-weight: 850; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(16,42,53,.16); }
.btn-primary { background: var(--orange); }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-light { background: white; color: var(--ink); }
.btn-danger { background: var(--danger); }
.btn-small { min-height: 34px; padding: 7px 11px; font-size: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.section { padding: clamp(60px, 8vw, 110px) clamp(24px, 6vw, 90px); }
.section h2 { max-width: 850px; margin-bottom: 18px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(35px, 4.5vw, 58px); font-weight: 500; letter-spacing: -.035em; }
.section-lead { max-width: 760px; color: var(--ink-2); font-size: 18px; line-height: 1.65; }
.steps, .portal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 45px; }
.step, .portal-card { padding: 30px; background: var(--white); border: 1px solid var(--line); border-radius: 16px 3px 16px 3px; box-shadow: 0 10px 35px rgba(16,42,53,.04); }
.step-num { color: var(--orange); font-family: Georgia, serif; font-size: 42px; }
.step p, .portal-card p { color: var(--muted); line-height: 1.6; }
.portal-card { min-height: 270px; display: flex; flex-direction: column; }
.portal-card .btn { margin-top: auto; align-self: flex-start; }
.portal-card:nth-child(2) { background: var(--green); color: white; }
.portal-card:nth-child(2) p { color: #d5ebe5; }

.workspace { padding: clamp(28px, 5vw, 62px) clamp(18px, 4vw, 62px) 80px; }
.workspace-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 28px; }
.workspace-head h1 { margin: 0 0 6px; font-family: Georgia, serif; font-size: clamp(36px, 5vw, 64px); }
.workspace-head p { margin: 0; color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin: 24px 0; }
.kpi { padding: 20px; background: var(--white); border: 1px solid var(--line); border-radius: 12px 2px 12px 2px; }
.kpi small { display: block; color: var(--muted); text-transform: uppercase; font-size: 10px; font-weight: 900; letter-spacing: .11em; }
.kpi strong { display: block; margin-top: 9px; font-size: clamp(24px, 3vw, 34px); }

.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 13px; }
.tab { min-width: max-content; padding: 9px 14px; border: 1px solid var(--line); border-radius: 99px; background: transparent; color: var(--ink); font-size: 13px; font-weight: 800; }
.tab.active { background: var(--ink); border-color: var(--ink); color: white; }
.panel { display: none; }
.panel.active { display: block; }
.panel-grid { display: grid; grid-template-columns: minmax(270px, .8fr) minmax(0, 1.7fr); gap: 18px; align-items: start; }
.card { margin-bottom: 18px; padding: 24px; background: var(--white); border: 1px solid var(--line); border-radius: 14px 3px 14px 3px; box-shadow: 0 8px 28px rgba(16,42,53,.04); }
.card h2 { font-size: 22px; }
.card h3 { font-size: 17px; }
.card-head { display: flex; justify-content: space-between; gap: 16px; align-items: start; margin-bottom: 16px; }
.muted { color: var(--muted); }
.callout { padding: 18px 20px; border-left: 4px solid var(--gold); background: #fff8e8; border-radius: 4px; }
.callout.success { border-color: var(--green); background: var(--green-2); }

form { display: grid; gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
label { display: grid; gap: 6px; color: var(--ink-2); font-size: 12px; font-weight: 850; }
input, select, textarea { width: 100%; min-height: 43px; padding: 10px 12px; border: 1px solid #cbd2d0; border-radius: 7px; background: white; color: var(--ink); outline: none; }
textarea { min-height: 105px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(31,107,91,.12); }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 12px 10px; text-align: left; border-bottom: 1px solid #e6e9e7; vertical-align: top; }
th { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.status { display: inline-flex; padding: 5px 8px; border-radius: 99px; background: #edf0ef; color: var(--ink-2); font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; }
.status.paid, .status.verified, .status.accepted, .status.released, .status.active { background: var(--green-2); color: #175346; }
.status.declined, .status.failed, .status.cancelled { background: #f6dfdc; color: var(--danger); }
.status.sent, .status.submitted, .status.onboarding { background: #fff0d1; color: #7f5810; }
.stack { display: grid; gap: 10px; }
.list-item { padding: 15px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.list-item h3 { margin-bottom: 6px; }
.list-item p { margin: 4px 0; }

.auth-shell { min-height: 620px; display: grid; place-items: center; padding: 50px 20px; background: linear-gradient(135deg, var(--ink), #173f46); }
.auth-card { width: min(560px, 100%); padding: 38px; background: white; border-radius: 18px 4px 18px 4px; box-shadow: var(--shadow); }
.auth-card h1 { font-family: Georgia, serif; font-size: 42px; }
.loading { min-height: 520px; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--muted); }
.spinner { width: 32px; height: 32px; border: 3px solid #d3d8d6; border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#toast { position: fixed; right: 22px; bottom: 24px; z-index: 50; max-width: min(430px, calc(100vw - 44px)); padding: 14px 18px; border-radius: 10px; background: var(--ink); color: white; box-shadow: var(--shadow); transform: translateY(130%); opacity: 0; transition: .2s ease; }
#toast.show { transform: none; opacity: 1; }
#toast.error { background: var(--danger); }
footer { min-height: 74px; padding: 20px clamp(20px, 4vw, 68px); display: flex; justify-content: space-between; gap: 18px; background: #0b2028; color: #b8c6c8; font-size: 12px; }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .hero-art { min-height: 400px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .steps, .portal-grid { grid-template-columns: 1fr; }
  .panel-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .site-header { align-items: flex-start; }
  nav > a { display: none; }
  .workspace-head { align-items: start; flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .hero-copy { padding-top: 70px; }
  footer { flex-direction: column; }
}
