/*
 * Ecommerce & Amazon — a third brand on the same Worker.
 *
 * It shares nothing visually with either ApplyVerified or Income Accelerator, and that is
 * the point: this reader has just been sold to by people who all look the same as each
 * other. IA is cool navy, rounded corners and green ticks. This is a payroll document —
 * warm paper, near-square corners, ruled rows, tabular figures, one oxblood accent that
 * reads as a stamp rather than a "buy" colour.
 *
 * System fonts only, including the system monospace for figures. The audience is a
 * mid-range Android on 3G and a webfont is the most expensive thing a landing page can buy
 * for the least return.
 */
:root {
  /*
   * THE BRAND NAME LIVES HERE AND NOWHERE ELSE.
   *
   * It is provisional — the PM's ruling for Sprint 2 was that the pages carry it in one
   * place so a rename is a one-line change. It is rendered through `content:` on the
   * wordmark and the footer, so no HTML file contains it and no page title depends on it
   * (page titles are descriptive on purpose). Renaming the funnel is editing this line.
   */
  --brand: "The Pay Scale";

  --ink: #1A1714;
  --paper: #FFFDFA;
  --board: #F4EFE7;
  --slate: #5A5248;
  --rule: #E2D9CC;
  /* --rule is decorative and far under the 3:1 WCAG 1.4.11 wants of a control boundary.
     Anything that bounds an input or a pressable uses this instead: 3.24:1 on --paper. */
  --rule-strong: #A2937F;
  --stamp: #8A1C2B;
  --stamp-ink: #FFFFFF;
  --good: #2F6B3D;
  --danger: #A3121F;
  --danger-ink: #6B0F18;
  --danger-bg: #FDF2F1;
  --danger-line: #F0C9C5;
  --r: 3px;

  color-scheme: light;
}

/*
 * Dark mode, because not having it is not neutral on this device class.
 *
 * Chrome and Samsung Internet on Android ship a force-dark that algorithmically inverts any
 * page which has not declared a preference, and it is unpredictable in exactly the places
 * that matter here: the amount on the payment page, the error panel, the ladder figures.
 * Declaring `color-scheme` is what stops the browser doing that on top of our own theme,
 * and it themes the native <select> and file picker for free.
 */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ink: #EFE7DC;
    --paper: #17150F;
    --board: #100E0A;
    --slate: #A69A8A;
    --rule: #2E2921;
    --rule-strong: #7A6E5D;
    /* White on the light-mode oxblood is fine; in dark mode the accent has to lighten or
       the stamp text goes to 2.4:1. Dark ink on the lighter stamp measures 8.1:1. */
    --stamp: #E8A0A8;
    --stamp-ink: #17150F;
    --good: #79C48B;
    --danger: #F0A8A2;
    --danger-ink: #F5C4C0;
    --danger-bg: #2A1513;
    --danger-line: #6B1F1B;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--board);
  color: var(--ink);
  font: 16px/1.62 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.wrap { max-width: 680px; margin: 0 auto; padding: 20px 16px 64px; }

/* The masthead rule is a double line, the way a ruled ledger heading is. */
.bar { height: 5px; background: var(--ink); border-bottom: 3px solid var(--board); }

header.brand { display: flex; align-items: center; gap: 10px; padding: 18px 0 26px; }
header.brand .mark {
  display: block; width: 26px; height: 26px; flex: 0 0 auto; background: var(--stamp);
  -webkit-mask: url(/ea/mark.svg) no-repeat center / contain;
  mask: url(/ea/mark.svg) no-repeat center / contain;
}
/* The name is drawn from --brand, so it appears in no HTML file. */
header.brand b::after { content: var(--brand); }
header.brand b {
  font-size: 15px; font-weight: 700; letter-spacing: 0.02em; color: var(--ink);
  text-transform: uppercase;
}

