/* ShipOverpay design tokens — single source of truth for colors.
   Green is strictly reserved for recovered/recoverable money. */
:root {
  --sop-bg: #F7F9FC;
  --sop-card: #FFFFFF;
  --sop-text: #0F172A;
  --sop-text-secondary: #475569;
  --sop-text-muted: #64748B;
  --sop-accent: #1D4ED8;
  --sop-accent-soft: #EFF6FF;
  --sop-accent-border: #BFDBFE;
  --sop-money: #16A34A;
  --sop-money-deep: #15803D;
  --sop-money-soft: #F0FDF4;
  --sop-warning: #F59E0B;
  --sop-warning-deep: #B45309;
  --sop-warning-soft: #FFFBEB;
  --sop-danger: #DC2626;
  --sop-danger-soft: #FEF2F2;
  --sop-border: #E2E8F0;
  --sop-radius: 8px;
  --sop-radius-lg: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--sop-bg);
  color: var(--sop-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

a { color: var(--sop-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout rule (approved): full-width backgrounds, inner content capped.
   Marketing 1280px · hero text 760px · scanner 640px · app dashboard 1440px. */
.topbar {
  background: var(--sop-card);
  border-bottom: 1px solid var(--sop-border);
}
.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { font-weight: 600; font-size: 16px; color: var(--sop-text); }
.brand span { color: var(--sop-accent); }

.container { max-width: 1280px; margin: 0 auto; padding: 32px; }
.container-app { max-width: 1440px; }
.container-narrow { max-width: 420px; margin: 48px auto; padding: 0 20px; }

.card {
  background: var(--sop-card);
  border: 1px solid var(--sop-border);
  border-radius: var(--sop-radius-lg);
  padding: 28px;
}

h1 { font-size: 24px; font-weight: 600; margin: 0 0 16px; }
h2 { font-size: 18px; font-weight: 600; margin: 0 0 12px; }

label { display: block; font-size: 13px; font-weight: 500; margin: 14px 0 4px; color: var(--sop-text); }
input[type="text"], input[type="email"], input[type="password"] {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--sop-border);
  border-radius: var(--sop-radius);
  font-size: 14px;
  background: var(--sop-card);
  color: var(--sop-text);
}
input:focus { outline: 2px solid var(--sop-accent-border); border-color: var(--sop-accent); }

.btn {
  display: inline-block;
  border: none;
  border-radius: var(--sop-radius);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.btn-primary { background: var(--sop-accent); color: #FFFFFF; }
.btn-primary:hover { background: #1E40AF; }
.btn-secondary { background: var(--sop-card); color: var(--sop-text); border: 1px solid var(--sop-border); }
.btn-block { width: 100%; margin-top: 18px; }

.flash { border-radius: var(--sop-radius); padding: 10px 14px; margin: 0 0 16px; font-size: 14px; }
.flash-success { background: var(--sop-accent-soft); color: var(--sop-accent); }
.flash-error { background: var(--sop-danger-soft); color: var(--sop-danger); }

.field-error { color: var(--sop-danger); font-size: 12px; margin-top: 3px; }
.muted { color: var(--sop-text-muted); font-size: 13px; }
.banner {
  background: var(--sop-warning-soft);
  color: var(--sop-warning-deep);
  border-radius: var(--sop-radius);
  padding: 10px 14px;
  margin-bottom: 20px;
  font-size: 14px;
}

/* ===== Design system components (docs/DESIGN_SYSTEM.md) ===== */

:root {
  --sop-accent-hover: #1E40AF;
  --sop-money-border: #BBF7D0;
  --sop-border-strong: #CBD5E1;
}

.money { font-variant-numeric: tabular-nums; }

.btn-recover { background: var(--sop-money-deep); color: #FFFFFF; }
.btn-recover:hover { background: #166534; }
.btn-ghost { background: transparent; color: var(--sop-accent); border: none; }
.btn-danger-outline { background: #FFFFFF; color: var(--sop-danger); border: 1px solid var(--sop-danger); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn:disabled, .btn.is-loading { opacity: .55; pointer-events: none; }

/* Alerts */
.alert { border-radius: var(--sop-radius); padding: 12px 16px; font-size: 14px; margin: 12px 0; }
.alert-info { background: var(--sop-accent-soft); color: var(--sop-accent); }
.alert-success { background: var(--sop-money-soft); color: var(--sop-money-deep); }
.alert-warning { background: var(--sop-warning-soft); color: var(--sop-warning-deep); }
.alert-error { background: var(--sop-danger-soft); color: var(--sop-danger); }
.alert a { color: inherit; text-decoration: underline; }

/* Badges */
.badge { display: inline-block; font-size: 11px; font-weight: 500; letter-spacing: .4px;
  padding: 3px 10px; border-radius: 999px; }
.badge-neutral { background: #F1F5F9; color: #475569; }
.badge-review { background: var(--sop-warning-soft); color: var(--sop-warning-deep); }
.badge-recoverable { background: var(--sop-accent-soft); color: var(--sop-accent); }
.badge-recovered { background: var(--sop-money-soft); color: var(--sop-money-deep); }
.badge-error { background: var(--sop-danger-soft); color: var(--sop-danger); }

/* Dropzone */
.dropzone { background: var(--sop-card); border: 2px dashed var(--sop-accent-border);
  border-radius: var(--sop-radius-lg); padding: 36px 24px; text-align: center;
  transition: border-color .12s ease, background .12s ease; }
.dropzone.is-dragover { border-color: var(--sop-accent); border-style: solid; background: var(--sop-accent-soft); }
.dropzone .dz-icon { font-size: 28px; color: var(--sop-accent); line-height: 1; }
.dropzone .dz-title { font-size: 15px; font-weight: 500; margin-top: 10px; }
.dropzone .dz-caption { font-size: 12px; color: var(--sop-text-muted); margin-top: 4px; }
.dropzone .dz-action { margin-top: 16px; }
.dropzone input[type="file"] { display: none; }

.progress { height: 6px; background: #EEF2F7; border-radius: 999px; overflow: hidden; margin-top: 18px; }
.progress-bar { height: 100%; width: 0; background: var(--sop-accent); border-radius: 999px;
  transition: width .15s ease; }
.progress-bar.indeterminate { width: 30%; animation: sop-indet 1.1s ease-in-out infinite; }
@keyframes sop-indet { 0% { margin-left: -30%; } 100% { margin-left: 100%; } }

/* Tables */
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 500; color: var(--sop-text-muted);
  padding: 8px 16px; border-bottom: 1px solid var(--sop-border); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--sop-border); }
.table tbody tr:hover { background: #FAFBFD; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .meta { font-size: 13px; color: var(--sop-text-muted); }

/* Empty state */
.empty-state { text-align: center; padding: 48px 24px; }
.empty-state .es-icon { font-size: 24px; color: var(--sop-text-muted); }
.empty-state h3 { font-size: 15px; font-weight: 600; margin: 12px 0 6px; }
.empty-state p { font-size: 14px; color: var(--sop-text-secondary); margin: 0 0 18px; }

/* Skeleton loading */
.skeleton { border-radius: 6px; background: #EEF2F7; animation: sop-pulse 1.2s ease-in-out infinite; }
@keyframes sop-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, .45);
  display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal { background: #FFFFFF; border-radius: var(--sop-radius-lg); max-width: 480px;
  width: calc(100% - 40px); padding: 28px; box-shadow: 0 10px 40px rgba(15, 23, 42, .18); }
.modal h2 { margin-top: 0; }
.modal-footer { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }
[hidden] { display: none !important; }

/* ============================================================
   Landing page v2 — bold scale for the US B2B market.
   Containers stay capped (1280px); component scale grows so large
   screens read as deliberate, not empty.
   ============================================================ */

.lp { --lp-max: 1280px; }
.lp-container { max-width: var(--lp-max); margin: 0 auto; padding: 0 32px; }

/* Header */
.lp-header { background: var(--sop-card); border-bottom: 1px solid var(--sop-border);
  position: sticky; top: 0; z-index: 20; }
.lp-header-inner { max-width: var(--lp-max); margin: 0 auto; padding: 0 32px; height: 80px;
  display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.lp-brand { display: flex; align-items: center; gap: 10px; font-size: 21px; font-weight: 600;
  color: var(--sop-text); text-decoration: none; letter-spacing: -0.2px; }
.lp-brand span { color: var(--sop-accent); }
.lp-brand svg { width: 26px; height: 26px; color: var(--sop-accent); }
.lp-nav { display: flex; align-items: center; gap: 28px; }
.lp-nav a { font-size: 15px; color: var(--sop-text-secondary); text-decoration: none; font-weight: 500; }
.lp-nav a:hover { color: var(--sop-text); text-decoration: none; }
.lp-nav .lp-signin { color: var(--sop-text); }
.lp-nav a.btn-primary { color: #FFFFFF; }
.lp-nav a.btn-primary:hover { color: #FFFFFF; }

/* Buttons at landing scale */
.btn-lg { font-size: 17px; font-weight: 600; padding: 17px 34px; border-radius: 10px; }
.btn-md { font-size: 15px; font-weight: 600; padding: 12px 22px; border-radius: 9px; }

/* Hero */
.lp-hero { background: var(--sop-card); border-bottom: 1px solid var(--sop-border);
  padding: 96px 0 88px; text-align: center; }
.lp-eyebrow { font-size: 13px; font-weight: 600; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--sop-accent); margin: 0 0 22px; }
.lp-h1 { font-size: 72px; line-height: 1.04; font-weight: 700; letter-spacing: -2px;
  color: var(--sop-text); margin: 0 auto; max-width: 980px; }
.lp-sub { font-size: 23px; line-height: 1.5; color: var(--sop-text-secondary);
  max-width: 820px; margin: 28px auto 0; }
.lp-carriers { font-size: 16px; font-weight: 600; color: var(--sop-text); letter-spacing: 1px;
  margin: 20px 0 0; }

/* Dropzone as hero centerpiece */
.dropzone-hero { max-width: 780px; margin: 44px auto 0; padding: 56px 48px;
  border: 2px dashed #93B4F5; border-radius: 18px;
  box-shadow: 0 6px 28px rgba(15, 23, 42, .08); }
.dropzone-hero .dz-icon { font-size: 0; color: var(--sop-accent); }
.dropzone-hero .dz-icon svg { width: 56px; height: 56px; }
.dropzone-hero .dz-title { font-size: 27px; font-weight: 600; margin-top: 20px; letter-spacing: -0.4px; }
.dropzone-hero .dz-carriers { font-size: 15px; font-weight: 600; color: var(--sop-text-secondary);
  margin-top: 10px; letter-spacing: .6px; }
.dropzone-hero .dz-caption { font-size: 14px; margin-top: 8px; }
.dropzone-hero .dz-action { margin-top: 28px; }
.dropzone-hero .progress { height: 8px; margin-top: 26px; }

.lp-trust { display: flex; flex-wrap: wrap; justify-content: center; gap: 32px; margin: 30px 0 0; }
.lp-trust span { font-size: 15px; color: var(--sop-text-secondary); font-weight: 500; }
.lp-trust svg { width: 17px; height: 17px; color: var(--sop-money); vertical-align: -3px;
  margin-right: 7px; }

/* Sections */
.lp-section { padding: 88px 0; }
.lp-section-alt { background: var(--sop-card); border-top: 1px solid var(--sop-border);
  border-bottom: 1px solid var(--sop-border); }
.lp-h2 { font-size: 44px; line-height: 1.12; font-weight: 700; letter-spacing: -1.1px;
  color: var(--sop-text); margin: 0 0 18px; text-align: center; }
.lp-lead { font-size: 19px; line-height: 1.6; color: var(--sop-text-secondary); max-width: 760px;
  margin: 0 auto 52px; text-align: center; }
.lp-grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); gap: 24px; }

.lp-grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 32px; }
.lp-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 32px; }

.lp-card { background: var(--sop-card); border: 1px solid var(--sop-border); border-radius: 14px;
  padding: 32px 28px; }
.lp-section-alt .lp-card { background: var(--sop-bg); }
.lp-card-icon { width: 52px; height: 52px; border-radius: 12px; background: var(--sop-accent-soft);
  color: var(--sop-accent); display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px; }
.lp-card-icon svg { width: 25px; height: 25px; }
.lp-card h3 { font-size: 20px; font-weight: 600; margin: 0 0 10px; letter-spacing: -0.3px; }
.lp-card p { font-size: 16px; line-height: 1.6; color: var(--sop-text-secondary); margin: 0; }

/* How it works */
.lp-step-num { font-size: 15px; font-weight: 700; color: var(--sop-accent); letter-spacing: 1.4px;
  margin-bottom: 14px; }
.lp-step h3 { font-size: 25px; font-weight: 600; margin: 0 0 12px; letter-spacing: -0.4px; }
.lp-step p { font-size: 17px; line-height: 1.6; color: var(--sop-text-secondary); margin: 0; }
.lp-step-icon { width: 64px; height: 64px; border-radius: 16px; background: var(--sop-accent-soft);
  color: var(--sop-accent); display: flex; align-items: center; justify-content: center;
  margin-bottom: 24px; }
.lp-step-icon svg { width: 30px; height: 30px; }

/* Checked-items grid */
.lp-check-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); gap: 16px; }
.lp-check { background: var(--sop-card); border: 1px solid var(--sop-border); border-radius: 12px;
  padding: 20px 22px; font-size: 17px; font-weight: 500; display: flex; align-items: center; gap: 12px; }
.lp-section-alt .lp-check { background: var(--sop-bg); }
.lp-check svg { width: 20px; height: 20px; color: var(--sop-accent); flex-shrink: 0; }
.lp-note { font-size: 15px; color: var(--sop-text-muted); text-align: center; margin: 32px auto 0;
  max-width: 760px; line-height: 1.6; }
.lp-security-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 600px) { .lp-security-grid { grid-template-columns: minmax(0, 1fr); } }

/* Illustrative money example */
.lp-example { background: var(--sop-card); border: 1px solid var(--sop-border); border-radius: 18px;
  padding: 44px; max-width: 620px; }
.lp-example-tag { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .8px;
  text-transform: uppercase; background: #F1F5F9; color: #475569; padding: 5px 12px;
  border-radius: 999px; margin-bottom: 26px; }
.lp-example-row { display: flex; justify-content: space-between; align-items: baseline;
  padding: 16px 0; border-bottom: 1px solid var(--sop-border); }
.lp-example-row:last-child { border-bottom: none; }
.lp-example-row .k { font-size: 16px; color: var(--sop-text-secondary); }
.lp-example-row .v { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.lp-example-row .v.money { color: var(--sop-money); }

/* Recovery pipeline */
.lp-pipeline { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 32px; }
.lp-pipe-step { background: var(--sop-card); border: 1px solid var(--sop-border); border-radius: 999px;
  padding: 11px 20px; font-size: 15px; font-weight: 500; }
.lp-pipe-step.is-fee { background: var(--sop-money-soft); border-color: var(--sop-money-border);
  color: var(--sop-money-deep); }
.lp-pipe-arrow { color: var(--sop-text-muted); font-size: 18px; }

/* Pricing preview */
.lp-price { background: var(--sop-card); border: 1px solid var(--sop-border); border-radius: 16px;
  padding: 36px 32px; text-align: center; }
.lp-price.is-featured { border: 2px solid var(--sop-accent); }
.lp-price h3 { font-size: 18px; font-weight: 600; margin: 0 0 12px; }
.lp-price .amount { font-size: 42px; font-weight: 700; letter-spacing: -1px; margin-bottom: 12px;
  font-variant-numeric: tabular-nums; }
.lp-price p { font-size: 16px; color: var(--sop-text-secondary); margin: 0; line-height: 1.6; }

/* Final CTA */
.lp-final { background: var(--sop-text); color: #FFFFFF; padding: 96px 0; text-align: center; }
.lp-final h2 { font-size: 48px; line-height: 1.15; font-weight: 700; letter-spacing: -1.2px;
  margin: 0 auto 20px; max-width: 900px; color: #FFFFFF; }
.lp-final p { font-size: 20px; color: #CBD5E1; margin: 0 0 36px; }
.lp-final .btn-primary { background: #FFFFFF; color: var(--sop-text); }
.lp-final .btn-primary:hover { background: #E2E8F0; }
.lp-final small { display: block; margin-top: 20px; font-size: 15px; color: #94A3B8; }

/* Footer */
.lp-footer { background: var(--sop-card); border-top: 1px solid var(--sop-border); padding: 64px 0 40px; }
/* minmax(0, …) everywhere: a bare 1fr track is min-content wide, and long
   labels then push the grid past the viewport. */
.lp-footer-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(4, minmax(0, 1fr));
  gap: 40px; }
.lp-footer h4 { font-size: 14px; font-weight: 600; margin: 0 0 18px; color: var(--sop-text); }
.lp-footer ul { list-style: none; margin: 0; padding: 0; }
.lp-footer li { margin-bottom: 12px; }
.lp-footer a, .lp-footer li { font-size: 15px; color: var(--sop-text-secondary); text-decoration: none; }
.lp-footer a:hover { color: var(--sop-accent); }
.lp-footer-bottom { border-top: 1px solid var(--sop-border); margin-top: 48px; padding-top: 28px;
  font-size: 14px; color: var(--sop-text-muted); }

@media (max-width: 1100px) {
  .lp-h1 { font-size: 58px; letter-spacing: -1.4px; }
  .lp-sub { font-size: 21px; }
  .lp-h2 { font-size: 38px; }
  .lp-hero { padding: 76px 0 68px; }
  .lp-section { padding: 72px 0; }
  .lp-footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .lp-container, .lp-header-inner { padding: 0 18px; }
  /* The header row cannot wrap, so its min-content width sets the page's
     minimum width — keep brand, sign-in and CTA small enough to fit 375px. */
  .lp-header-inner { height: 64px; gap: 10px; }
  .lp-brand { font-size: 17px; gap: 7px; }
  .lp-brand svg { width: 21px; height: 21px; }
  .lp-nav { gap: 12px; }
  .lp-nav a:not(.lp-signin):not(.btn) { display: none; }
  .lp-nav a { font-size: 14px; }
  .lp-nav .btn-md { padding: 9px 13px; font-size: 13px; white-space: nowrap; }
  .lp-hero { padding: 52px 0 48px; }
  .lp-h1 { font-size: 40px; letter-spacing: -0.8px; overflow-wrap: break-word; }
  .lp-eyebrow { font-size: 12px; letter-spacing: 1px; }
  .lp-carriers { font-size: 14px; letter-spacing: .4px; }
  .lp-sub { font-size: 18px; margin-top: 20px; }
  .lp-h2 { font-size: 30px; }
  .lp-lead { font-size: 17px; margin-bottom: 36px; }
  .lp-section, .lp-final { padding: 56px 0; }
  .lp-final h2 { font-size: 32px; }
  .dropzone-hero { padding: 36px 22px; border-radius: 14px; }
  .dropzone-hero .dz-title { font-size: 21px; }
  .dropzone-hero .dz-icon svg { width: 44px; height: 44px; }
  .lp-example { padding: 28px 22px; }
  .lp-example-row .v { font-size: 22px; }
  .lp-trust { gap: 16px 24px; }
  .lp-footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
  .lp-example-row { flex-wrap: wrap; gap: 4px; }
}

@media (max-width: 400px) {
  .lp-h1 { font-size: 36px; }
  .lp-brand { font-size: 16px; }
}

/* Legacy dashboard bits kept from v1 */
.how { background: var(--sop-card); border-top: 1px solid var(--sop-border); padding: 40px 20px 48px; }
.how-step .hs-title { font-size: 14px; font-weight: 500; }
.how-step .hs-text { font-size: 12px; color: var(--sop-text-muted); margin-top: 4px; }

/* Responsive */
@media (max-width: 767px) {
  .hero { padding: 40px 16px 20px; }
  .hero h1 { font-size: 26px; }
  .container { padding: 20px 14px; }
  .topbar-inner { padding: 12px 16px; }
  .btn { min-height: 44px; }
}
