/* ============================================================
   Customer payments portal (payments.mysleepeezee.com.au)
   Calm, brand-led, mobile-first. Tokens only.
   HIG: Clarity, Deference, Depth; Foundations > Layout, Typography.
   Trust comes from quiet competence — not green “SECURE” badges.
   ============================================================ */

.bc-pay-body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bc-bg-grouped);
  color: var(--bc-text-primary);
  font-family: 'Inter', var(--bc-font-text);
  font-optical-sizing: auto;
  font-feature-settings: "cv11", "ss01", "ss03";
  -webkit-font-smoothing: antialiased;
}

.bc-pay-body *,
.bc-pay-body *::before,
.bc-pay-body *::after {
  box-sizing: border-box;
}

/* Author `display` rules beat the UA [hidden] stylesheet. Keep hidden hidden. */
.bc-pay-body [hidden] {
  display: none !important;
}

.bc-vh {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------- header -------------------------------- */

.bc-pay-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bc-bg-elevated) 92%, transparent);
  border-bottom: 1px solid var(--bc-separator);
  backdrop-filter: saturate(180%) blur(var(--bc-space-4));
  -webkit-backdrop-filter: saturate(180%) blur(var(--bc-space-4));
  padding-top: env(safe-area-inset-top);
}

.bc-pay-header__inner {
  max-width: var(--bc-readable-max);
  margin: 0 auto;
  padding: var(--bc-space-3) var(--bc-space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--bc-space-3);
}

.bc-pay-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  min-height: var(--bc-control-h-lg, 44px);
}

.bc-pay-brand:focus-visible {
  outline: none;
  box-shadow: var(--bc-focus-ring);
  border-radius: var(--bc-radius-sm);
}

.bc-pay-brand__logo {
  display: block;
  height: var(--bc-space-8); /* 40px */
  width: auto;
  max-width: min(200px, 55vw);
}

/* Quiet padlock — secondary text colour, no green pill */
.bc-pay-secure {
  display: inline-flex;
  align-items: center;
  gap: var(--bc-space-1);
  color: var(--bc-text-secondary);
  font-size: var(--bc-text-footnote);
  font-weight: var(--bc-weight-medium);
  white-space: nowrap;
  line-height: 1;
}

.bc-pay-secure__icon {
  display: block;
  width: var(--bc-space-4);
  height: var(--bc-space-4);
  flex-shrink: 0;
  color: var(--bc-text-secondary);
}

.bc-pay-secure__label {
  letter-spacing: 0;
}

/* -------------------------------- shell -------------------------------- */

.bc-pay-shell {
  flex: 1;
  width: 100%;
  max-width: var(--bc-readable-max);
  margin: 0 auto;
  padding: var(--bc-space-6) var(--bc-space-4) var(--bc-space-8);
  padding-left: max(var(--bc-space-4), env(safe-area-inset-left));
  padding-right: max(var(--bc-space-4), env(safe-area-inset-right));
}

/* Verify is a single short task — keep the card at a glanceable width. */
.bc-pay-shell--compact {
  max-width: calc(var(--bc-space-10) * 7); /* 448 */
}

.bc-pay-panel {
  background: var(--bc-bg-elevated);
  border: 1px solid var(--bc-separator);
  border-radius: var(--bc-radius-xl);
  padding: var(--bc-space-6) var(--bc-space-5);
  box-shadow: var(--bc-shadow-1);
}

.bc-pay-eyebrow {
  margin: 0 0 var(--bc-space-2);
  font-size: var(--bc-text-footnote);
  font-weight: var(--bc-weight-medium);
  color: var(--bc-text-secondary);
}