h1 { font-size: 29px; line-height: 1.16; letter-spacing: -0.015em; margin: 0 0 14px; }
h2 {
  font-size: 13px; line-height: 1.3; margin: 34px 0 12px; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--slate); font-weight: 700;
  border-bottom: 1px solid var(--rule); padding-bottom: 8px;
}
h3 { font-size: 18px; line-height: 1.3; margin: 24px 0 8px; }
p { margin: 0 0 15px; }
.lede { font-size: 18px; color: var(--slate); }
.eyebrow {
  font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--slate); margin: 0 0 8px; font-weight: 700;
}
small, .fine { font-size: 13px; color: var(--slate); }
.fine a, footer a { color: var(--slate); }

/*
 * The ladder, and every other figure.
 *
 * Tabular numerals so five rows of rupees line up on the decimal — an amount column that
 * does not align reads as a graphic, and this one is meant to be read as a document.
 */
.num {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
}

table.scale { width: 100%; border-collapse: collapse; margin: 0 0 18px; font-size: 15px; }
table.scale caption { text-align: left; font-size: 13px; color: var(--slate); padding: 0 0 10px; }
table.scale th, table.scale td { padding: 11px 8px; border-bottom: 1px solid var(--rule); text-align: left; }
table.scale th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--slate); }
table.scale td:last-child, table.scale th:last-child { text-align: right; white-space: nowrap; }
table.scale tbody tr:last-child td { border-bottom: 2px solid var(--ink); }
table.scale td b { font-weight: 700; }
@media (max-width: 460px) {
  table.scale { font-size: 14px; }
  table.scale th, table.scale td { padding: 10px 4px; }
}

.card {
  background: var(--paper); border: 1px solid var(--rule);
  border-radius: var(--r); padding: 20px; margin: 0 0 16px;
}
/* The offer card is stamped, not glowed. */
.card.focus { border: 1px solid var(--ink); border-top: 4px solid var(--stamp); }
fieldset.card { margin: 0 0 16px; min-width: 0; }
fieldset.card > legend { padding: 0; }

ul.ticks { list-style: none; padding: 0; margin: 0 0 20px; }
ul.ticks li { padding-left: 24px; position: relative; margin-bottom: 10px; }
/* An en-dash rule, not a tick: this is a document, and nothing here is a "benefit". */
ul.ticks li::before {
  content: ""; position: absolute; left: 0; top: 12px; width: 14px; height: 2px;
  background: var(--stamp);
}

.price { font-size: 30px; font-weight: 700; margin: 0 0 6px; }
/* A dual-currency figure is long, and .price is monospace here. At 30px the largest rung
   on the ladder broke onto two lines on a 375px screen — measured against the live catalog,
   not guessed. No example figure is written here: a price in a comment goes stale too. */
@media (max-width: 420px) { .price { font-size: 25px; } }
.price .alt { display: block; font-size: 14px; font-weight: 500; color: var(--slate); letter-spacing: 0; }

button, .btn {
  display: block; width: 100%; padding: 15px 20px; border: 0; border-radius: var(--r);
  background: var(--stamp); color: var(--stamp-ink); font-size: 16px; font-weight: 700;
  cursor: pointer; text-align: center; text-decoration: none; font-family: inherit;
  letter-spacing: 0.01em;
}
button:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost {
  background: transparent; color: var(--slate); font-weight: 400; font-size: 14px;
  padding: 12px; border: 0; text-decoration: underline;
}
/* An inline action beside a value — the only pressable that is not the page's main move.
   The base rule is display:block/width:100%, so all of that has to be undone. */
.copy {
  display: inline-block; width: auto; flex: 0 0 auto; margin-left: 10px;
  padding: 8px 12px; font-size: 13px; font-weight: 600; min-height: 36px;
  background: var(--board); color: var(--ink); border: 1px solid var(--rule-strong);
  border-radius: var(--r);
}
.copy[data-done="1"] { background: var(--good); border-color: var(--good); color: var(--paper); }
.amountRow { display: flex; align-items: center; gap: 4px; }

