:root {
  --ink: #142126;
  --muted: #66747a;
  --paper: #f6f7f4;
  --white: #fff;
  --line: #dbe2de;
  --teal: #103f48;
  --teal-bright: #176f72;
  --gold: #c4923f;
  --green: #39715a;
  --red: #9c4138;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

.connect-topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px clamp(18px, 4vw, 52px);
  color: var(--white);
  background: var(--teal);
}

.connect-topbar.compact { min-height: 64px; }
.connect-brand { display: inline-flex; align-items: center; gap: 10px; }
.connect-brand strong, .connect-brand small { display: block; line-height: 1; }
.connect-brand small { margin-top: 5px; color: rgba(255,255,255,.7); font-size: .72rem; text-transform: uppercase; }
.connect-mark { display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid rgba(255,255,255,.45); border-radius: 8px; font-weight: 850; }
.connect-topbar-actions { display: flex; align-items: center; gap: 8px; }

.quiet-button, .secondary-button, .copy-control button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  font-weight: 750;
}
.connect-topbar .quiet-button { display: inline-flex; align-items: center; justify-content: center; border-color: rgba(255,255,255,.32); background: transparent; color: var(--white); padding: 0 14px; }

.connect-shell {
  min-height: calc(100svh - 72px);
  display: grid;
  grid-template-columns: minmax(290px, 38%) minmax(0, 1fr);
}

.connect-intro {
  padding: clamp(42px, 7vw, 92px) clamp(28px, 6vw, 84px);
  color: var(--white);
  background: #1b3940;
}

.connect-eyebrow { margin: 0 0 10px; color: var(--gold); font-size: .76rem; font-weight: 850; text-transform: uppercase; }
.connect-intro h1, .payment-workspace h1 { margin: 0; font-size: clamp(2.4rem, 5vw, 4.4rem); line-height: 1; letter-spacing: 0; }
.connect-intro > p:not(.connect-eyebrow) { max-width: 520px; color: rgba(255,255,255,.74); line-height: 1.65; }

.connect-steps { display: grid; gap: 0; margin: 42px 0; padding: 0; list-style: none; }
.connect-steps li { position: relative; display: grid; grid-template-columns: 42px 1fr; align-items: center; gap: 12px; min-height: 68px; color: rgba(255,255,255,.52); }
.connect-steps li:not(:last-child)::after { content: ""; position: absolute; left: 20px; top: 48px; bottom: -12px; width: 1px; background: rgba(255,255,255,.22); }
.connect-steps span { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid rgba(255,255,255,.28); border-radius: 50%; }
.connect-steps li.active { color: var(--white); }
.connect-steps li.active span { border-color: var(--gold); background: var(--gold); color: #21190d; }
.commission-line { display: flex; justify-content: space-between; gap: 16px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.18); color: rgba(255,255,255,.72); }
.commission-line strong { color: var(--white); }
.fee-estimator { margin-top: 18px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.18); }
.fee-estimator-heading, .fee-estimator dl div, .fee-amount-control { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fee-estimator-heading span { font-size: .76rem; color: rgba(255,255,255,.66); }
.fee-estimator label { display: grid; gap: 7px; margin-top: 14px; font-size: .82rem; color: rgba(255,255,255,.76); }
.fee-amount-control { padding: 0 12px; min-height: 42px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); }
.fee-amount-control input { width: 100%; padding: 0; border: 0; color: var(--white); background: transparent; font: inherit; }
.fee-amount-control input:focus { outline: 0; }
.fee-estimator dl { margin: 14px 0 10px; }
.fee-estimator dl div { padding: 5px 0; font-size: .82rem; }
.fee-estimator dt { color: rgba(255,255,255,.7); }
.fee-estimator dd { margin: 0; font-weight: 700; }
.fee-estimator .fee-total { margin-top: 5px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.18); }
.fee-estimator small { display: block; color: rgba(255,255,255,.58); font-size: .7rem; line-height: 1.45; }