.bc-pay-title {
  margin: 0 0 var(--bc-space-3);
  font-family: Inter, var(--bc-font-display);
  font-size: var(--bc-text-title-2);
  font-weight: var(--bc-weight-bold);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.bc-pay-lede {
  margin: 0 0 var(--bc-space-5);
  font-size: var(--bc-text-body);
  color: var(--bc-text-primary);
  line-height: 1.45;
}

.bc-pay-panel--request .bc-pay-title {
  margin-bottom: 0;
}

.bc-pay-panel--request .bc-pay-lede {
  margin-top: var(--bc-space-5);
  color: var(--bc-text-secondary);
}

.bc-pay-help {
  margin: 0;
  font-size: var(--bc-text-subhead);
  color: var(--bc-text-secondary);
  line-height: 1.45;
}

.bc-pay-help a,
.bc-pay-security-note a,
.bc-pay-footer a {
  color: var(--bc-accent);
  text-decoration: none;
}

.bc-pay-help a:hover,
.bc-pay-security-note a:hover,
.bc-pay-footer a:hover {
  text-decoration: underline;
}

/* ---------------------------- claim summary ---------------------------- */

.bc-pay-summary {
  display: grid;
  gap: var(--bc-space-3);
  margin: 0 0 var(--bc-space-5);
  padding: var(--bc-space-4) 0;
  border-top: 1px solid var(--bc-separator);
  border-bottom: 1px solid var(--bc-separator);
  background: transparent;
}

.bc-pay-summary__row {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: var(--bc-space-3);
  align-items: start;
}

.bc-pay-summary__label {
  font-size: var(--bc-text-footnote);
  font-weight: var(--bc-weight-medium);
  color: var(--bc-text-secondary);
  padding-top: 0.15em;
}

.bc-pay-summary__value {
  font-size: var(--bc-text-callout);
  font-weight: var(--bc-weight-medium);
  color: var(--bc-text-primary);
  word-break: break-word;
}

.bc-pay-summary__value--emphasis {
  font-size: var(--bc-text-title-3);
  font-weight: var(--bc-weight-bold);
  font-variant-numeric: tabular-nums;
}

/* ------------------------------ OTP verify ----------------------------- */
/* HIG: progressive disclosure — request, then enter. One primary action. */

.bc-pay-facts {
  margin: 0 0 var(--bc-space-6);
  padding: 0;
  background: var(--bc-bg-subtle);
  border: 1px solid var(--bc-separator);
  border-radius: var(--bc-radius-lg);
  overflow: hidden;
}

.bc-pay-facts__row {
  display: flex;
  flex-direction: column;
  gap: var(--bc-space-1);
  padding: var(--bc-space-4);
}

.bc-pay-facts__row + .bc-pay-facts__row {
  border-top: 1px solid var(--bc-separator);
}

.bc-pay-facts dt {
  margin: 0;
  font-size: var(--bc-text-caption-1);
  font-weight: var(--bc-weight-medium);
  color: var(--bc-text-secondary);
}

.bc-pay-facts dd {
  margin: 0;
  font-size: var(--bc-text-callout);
  font-weight: var(--bc-weight-semibold);
  color: var(--bc-text-primary);
  font-variant-numeric: tabular-nums;
  word-break: break-word;
}

.bc-pay-facts__phone {
  font-size: var(--bc-text-title-3);
  letter-spacing: 0.04em;
}

.bc-pay-verify-step {
  display: grid;
  gap: var(--bc-space-4);
}

.bc-pay-otp {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--bc-space-3);
}

.bc-pay-otp__track {
  position: relative;
  width: 100%;
  max-width: calc((var(--bc-space-10) + var(--bc-space-2)) * 6);
  cursor: text;
}

.bc-pay-otp__cells {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--bc-space-2);
  pointer-events: none;
}

.bc-pay-otp__cell {
  display: grid;
  place-items: center;
  min-height: var(--bc-space-10);
  border: 1px solid var(--bc-border-field);
  border-radius: var(--bc-radius-md);
  background: var(--bc-bg-elevated);
  font-family: Inter, var(--bc-font-display);
  font-size: var(--bc-text-title-2);
  font-weight: var(--bc-weight-semibold);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--bc-text-primary);
  transition:
    border-color var(--bc-duration-fast) var(--bc-ease-standard),
    box-shadow var(--bc-duration-fast) var(--bc-ease-standard),
    background-color var(--bc-duration-fast) var(--bc-ease-standard);
}

.bc-pay-otp__cell.is-filled {
  background: var(--bc-bg-subtle);
}

.bc-pay-otp__cell.is-active {
  border-color: var(--bc-accent);
  box-shadow: var(--bc-focus-ring);
}

.bc-pay-otp--invalid .bc-pay-otp__cell {
  border-color: var(--bc-destructive);
}

.bc-pay-otp--invalid .bc-pay-otp__cell.is-active {
  box-shadow: var(--bc-focus-ring-danger);
}

.bc-pay-otp__native {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  border: 0;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  font-size: var(--bc-text-title-2); /* ≥16px — iOS will not zoom */
  letter-spacing: 0;
  cursor: text;
}

.bc-pay-otp__native:focus {
  outline: none;
}

.bc-pay-otp__help {
  margin: 0;
  font-size: var(--bc-text-footnote);
  color: var(--bc-text-secondary);
  text-align: center;
  line-height: 1.4;
}

.bc-pay-actions {
  display: grid;
  gap: var(--bc-space-3);
  margin-top: var(--bc-space-4);
}