/* The next-page link is the whole point of a sequenced funnel, so it is a real control. */
.next { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
.next .btn { width: auto; flex: 1 1 auto; }

label { display: block; font-size: 14px; font-weight: 700; margin: 0 0 6px; }
input[type=email], input[type=text], select {
  width: 100%; padding: 13px 14px; font-size: 16px; font-family: inherit;
  border: 1px solid var(--rule-strong); border-radius: var(--r);
  background: var(--paper); color: var(--ink);
}
input[type=email]:focus-visible, input[type=text]:focus-visible, select:focus-visible {
  outline: 2px solid var(--stamp); outline-offset: -1px;
}
/* :focus-visible and not :focus — a :focus rule here also matches the add-on checkboxes and
   paints an outline INSIDE the box the browser fills when checked, which is how a keyboard
   user loses track of where they are. */
a:focus-visible, button:focus-visible, .btn:focus-visible,
input[type=checkbox]:focus-visible, input[type=file]:focus-visible {
  outline: 3px solid var(--ink); outline-offset: 2px; border-radius: var(--r);
}

/* Announced, never shown. */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* Off-screen until tabbed to. */
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 10;
  background: var(--ink); color: var(--paper); padding: 12px 16px; text-decoration: none;
}
.skip:focus { left: 0; }

.opt { display: flex; gap: 12px; align-items: flex-start; padding: 14px 0; border-top: 1px solid var(--rule); }
.opt:first-of-type { border-top: 0; }
.opt input { margin: 3px 0 0; width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--stamp); }
/* Not scoped to .opt: library.html builds these inside a plain .card, and scoping them
   meant every item a paying customer had bought rendered as unstyled body text — on the
   one page the buyer actually keeps. `.p` stays scoped; its margin-left:auto only means
   something inside the flex row. */
.t { font-weight: 700; }
.s { font-size: 13px; color: var(--slate); }
.opt .p { margin-left: auto; font-weight: 700; white-space: nowrap; }
/* flex-basis:auto makes this column ask for max-content, and a wrapping flex container
   wraps BEFORE it shrinks — which puts the checkbox alone on the first line. */
.opt .txt { flex: 1 1 0; min-width: 0; }
.opt .v { margin-left: auto; padding-left: 12px; text-align: right; font-weight: 600; }
@media (max-width: 420px) {
  /* Only the tick-box rows — the order bump and the add-ons. A nowrap dual-currency price
     at 16px/700 takes nearly half a 375px screen and squeezes the product name into five
     lines; give the price its own line instead. Measured on a 375px viewport, not guessed.
     The payment page's rows are short and stay as they are. */
  #options .opt, #bumpCard .opt { flex-wrap: wrap; }
  #options .opt .p, #bumpCard .opt .p { flex: 0 0 100%; margin-left: 30px; margin-top: 4px; }
}

.total { display: flex; justify-content: space-between; align-items: baseline;
  padding: 16px 0 4px; border-top: 2px solid var(--ink); margin-top: 8px; }
.total b { font-size: 22px; }

.note {
  background: var(--paper); border: 1px solid var(--rule); border-left: 3px solid var(--stamp);
  padding: 12px 14px; font-size: 14px; color: var(--slate);
  border-radius: 0 var(--r) var(--r) 0; margin: 0 0 16px;
}
.err { border-left-color: var(--danger); color: var(--danger-ink);
  background: var(--danger-bg); border-color: var(--danger-line); }
[hidden] { display: none !important; }

/*
 * Lazy sections.
 *
 * `html.fold` is set by a one-line inline script in <head>, so with JavaScript off the
 * class is never added, this rule never applies and the whole page is present and
 * readable. With it on, everything past the first screen starts collapsed and is revealed
 * as the reader approaches it — the scrollbar reads short on arrival, which is the point,
 * without the content being conditional on a script.
 */
html.fold [data-fold] { display: none; }

footer { border-top: 1px solid var(--rule); margin-top: 48px; padding-top: 14px; font-size: 12px; color: var(--slate); }
footer b::after { content: var(--brand); }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media (min-width: 640px) { h1 { font-size: 37px; } .wrap { padding-top: 28px; } }