.connect-workspace { padding: clamp(36px, 7vw, 92px) clamp(20px, 7vw, 104px); }
.connect-form, .merchant-dashboard, .payment-workspace { width: min(680px, 100%); }
.workspace-heading h2, .dashboard-heading h2 { margin: 0; font-size: clamp(1.8rem, 3vw, 2.7rem); letter-spacing: 0; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 28px; }
.wide { grid-column: 1 / -1; }
label { display: grid; gap: 8px; color: #34464d; font-size: .9rem; font-weight: 750; }
input { width: 100%; min-height: 48px; border: 1px solid #cbd5d0; border-radius: 6px; padding: 0 13px; background: var(--white); color: var(--ink); }
input:focus { outline: 3px solid rgba(23,111,114,.17); border-color: var(--teal-bright); }
.honeypot { position: absolute; left: -10000px; }
.terms-line { grid-template-columns: 20px 1fr; align-items: start; margin: 24px 0; font-weight: 500; line-height: 1.5; }
.terms-line input { min-height: 18px; height: 18px; margin: 2px 0 0; }
.primary-button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  padding: 0 18px;
  background: var(--gold);
  color: #21190d;
  cursor: pointer;
  font-weight: 800;
}
.primary-button:disabled { opacity: .6; cursor: wait; }
.text-button { min-height: 44px; border: 0; padding: 0 12px; background: transparent; color: var(--teal-bright); cursor: pointer; font-weight: 750; }
.login-form .primary-button { margin-top: 22px; }
.secure-note { margin: 14px 0 0; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.connect-alert { width: min(680px, 100%); margin-bottom: 22px; border-left: 4px solid var(--teal-bright); padding: 14px 16px; background: #e8f1ef; color: #244a45; }
.connect-alert[data-tone="error"] { border-color: var(--red); background: #f7e9e7; color: #71332d; }
.connect-alert[data-tone="success"] { border-color: var(--green); background: #e8f2ec; color: #285741; }

.dashboard-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.status-badge { padding: 7px 10px; border-radius: 999px; background: #f3e8d4; color: #6c4b17; font-size: .78rem; font-weight: 800; }
.status-badge[data-ready="true"] { background: #e2f0e8; color: #285741; }
.status-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 30px; border: 1px solid var(--line); background: var(--line); }
.status-grid div { min-height: 94px; display: grid; align-content: center; gap: 8px; padding: 18px; background: var(--white); }
.status-grid span { color: var(--muted); font-size: .8rem; }
.action-band { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 22px; padding: 22px; border-left: 4px solid var(--gold); background: #fffaf0; }
.action-band div { display: grid; gap: 5px; }
.action-band span { color: var(--muted); font-size: .9rem; }
.payment-link-section { margin-top: 28px; }
.payment-tool-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.payment-tool { display: grid; align-content: start; gap: 12px; padding: 20px; border: 1px solid var(--line); border-radius: 6px; }
.payment-tool > span { min-height: 44px; color: var(--muted); font-size: .88rem; line-height: 1.45; }
.payment-tool .tool-status { min-height: 0; font-weight: 700; color: #9a6216; }
.payment-tool .tool-status[data-ready="true"] { color: #287451; }
.payment-tool label { display: grid; gap: 7px; font-size: .82rem; }
.payment-tool .primary-button, .payment-tool .secondary-button { width: 100%; }
.copy-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.copy-control input { border-radius: 6px 0 0 6px; }
.copy-control button { border-left: 0; border-radius: 0 6px 6px 0; padding: 0 16px; }
.dashboard-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.secondary-button { padding: 0 16px; }

.payment-page { min-height: 100svh; background: #eef2ef; }
.payment-shell { width: min(1050px, calc(100% - 32px)); margin: clamp(30px, 8vh, 84px) auto; display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 1px; border: 1px solid var(--line); background: var(--line); }
.payment-workspace, .payment-assurance { background: var(--white); }
.payment-workspace { width: auto; padding: clamp(28px, 6vw, 72px); }
.payment-workspace h1 { font-size: clamp(2rem, 4vw, 3.3rem); }
.payment-form { display: grid; gap: 18px; margin-top: 32px; }
.amount-control { display: grid; grid-template-columns: 1fr 48px; }
.amount-control input { border-radius: 6px 0 0 6px; text-align: right; font-size: 1.15rem; font-weight: 800; }
.amount-control span { display: grid; place-items: center; border: 1px solid #cbd5d0; border-left: 0; border-radius: 0 6px 6px 0; background: #f5f7f5; font-weight: 800; }
.payment-assurance { display: grid; align-content: start; gap: 18px; padding: 34px 28px; color: var(--muted); }
.payment-assurance strong { color: var(--ink); }

@media (max-width: 800px) {
  .connect-shell { grid-template-columns: 1fr; }
  .connect-intro { padding: 32px 20px; }
  .connect-intro > p:not(.connect-eyebrow) { margin-bottom: 0; }
  .connect-steps { grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 26px 0; }
  .connect-steps li { grid-template-columns: 1fr; justify-items: center; align-content: start; min-height: 82px; text-align: center; font-size: .75rem; }
  .connect-steps li::after { display: none; }
  .connect-workspace { padding-top: 38px; }
  .field-grid { grid-template-columns: 1fr; }
  .wide { grid-column: auto; }
  .dashboard-heading, .action-band { align-items: stretch; flex-direction: column; }
  .status-grid { grid-template-columns: 1fr; }
  .payment-tool-grid { grid-template-columns: 1fr; }
  .payment-shell { grid-template-columns: 1fr; margin: 20px auto; }
}

@media (max-width: 480px) {
  .connect-topbar { min-height: 64px; flex-wrap: wrap; padding-inline: 14px; }
  .connect-topbar-actions { margin-left: auto; }
  .connect-topbar .quiet-button { max-width: 120px; }
  .connect-mark { width: 36px; height: 36px; }
  .connect-workspace { padding-inline: 16px; }
  input, button, .primary-button, .secondary-button { min-width: 0; max-width: 100%; }
  .copy-control { grid-template-columns: minmax(0, 1fr) 82px; }
  .dashboard-actions { display: grid; }
}