/* ---------------------------- amount + receipt ------------------------- */

.bc-pay-amount {
  margin: var(--bc-space-4) 0 0;
  font-family: Inter, var(--bc-font-display);
  font-size: var(--bc-text-large-title);
  font-weight: var(--bc-weight-bold);
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.bc-pay-amount__gst {
  margin: var(--bc-space-1) 0 0;
  font-size: var(--bc-text-footnote);
  color: var(--bc-text-secondary);
}

.bc-pay-section-title {
  margin: 0 0 var(--bc-space-3);
  font-size: var(--bc-text-headline);
  font-weight: var(--bc-weight-semibold);
}

.bc-pay-items {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}

.bc-pay-items td {
  padding: var(--bc-space-3) 0;
  border-bottom: 1px solid var(--bc-separator);
  font-size: var(--bc-text-callout);
  vertical-align: top;
}

.bc-pay-items tbody tr:first-child td {
  padding-top: var(--bc-space-4);
}

.bc-pay-items__note {
  display: block;
  font-size: var(--bc-text-footnote);
  color: var(--bc-text-secondary);
  margin-top: var(--bc-space-1);
}

.bc-pay-items__amount {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  padding-left: var(--bc-space-4);
}

.bc-pay-items tfoot td {
  border-bottom: none;
  padding-top: var(--bc-space-3);
  font-weight: var(--bc-weight-semibold);
  font-size: var(--bc-text-callout);
}

.bc-pay-items__gst {
  display: block;
  font-size: var(--bc-text-footnote);
  font-weight: var(--bc-weight-regular);
  color: var(--bc-text-secondary);
}

.bc-pay-items__total {
  font-size: var(--bc-text-title-3);
  font-variant-numeric: tabular-nums;
}

.bc-pay-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--bc-space-1) var(--bc-space-3);
  margin: 0 0 var(--bc-space-6);
  padding-top: var(--bc-space-4);
  font-size: var(--bc-text-footnote);
  color: var(--bc-text-secondary);
  line-height: 1.4;
}

/* --------------------------- repair authorisation ---------------------- */

.bc-pay-consent {
  margin: 0 0 var(--bc-space-6);
  padding: 0;
  background: transparent;
}

.bc-pay-consent__title {
  margin: 0 0 var(--bc-space-2);
  font-size: var(--bc-text-headline);
  font-weight: var(--bc-weight-semibold);
}

.bc-pay-terms {
  margin: 0 0 var(--bc-space-3);
}

.bc-pay-terms__summary {
  display: flex;
  align-items: center;
  min-height: var(--bc-control-h-lg);
  cursor: pointer;
  list-style: none;
  font-size: var(--bc-text-subhead);
  font-weight: var(--bc-weight-medium);
  color: var(--bc-accent);
}

.bc-pay-terms__summary::-webkit-details-marker {
  display: none;
}

.bc-pay-terms__summary:focus-visible {
  outline: none;
  box-shadow: var(--bc-focus-ring);
  border-radius: var(--bc-radius-sm);
}

.bc-pay-terms__body,
.bc-pay-consent__body {
  margin: 0 0 var(--bc-space-3);
  padding: var(--bc-space-3);
  max-height: calc(var(--bc-space-10) * 4);
  overflow: auto;
  font-size: var(--bc-text-footnote);
  line-height: 1.45;
  color: var(--bc-text-secondary);
  background: var(--bc-bg-subtle);
  border: 1px solid var(--bc-separator);
  border-radius: var(--bc-radius-sm);
  -webkit-overflow-scrolling: touch;
}

.bc-pay-terms__body:focus-visible,
.bc-pay-consent__body:focus-visible {
  outline: none;
  box-shadow: var(--bc-focus-ring);
}

.bc-pay-consent__check {
  display: flex;
  gap: var(--bc-space-3);
  align-items: flex-start;
  font-size: var(--bc-text-callout);
  cursor: pointer;
}

.bc-pay-consent__check input[type="checkbox"] {
  width: var(--bc-space-6);
  height: var(--bc-space-6);
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--bc-accent);
}

.bc-pay-consent__check input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: var(--bc-focus-ring);
  border-radius: var(--bc-radius-xs);
}

.bc-pay-consent__done {
  display: block;
  font-style: normal;
  margin-top: var(--bc-space-2);
  font-size: var(--bc-text-footnote);
  color: var(--bc-success);
}

/* ------------------------------ pay button ----------------------------- */

.bc-pay-cta {
  display: grid;
  gap: var(--bc-space-3);
}

