/* FuelGo customer portal. Tokens match fuelgo.co (src/styles/global.css). */
:root {
  color-scheme: light;
  --crimson: #cc2121;
  --crimson-deep: #8f1414;
  --crimson-glow: #ff5a5a;
  --ink: #121214;
  --ink-soft: #1c1c20;
  --cream: #f7f3ec;
  --paper: #ffffff;
  --line: #e6dfd3;
  --line-soft: #efe9df;
  --muted: #5d5a54;
  --muted-dark: #b9b4ab;
  --gold: #e8a33d;
  --late: #b4232a;
  --ok: #1d7a46;
  --radius: 12px;
  --max: 1240px;
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--cream); line-height: 1.55; font-size: 15px; -webkit-font-smoothing: antialiased; }
a { color: var(--crimson); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; }
h1, h2 { margin: 0; letter-spacing: -0.01em; line-height: 1.2; }
h1 { font-size: 28px; font-weight: 800; }
h2 { font-size: 17px; font-weight: 700; margin-bottom: 14px; }
p { margin: 0 0 10px; }
code { font-size: 0.92em; background: rgba(0, 0, 0, 0.05); padding: 1px 5px; border-radius: 4px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.sub { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.late-text { color: var(--late); font-weight: 700; }
:focus-visible { outline: 3px solid var(--crimson-glow); outline-offset: 2px; }

/* ---------- header ---------- */
.testbar { background: var(--gold); color: var(--ink); text-align: center; font-size: 13px; padding: 6px 16px; }
.top { background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 50; }
.bar { display: flex; align-items: center; gap: 16px; height: 64px; }
.logo img { display: block; height: 30px; width: auto; }
.portal-tag { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-dark); border-left: 1px solid rgba(255, 255, 255, 0.18); padding-left: 16px; }
.who { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; min-width: 0; }
.who-name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }
.who-email { font-size: 12px; color: var(--muted-dark); }
.signout button { background: transparent; color: #e9e6e1; border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 8px; padding: 7px 12px; font: 600 13px var(--font); cursor: pointer; }
.signout button:hover { background: rgba(255, 255, 255, 0.08); }
.tabs { display: flex; gap: 4px; align-items: center; overflow-x: auto; scrollbar-width: none; height: 52px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { color: #d9d5ce; padding: 8px 14px; border-radius: 8px; font-size: 14.5px; white-space: nowrap; }
.tabs a:hover { background: rgba(255, 255, 255, 0.07); color: #fff; text-decoration: none; }
.tabs a[aria-current='page'] { background: rgba(255, 255, 255, 0.12); color: #fff; }
.tabs .schedule-cta { margin-left: auto; border: 1px solid rgba(255, 255, 255, 0.3); color: #fff; }
.tabs .pay-cta { background: var(--crimson); color: #fff; }
.tabs .pay-cta:hover, .tabs .pay-cta[aria-current='page'] { background: var(--crimson-deep); }

main.wrap { padding-top: 28px; padding-bottom: 48px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumb { margin-bottom: 10px; font-size: 14px; }

/* ---------- surfaces ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.card-head a { font-size: 13.5px; white-space: nowrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-2-wide { grid-template-columns: 3fr 2fr; }
.grid-2 > .card { margin-bottom: 20px; }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.tile { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tile-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.tile-value { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.tile-value-sm { font-size: 22px; }
.tile-sub { font-size: 13px; color: var(--muted); }
.tile-balance { background: var(--ink); color: #fff; border-color: var(--ink); }
.tile-balance .tile-label, .tile-balance .tile-sub { color: var(--muted-dark); }
.tile-balance .late-text { color: #ff8a8a; }
.tile-balance .btn { align-self: flex-start; margin-top: 8px; }

/* ---------- buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 18px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); font: 700 14.5px var(--font); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { text-decoration: none; border-color: var(--muted-dark); }
.btn-primary { background: var(--crimson); border-color: var(--crimson); color: #fff; }
.btn-primary:hover { background: var(--crimson-deep); border-color: var(--crimson-deep); }
.btn-small { padding: 8px 14px; font-size: 13.5px; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-block { width: 100%; padding: 14px; font-size: 16px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
input, select { font: 500 14.5px var(--font); color: var(--ink); padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; max-width: 100%; }
input:focus, select:focus { outline: 2px solid var(--crimson-glow); outline-offset: 0; border-color: var(--crimson); }
input[type='checkbox'] { width: 18px; height: 18px; accent-color: var(--crimson); padding: 0; }
label { font-size: 13px; font-weight: 600; color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 20px; }
.filters label { display: flex; flex-direction: column; gap: 4px; }
.alert { padding: 12px 14px; border-radius: 8px; font-weight: 600; font-size: 14px; }
.alert-error { background: #fdecec; color: var(--late); border: 1px solid #f5c2c2; }
.fine { font-size: 13px; color: var(--muted); margin-top: 10px; }
.devbox { background: #fff7e6; border: 1px dashed var(--gold); border-radius: 8px; padding: 12px 14px; font-size: 13.5px; margin-top: 16px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.data th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data td { padding: 11px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.data tbody tr:hover td { background: #fcfaf6; }
.data tfoot th, .data tfoot td { border-top: 2px solid var(--ink); border-bottom: 0; padding-top: 12px; font-size: 14px; color: var(--ink); text-transform: none; letter-spacing: 0; }
.data .num, .lines .num { text-align: right; white-space: nowrap; }
.data .check { width: 34px; }
.pdf { font-size: 12.5px; border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; }
.pdf:hover { text-decoration: none; border-color: var(--crimson); }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; padding: 3px 9px; border-radius: 99px; white-space: nowrap; border: 1px solid transparent; }
.pill-scheduled { background: #eef4fc; color: #1c5cab; }
.pill-delivered { background: #f2f1ee; color: var(--muted); }
.pill-invoiced { background: #fff4e0; color: #8a5a00; }
.pill-partial { background: #fff4e0; color: #8a5a00; border-color: #f3d79d; }
.pill-paid { background: #e8f5ec; color: var(--ok); }
.pill-late { background: #fdecec; color: var(--late); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.list li:last-child { border-bottom: 0; }
.list a { color: var(--ink); }
.list-right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.empty { text-align: center; padding: 28px 12px; }
.empty p { margin: 0 0 4px; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; font-size: 14px; }
.subtabs { display: flex; gap: 6px; margin-bottom: 16px; }
.subtabs a { padding: 7px 14px; border-radius: 99px; color: var(--muted); border: 1px solid var(--line); background: var(--paper); font-size: 14px; }
.subtabs a[aria-current='page'] { background: var(--ink); color: #fff; border-color: var(--ink); }
.subtabs a:hover { text-decoration: none; }
.form-foot { display: flex; align-items: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.form-foot .gap { flex: 1; }

/* ---------- charts ---------- */
.chart { margin: 0; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: #ece7de; stroke-width: 1; }
.chart .tick { fill: var(--muted); font: 500 11px var(--font); }
.chart .endlabel { fill: var(--ink); font: 700 12px var(--font); }
.chart .hit { cursor: default; outline: none; }
.chart .hit:hover path, .chart .hit:focus path { opacity: 0.85; }
.chart .hit:focus rect { fill: rgba(0, 0, 0, 0.04); }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 0; margin: 0 0 12px; font-size: 13px; color: var(--ink); }
.legend li { display: inline-flex; align-items: center; gap: 7px; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend .swatch { margin-right: 0; }
.chart-table { margin-top: 10px; font-size: 13px; }
.chart-table summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.chart-table table { margin-top: 8px; }
.tip { position: fixed; z-index: 100; pointer-events: none; background: var(--ink); color: #fff; font-size: 12.5px; font-weight: 600; line-height: 1.5; padding: 8px 11px; border-radius: 8px; white-space: pre; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2); font-variant-numeric: tabular-nums; }
.aging-bar { display: flex; gap: 2px; height: 14px; border-radius: 4px; overflow: hidden; margin: 18px 0 10px; }
.aging-bar .seg { min-width: 4px; }

/* ---------- invoice & statement ---------- */
.lines { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.lines td, .lines th { padding: 10px 0; border-bottom: 1px solid var(--line-soft); text-align: left; font-weight: 500; }
.lines tfoot th { font-weight: 600; }
.lines .due th, .lines .due td { font-size: 18px; font-weight: 800; border-bottom: 0; border-top: 2px solid var(--ink); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; margin: 0; font-size: 14.5px; }
.facts dt { color: var(--muted); font-weight: 600; }
.facts dd { margin: 0; }

.statement { padding: 32px; }
.stmt-head { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.stmt-logo { display: block; height: 30px; width: auto; background: var(--ink); padding: 8px 12px; border-radius: 8px; box-sizing: content-box; margin-bottom: 10px; }
.stmt-from p { font-size: 13px; color: var(--muted); margin: 0; }
.stmt-meta h2 { font-size: 22px; text-align: right; margin-bottom: 8px; }
.stmt-meta dl { display: grid; grid-template-columns: auto auto; gap: 2px 14px; margin: 0; font-size: 13.5px; }
.stmt-meta dt { color: var(--muted); text-align: right; }
.stmt-meta dd { margin: 0; font-weight: 600; }
.stmt-to { display: flex; flex-direction: column; padding: 18px 0; font-size: 14px; }
.label { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; margin-bottom: 2px; }
.stmt-summary { display: flex; gap: 40px; flex-wrap: wrap; padding: 16px 20px; background: var(--cream); border-radius: 10px; }
.stmt-summary > div { display: flex; flex-direction: column; }
.stmt-summary strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.stmt-summary .big { font-size: 26px; }
.stmt-table { margin-top: 18px; font-size: 13.5px; }
.stmt-foot { margin-top: 18px; }
.stmt-site { margin-top: 6px; }
.stmt-controls { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stmt-controls label[hidden] { display: none; }

/* ---------- pay ---------- */
.pay-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.pay-side { position: sticky; top: 136px; }
.amount-row { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.inline { display: inline-flex; align-items: center; gap: 8px; font-size: 14.5px; color: var(--ink); cursor: pointer; }
.amount-field { display: flex; flex-direction: column; gap: 6px; }
.amount-field[hidden] { display: none; }
.money-input { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding-left: 12px; background: #fff; max-width: 220px; font-weight: 700; color: var(--ink); }
.money-input input { border: 0; font-size: 17px; font-weight: 700; width: 100%; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 8px 0; margin: 0; font-size: 15px; font-variant-numeric: tabular-nums; }
.totals dt { color: var(--muted); }
.totals dd { margin: 0; text-align: right; font-weight: 600; }
.totals .grand { font-size: 20px; font-weight: 800; color: var(--ink); border-top: 2px solid var(--ink); padding-top: 10px; margin-top: 4px; }
.card-fields { display: flex; flex-direction: column; gap: 12px; margin: 14px 0; }
.card-fields label { display: flex; flex-direction: column; gap: 5px; }
.card-fields .row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.card-fields input { width: 100%; font-size: 16px; }
.secure { text-align: center; }
.receipt { max-width: 640px; margin: 0 auto; text-align: left; padding: 32px; }
.receipt h1 { margin: 8px 0; }
.receipt .facts { margin: 20px 0; }
.receipt-ok { width: 52px; height: 52px; border-radius: 50%; background: #e8f5ec; color: var(--ok); display: grid; place-items: center; font-size: 26px; font-weight: 800; }
.receipt .actions { margin-top: 20px; }
.lead { font-size: 15.5px; color: var(--muted); }

/* ---------- sign-in ---------- */
body.plain { background: var(--ink); }
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 16px; }
.auth-logo img { display: block; height: 40px; width: auto; margin-bottom: 28px; }
.auth-card { background: var(--paper); border-radius: 16px; padding: 36px; width: 100%; max-width: 440px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35); }
.auth-card h1 { font-size: 26px; margin-bottom: 10px; }
.auth-card .btn { margin-top: 6px; }
.stack { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.stack input { font-size: 16px; padding: 12px 14px; }
.auth-help { color: var(--muted-dark); font-size: 13.5px; margin-top: 20px; }
.auth-help a { color: #fff; }

/* ---------- schedule a delivery ---------- */
.request-form fieldset { border: 0; padding: 0 0 22px; margin: 0 0 22px; border-bottom: 1px solid var(--line-soft); min-width: 0; }
.request-form legend { font-size: 17px; font-weight: 700; color: var(--ink); padding: 0; margin-bottom: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field input, .field select, .field textarea { width: 100%; font-size: 15px; }
.field.narrow { max-width: 320px; }
textarea { font: 500 15px var(--font); color: var(--ink); padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; resize: vertical; }
.opt { font-weight: 500; color: var(--muted-dark); }
.field-error { color: var(--late); font-size: 12.5px; font-weight: 600; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row-3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 14px; }
.new-site { background: var(--cream); border-radius: 10px; padding: 16px 16px 2px; margin-bottom: 4px; }
.new-site[hidden] { display: none; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-bottom: 14px; }
.check { display: flex; align-items: center; gap: 9px; font-size: 14.5px; color: var(--ink); font-weight: 500; cursor: pointer; }
.checks .check { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.checks .check:has(input:checked) { border-color: var(--crimson); background: #fff6f6; }
.steps { margin: 0; padding-left: 20px; font-size: 14.5px; }
.steps li { margin-bottom: 8px; }
.center { text-align: center; }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); padding: 24px 0 36px; font-size: 13.5px; }
.foot p { margin: 0 0 4px; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .pay-grid { grid-template-columns: 1fr; }
  .pay-side { position: static; }
}
@media (max-width: 760px) {
  .row-2, .row-3 { grid-template-columns: 1fr; gap: 0; }
  .wrap { padding: 0 16px; }
  .grid-2, .grid-2-wide { grid-template-columns: 1fr; gap: 0; }
  .portal-tag, .who-email { display: none; }
  .who-name { max-width: 150px; font-size: 13px; }
  h1 { font-size: 23px; }
  .card { padding: 16px; }
  .tile-value { font-size: 24px; }
  .statement { padding: 18px; }
  .stmt-meta h2, .stmt-meta dt { text-align: left; }
  .tabs .schedule-cta { margin-left: 4px; }
}
@media (max-width: 420px) {
  .tiles { grid-template-columns: 1fr; }
  .logo img { height: 24px; }
}

/* ---------- print (statement, receipt) ---------- */
@media print {
  body { background: #fff; font-size: 12px; }
  .top, .foot, .testbar, .no-print, .filters, .chart-table, .tip { display: none !important; }
  main.wrap { padding: 0; max-width: none; }
  .card { border: 0; padding: 0; }
  .statement { padding: 0; }
  .stmt-logo, .aging-bar .seg, .swatch { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: inherit; }
}
