/*
 * pay.refract.group
 *
 * The brand values below are copied from the refract-website repo and keep their
 * names there, so a change on the main site can be found here by searching for
 * the same token:
 *
 *   app/assets/css/main.css     @font-face, --color-ink, --color-blue-900,
 *                               --font-sans, --font-mono, --rail, --radius-sm,
 *                               .chip, .sr-only
 *   app/assets/css/tokens.css   the type ramp (.t-*), inks, surfaces, rules,
 *                               radii, spacing, .link
 *   SiteNavPill.vue             the lockup (mark + wordmark) at the top
 *   SiteFooter.vue              the footer lockup, the navy ground, the
 *                               primary button (.footer__ctaBtn)
 *   ContactDialog.vue           the focus ring (2px blue-900)
 */

/* ── Faces (main.css) ─────────────────────────────────────────────────── */

@font-face {
  font-family: 'PP Neue Montreal';
  src: url('/fonts/PPNeueMontreal-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'PP Neue Montreal';
  src: url('/fonts/PPNeueMontreal-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Fragment Mono';
  src: url('/fonts/FragmentMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ── Tokens ───────────────────────────────────────────────────────────── */

:root {
  color-scheme: light;

  /* main.css */
  --color-blue-900: #1008e8;
  --color-white: #ffffff;
  --color-ink: #232323;
  --radius-sm: 4px;
  --rail: 20px;
  --font-sans: 'PP Neue Montreal', 'Helvetica Neue', Helvetica, Inter, ui-sans-serif, system-ui,
    -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-mono: 'Fragment Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* tokens.css: type, only the roles this page sets */
  --type-display-m: clamp(28px, 2.5vw, 60px);
  --leading-display-m: 0.98;
  --tracking-display-m: -0.025em;
  --type-display-s: clamp(24px, 1.5625vw, 36px);
  --leading-display-s: 1.1;
  --tracking-display-s: -0.02em;
  --type-heading-s: 18px;
  --leading-heading-s: 1.3;
  --tracking-heading-s: -0.015em;
  --type-body-l: 18px;
  --leading-body-l: 1.5;
  --tracking-body-l: -0.01em;
  --type-body-m: 16px;
  --leading-body-m: 1.55;
  --tracking-body-m: -0.01em;
  --type-body-s: 14px;
  --leading-body-s: 1.45;
  --tracking-body-s: -0.01em;
  --type-caption: 12px;
  --leading-caption: 1.3;
  --tracking-caption: 0;
  --type-label-m: 13px;
  --leading-label-m: 1.2;
  --tracking-label-m: 0.02em;
  --type-label-s: 11px;
  --leading-label-s: 1.2;
  --tracking-label-s: 0.02em;
  --type-control-label: 12px;
  --leading-control-label: 1.35;
  --tracking-control-label: -0.02em;

  /* tokens.css: colour */
  --color-ink-secondary: #5f5f5f;
  --color-ink-tertiary: #737373;
  --color-surface-sunken: #f5f5f5;
  --color-surface-plate: #ececee;
  --color-ground: #04022a;
  --line-hairline: rgba(35, 35, 35, 0.14);
  --line-hairline-soft: rgba(35, 35, 35, 0.09);
  --line-strong: rgba(35, 35, 35, 0.28);

  /* tokens.css: space and radius */
  --space-4: 4px;
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;
  --space-32: 32px;
  --space-40: 40px;
  --space-48: 48px;
  --space-64: 64px;
  --section-gap: clamp(64px, 6.25vw, 120px);
  --radius-xs: 2px;
  --radius-md: 8px;
  --radius-pill: 999px;

  /* The site's UI ease (.link, the footer button). */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  /*
   * This page's column, and the one value here that is not a site token. The
   * main site centres reading surfaces on --measure (854px); a payment card
   * wants each value close to its copy button, so this page centres on 560.
   */
  --column: 560px;
}

/* ── Base (main.css) ──────────────────────────────────────────────────── */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--color-white);
  color: var(--color-ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
  color: inherit;
}

/* The attribute has to beat the display values set on classes below. */
[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ── Type classes (tokens.css, verbatim for the roles used) ───────────── */

.t-display-m,
.t-display-s,
.t-heading-s,
.t-body-l,
.t-body-m,
.t-body-s,
.t-caption {
  font-family: var(--font-sans);
}

.t-label-m,
.t-label-s,
.t-control-label,
.t-numeral {
  font-family: var(--font-mono);
}

.t-label-m,
.t-label-s,
.t-control-label {
  text-transform: uppercase;
}

.t-numeral {
  font-weight: 400;
  letter-spacing: var(--tracking-label-m);
  font-variant-numeric: tabular-nums lining-nums;
  white-space: nowrap;
}

.t-display-m {
  font-size: var(--type-display-m);
  line-height: var(--leading-display-m);
  letter-spacing: var(--tracking-display-m);
  font-weight: 500;
}

.t-display-s {
  font-size: var(--type-display-s);
  line-height: var(--leading-display-s);
  letter-spacing: var(--tracking-display-s);
  font-weight: 500;
}

.t-heading-s {
  font-size: var(--type-heading-s);
  line-height: var(--leading-heading-s);
  letter-spacing: var(--tracking-heading-s);
  font-weight: 500;
}

.t-body-l {
  font-size: var(--type-body-l);
  line-height: var(--leading-body-l);
  letter-spacing: var(--tracking-body-l);
  font-weight: 400;
}

.t-body-m {
  font-size: var(--type-body-m);
  line-height: var(--leading-body-m);
  letter-spacing: var(--tracking-body-m);
  font-weight: 400;
}

.t-body-s {
  font-size: var(--type-body-s);
  line-height: var(--leading-body-s);
  letter-spacing: var(--tracking-body-s);
  font-weight: 400;
}

.t-caption {
  font-size: var(--type-caption);
  line-height: var(--leading-caption);
  letter-spacing: var(--tracking-caption);
  font-weight: 400;
}

.t-label-m {
  font-size: var(--type-label-m);
  line-height: var(--leading-label-m);
  letter-spacing: var(--tracking-label-m);
  font-weight: 400;
}

.t-label-s {
  font-size: var(--type-label-s);
  line-height: var(--leading-label-s);
  letter-spacing: var(--tracking-label-s);
  font-weight: 400;
}

.t-control-label {
  font-size: var(--type-control-label);
  line-height: var(--leading-control-label);
  letter-spacing: var(--tracking-control-label);
  font-weight: 400;
}

/* ── Objects (tokens.css .link, main.css .chip) ───────────────────────── */

.link {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, currentColor 38%, transparent);
  transition: text-decoration-color 220ms var(--ease);
}

.link:hover,
.link:focus-visible {
  text-decoration-color: currentColor;
}

.link:focus-visible {
  outline: 2px solid var(--color-blue-900);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

.chip {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 2px;
  background: var(--chip-bg, #ececee);
  color: var(--chip-ink, #5f5f5f);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.5px;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ── Page frame ───────────────────────────────────────────────────────── */

.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.masthead,
.pay,
.footer__inner {
  width: min(100% - 2 * var(--rail), var(--column));
  margin-inline: auto;
}

.masthead {
  padding-top: var(--space-24);
}

.pay {
  flex: 1;
  padding-block: var(--section-gap) var(--space-64);
}

/* The lockup as SiteNavPill draws it: a 17.355 x 15.1925 mark beside a 22.204px word. */
.lockup {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  color: var(--color-ink);
}

.lockup__mark {
  display: block;
  width: 17.355px;
  height: 15.1925px;
}

.lockup__word {
  font-size: 22.204px;
  font-weight: 500;
  letter-spacing: -0.6661px;
  line-height: 22.204px;
}

/* The footer's lockup: SiteFooter sets the mark at 1.124x beside a 25px word. */
.lockup--footer {
  gap: 7px;
  color: var(--color-white);
}

.lockup--footer .lockup__mark {
  width: 19.51px;
  height: 17.08px;
}

.lockup--footer .lockup__word {
  font-size: 25px;
  letter-spacing: -0.37px;
  line-height: 1;
}

/* ── Heading ──────────────────────────────────────────────────────────── */

.pay__title {
  margin: 0;
}

.pay__lede {
  margin: var(--space-8) 0 0;
  color: var(--color-ink-secondary);
}

/* ── Fields: a mono key over a value, with its copy button on the value's line ── */

.field {
  margin: 0;
}

.field__label {
  display: block;
  margin: 0 0 var(--space-8);
  color: var(--color-ink-tertiary);
}

.field__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-8) var(--space-16);
  margin: 0;
}

.field__value {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* A figure in the mono, at Body/L: tokens.css composes .t-numeral with the
   size of the step it sits at. */
.field__value--figure {
  font-size: var(--type-body-l);
  line-height: var(--leading-body-l);
}

/*
 * The invoice number is the one figure whose length the link decides (up to 30
 * characters). .t-numeral keeps a figure on one line; on a narrow phone a long
 * reference may break instead of pushing the page sideways.
 */
.field__value--wrap {
  white-space: normal;
  overflow-wrap: anywhere;
}

/* BSB 067 873: one space's width in the mono, drawn rather than typed. */
.field__group {
  margin-left: 1ch;
}

.field__hint {
  margin: var(--space-8) 0 0;
  color: var(--color-ink-secondary);
}

/* ── The invoice plate ────────────────────────────────────────────────── */

.summary {
  margin-top: var(--space-32);
  padding: var(--space-20);
  border-radius: var(--radius-md);
  background: var(--color-surface-sunken);
}

.summary__list {
  margin: 0;
}

/* Secondary rather than tertiary ink here: #737373 on the sunken plate is
   4.35:1, just under AA for 13px type; #5f5f5f is 5.9:1. */
.summary .field__label {
  color: var(--color-ink-secondary);
}

.summary .field:not([hidden]) ~ .field:not([hidden]) {
  margin-top: var(--space-20);
  padding-top: var(--space-20);
  border-top: 1px solid var(--line-hairline);
}

/* ── Bank details ─────────────────────────────────────────────────────── */

.bank {
  margin-top: var(--space-48);
}

.bank__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-12) var(--space-16);
  min-height: 36px;
}

.bank__title {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  margin: 0;
}

.bank__hint {
  margin: var(--space-4) 0 0;
  color: var(--color-ink-secondary);
}

.account {
  margin-top: var(--space-16);
  border-top: 1px solid var(--line-hairline);
}

/*
 * Without app.js (JavaScript off, or a script that failed to load) the page
 * lists both accounts under these titles and drops the copy buttons, which
 * need the script. app.js adds `.js` to <html> once it has picked an account.
 */
.account__title {
  margin: 0;
  padding-top: var(--space-16);
  color: var(--color-ink-tertiary);
}

html:not(.js) .account + .account {
  margin-top: var(--space-32);
}

html:not(.js) .copy,
html:not(.js) .copy-all,
.js .account__title {
  display: none;
}

.fields {
  margin: 0;
}

.fields .field {
  padding-block: var(--space-16);
  border-bottom: 1px solid var(--line-hairline-soft);
}

.account__note {
  display: flex;
  align-items: flex-start;
  gap: var(--space-8);
  margin: var(--space-16) 0 0;
  color: var(--color-ink-secondary);
}

.account__note svg {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 2px;
}

/* ── Currency choice: a segmented control, Figma's control label ──────── */

.currency {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.currency__track {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: var(--radius-pill);
  background: var(--color-surface-plate);
}

.currency__option {
  position: relative;
  display: block;
  cursor: pointer;
}

.currency__option input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.currency__text {
  display: block;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  color: var(--color-ink-secondary);
  transition: background-color 220ms var(--ease), color 220ms var(--ease);
}

.currency__option input:checked + .currency__text {
  background: var(--color-white);
  color: var(--color-ink);
  box-shadow: 0 1px 2px rgba(35, 35, 35, 0.12);
}

.currency__option input:focus-visible + .currency__text {
  outline: 2px solid var(--color-blue-900);
  outline-offset: 2px;
}

/* ── Copy buttons ─────────────────────────────────────────────────────── */

.copy {
  position: relative;
  flex: none;
  display: inline-grid;
  align-items: center;
  justify-items: center;
  height: 32px;
  min-width: 82px;
  padding: 0 var(--space-12);
  border: 1px solid var(--line-hairline);
  border-radius: var(--radius-sm);
  background: var(--color-white);
  color: var(--color-ink);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  /* Keep "COPY" out of a hand selection of the values around it. */
  -webkit-user-select: none;
  user-select: none;
  transition: border-color 220ms var(--ease), color 220ms var(--ease);
}

/* A 44px target around a 32px button. */
.copy::before {
  content: '';
  position: absolute;
  inset: -6px -4px;
}

.copy:hover {
  border-color: var(--line-strong);
}

.copy:focus-visible {
  outline: 2px solid var(--color-blue-900);
  outline-offset: 2px;
}

/* "Copy" and "Copied" share one cell, so the button never changes width. */
.copy__idle,
.copy__done {
  grid-area: 1 / 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.copy__done {
  visibility: hidden;
}

.is-copied .copy__idle {
  visibility: hidden;
}

.is-copied .copy__done {
  visibility: visible;
}

/* Blue means a thing you pressed: the receipt takes the brand blue. */
.copy.is-copied {
  border-color: var(--color-blue-900);
  color: var(--color-blue-900);
}

.copy svg,
.button svg {
  display: block;
  flex: none;
  width: 12px;
  height: 12px;
}

/* The primary button: SiteFooter's .footer__ctaBtn, ContactDialog's .contact__send. */
.button {
  display: inline-grid;
  align-items: center;
  justify-items: center;
  height: 40px;
  padding-inline: 16px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--color-blue-900);
  color: var(--color-white);
  font-family: inherit;
  font-size: var(--type-body-m);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: filter 220ms var(--ease), transform 220ms var(--ease);
}

.button:hover,
.button:focus-visible {
  filter: brightness(1.08);
}

.button:active {
  transform: translateY(1px);
}

.button:focus-visible {
  outline: 2px solid var(--color-blue-900);
  outline-offset: 3px;
}

.button .copy__idle,
.button .copy__done {
  gap: var(--space-8);
}

.copy-all {
  width: 100%;
  margin-top: var(--space-24);
}

/* ── After paying ─────────────────────────────────────────────────────── */

.remit {
  margin: var(--space-40) 0 0;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: var(--space-12);
  margin-top: var(--space-20);
  padding: var(--space-16);
  border-radius: var(--radius-md);
  background: var(--color-surface-sunken);
}

.notice__icon {
  flex: none;
  width: 20px;
  height: 20px;
}

.notice p {
  margin: 0;
}

.help {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-8) var(--space-16);
  margin: var(--space-48) 0 0;
  padding: var(--space-16) var(--space-20);
  border: 1px solid var(--line-hairline);
  border-radius: var(--radius-md);
}

/* ── Footer: the site's navy ground ───────────────────────────────────── */

.footer {
  background: var(--color-ground);
  color: var(--color-white);
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16) var(--space-24);
  padding-block: var(--space-32) calc(var(--space-32) + env(safe-area-inset-bottom, 0px));
}

.footer__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8) var(--space-20);
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer__link {
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  transition: color 220ms var(--ease);
}

.footer__link:hover,
.footer__link:focus-visible {
  color: var(--color-white);
}

.footer__link:focus-visible {
  outline: 2px solid var(--color-white);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

.footer__legal {
  flex-basis: 100%;
  margin: 0;
  color: rgba(255, 255, 255, 0.5);
}

/* The off-screen textarea app.js copies through where the Clipboard API is missing. */
.copy-buffer {
  position: fixed;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  font-size: 16px;
  pointer-events: none;
}

/* ── Wider screens ────────────────────────────────────────────────────── */

@media (min-width: 600px) {
  .masthead {
    padding-top: var(--space-32);
  }

  .copy-all {
    width: auto;
  }
}

@media (pointer: coarse) {
  .button {
    height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .copy,
  .copy-all,
  .currency,
  .bank__hint,
  .help,
  .footer {
    display: none !important;
  }

  .summary {
    border: 1px solid var(--line-hairline);
    background: none;
  }
}