.bc-pay-wallets {
  text-align: center;
  margin: 0;
  font-size: var(--bc-text-footnote);
  color: var(--bc-text-tertiary);
}

.bc-pay-trust {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: var(--bc-space-2);
  margin: 0;
  padding: var(--bc-space-3) var(--bc-space-2);
  font-size: var(--bc-text-footnote);
  color: var(--bc-text-secondary);
  line-height: 1.4;
  text-align: left;
}

.bc-pay-trust__icon {
  width: var(--bc-space-4);
  height: var(--bc-space-4);
  flex-shrink: 0;
  margin-top: 0.1em;
  color: var(--bc-text-secondary);
}

.bc-pay-security-note {
  margin: var(--bc-space-5) 0 0;
  font-size: var(--bc-text-footnote);
  color: var(--bc-text-secondary);
  line-height: 1.45;
}

/* -------------------------------- alerts ------------------------------- */

.bc-pay-alert {
  margin: 0 0 var(--bc-space-4);
  padding: var(--bc-space-3) var(--bc-space-4);
  border-radius: var(--bc-radius-md);
  font-size: var(--bc-text-subhead);
  background: color-mix(in srgb, var(--bc-info) 12%, transparent);
  color: var(--bc-text-primary);
  border: 1px solid color-mix(in srgb, var(--bc-info) 30%, transparent);
}

.bc-pay-alert--error {
  background: color-mix(in srgb, var(--bc-destructive) 12%, transparent);
  border-color: color-mix(in srgb, var(--bc-destructive) 30%, transparent);
}

.bc-pay-alert--success {
  background: color-mix(in srgb, var(--bc-success) 12%, transparent);
  border-color: color-mix(in srgb, var(--bc-success) 30%, transparent);
}

/* --------------------------- status / empty ---------------------------- */

.bc-pay-status-icon {
  width: var(--bc-space-9);
  height: var(--bc-space-9);
  border-radius: var(--bc-radius-pill);
  display: grid;
  place-items: center;
  margin: 0 0 var(--bc-space-4);
  font-size: var(--bc-text-title-3);
  font-weight: var(--bc-weight-semibold);
  background: var(--bc-bg-subtle);
  color: var(--bc-text-secondary);
  border: 1px solid var(--bc-separator);
}

.bc-pay-status-icon--ok {
  background: color-mix(in srgb, var(--bc-success) 12%, transparent);
  color: var(--bc-success);
  border-color: color-mix(in srgb, var(--bc-success) 28%, transparent);
}

.bc-pay-status-icon--warn {
  background: color-mix(in srgb, var(--bc-warning) 12%, transparent);
  color: var(--bc-warning);
  border-color: color-mix(in srgb, var(--bc-warning) 28%, transparent);
}

.bc-pay-status-icon--bad {
  background: color-mix(in srgb, var(--bc-destructive) 12%, transparent);
  color: var(--bc-destructive);
  border-color: color-mix(in srgb, var(--bc-destructive) 28%, transparent);
}

/* -------------------------------- footer ------------------------------- */

.bc-pay-footer {
  padding: var(--bc-space-6) var(--bc-space-4);
  padding-bottom: max(var(--bc-space-6), env(safe-area-inset-bottom));
  text-align: center;
  font-size: var(--bc-text-footnote);
  color: var(--bc-text-tertiary);
  border-top: 1px solid var(--bc-separator);
  background: var(--bc-bg-elevated);
}

.bc-pay-footer__logo {
  display: block;
  height: var(--bc-space-6);
  width: auto;
  margin: 0 auto var(--bc-space-3);
  opacity: 0.85;
}

.bc-pay-footer p {
  margin: 0 0 var(--bc-space-1);
}

.bc-pay-footer__trust {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--bc-space-1);
  margin-top: var(--bc-space-3);
  color: var(--bc-text-tertiary);
}

.bc-pay-footer__lock {
  width: var(--bc-space-3);
  height: var(--bc-space-3);
  flex-shrink: 0;
  color: var(--bc-text-tertiary);
}

/* ------------------------------- desktop ------------------------------- */

@media (min-width: 640px) {
  .bc-pay-shell {
    padding-top: var(--bc-space-8);
  }

  .bc-pay-panel {
    padding: var(--bc-space-8) var(--bc-space-7);
  }

  .bc-pay-brand__logo {
    height: calc(var(--bc-space-8) + var(--bc-space-1));
  }

  .bc-pay-summary__row {
    grid-template-columns: 8.5rem 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bc-pay-header {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--bc-bg-elevated);
  }
}
