/* Audit checkout — a Quiet Ledger transaction page, not a sales funnel. */

.checkout-body {
  min-height: 100vh;
  background: var(--bg);
}

.checkout-masthead .masthead-inner {
  min-height: 64px;
}

.checkout-masthead .wordmark,
.checkout-back {
  display: flex;
  align-items: center;
  min-height: 44px;
}

.checkout-back {
  color: var(--ink-muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.checkout-back:hover {
  color: var(--brand);
}

.checkout-main {
  padding: 72px 0 112px;
}

.checkout-intro {
  max-width: 760px;
  margin-bottom: 64px;
}

.checkout-intro .kicker {
  margin-bottom: 16px;
}

.checkout-intro h1 {
  max-width: 18ch;
  margin-bottom: 20px;
}

.checkout-intro .lead {
  max-width: 58ch;
  color: var(--ink-muted);
}

.checkout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, .8fr);
  grid-template-areas: "form summary";
  gap: 64px;
  align-items: start;
}

/* Gutenberg's generated `body .is-layout-flex` rule is more specific than
   `.checkout-grid`; keep the native Columns block on the transaction grid. */
.wp-block-columns.checkout-grid {
  display: grid;
}

.checkout-grid > section,
.checkout-grid > .checkout-form {
  grid-area: form;
}

.checkout-document {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: 3px;
}

.checkout-document-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.checkout-document-head h2 {
  font-size: 25px;
}

.checkout-document-head .factline {
  flex-shrink: 0;
  font-size: 11px;
}

.checkout-stage {
  padding: 40px 32px 48px;
}

.checkout-stage + .checkout-stage {
  border-top: 1px solid var(--border);
}

.stage-heading {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-bottom: 32px;
}

.stage-number {
  font-family: var(--font-numeric);
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: .08em;
  color: var(--ink-muted);
  padding-top: 5px;
}

.stage-heading h3 {
  font-size: 23px;
}

.stage-heading p {
  max-width: 58ch;
  margin-top: 8px;
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.55;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.form-field {
  min-width: 0;
}

.form-field--wide {
  grid-column: 1 / -1;
}

.form-label,
.form-legend {
  display: block;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .02em;
  margin-bottom: 8px;
}

.form-label .optional {
  color: var(--ink-muted);
  font-weight: 400;
}

.form-control {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid #81758F;
  border-radius: 3px;
  background: var(--surface-card);
  color: var(--ink);
  font: 400 16px/1.45 var(--font-body);
  letter-spacing: -0.008em;
  transition: border-color 180ms ease-out, box-shadow 180ms ease-out;
}

.form-control::placeholder {
  color: #6B637A;
}

.form-control:hover {
  border-color: #a99ebd;
}

.form-control:focus {
  border-color: var(--brand);
}

.form-control[aria-invalid="true"] {
  border-color: #8A3033;
}

.form-hint {
  margin-top: 7px;
  color: var(--ink-muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.field-error {
  margin-top: 7px;
  color: #8A3033;
  font-size: 12.5px;
  line-height: 1.45;
}

.field-error:empty {
  display: none;
}

.check-stack {
  display: grid;
  gap: 16px;
}

.check-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-height: 44px;
  padding: 8px 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
}

.check-row input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--brand);
}

.check-row a {
  font-weight: 500;
  text-underline-offset: 3px;
}

.agreement-block {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.agreement-version {
  margin-bottom: 18px;
  color: var(--ink-muted);
  font-family: var(--font-numeric);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.agreement-review {
  margin-bottom: 18px;
  padding: 10px 14px;
  background: var(--surface);
  color: var(--ink-muted);
  font-size: 13.5px;
  line-height: 1.5;
}

.agreement-review a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 500;
}

.agreement-review [hidden] {
  display: none;
}

.checkout-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 32px;
}

.checkout-action .note {
  max-width: 36ch;
}

.checkout-action .btn {
  flex-shrink: 0;
}

.btn[disabled] {
  cursor: not-allowed;
  opacity: .48;
}

.checkout-alert {
  padding: 18px 20px;
  border-left: 3px solid var(--brand);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
}

.checkout-alert--error {
  border-left-color: #8A3033;
  background: #F7EEEE;
}

.checkout-alert--success {
  border-left-color: var(--money);
  background: var(--guarantee-bg);
}

.checkout-alert[hidden] {
  display: none;
}

/* Employee count drives the fee; hide Simple Pay's band radios. */
.simpay-plan-select-container.is-driven-by-employee-count,
.simpay-plan-select-container[hidden] {
  display: none !important;
}

/* Form title lives in .checkout-document-head; hide the plugin duplicate. */
.simpay-embedded-heading.is-promoted-to-document-head,
.simpay-embedded-heading[hidden] {
  display: none !important;
}

.audit-over-capacity[hidden] {
  display: none;
}

.audit-over-capacity {
  margin-top: 16px;
}

/*
 * Quiet Ledger pay CTA — kill Stripe/Simple Pay's default blue "stripe-button-el"
 * treatment and match .btn.btn--primary.payment-submit.
 */
.simpay-checkout-form .simpay-checkout-btn-container {
  margin-top: 24px;
}

.simpay-checkout-form button.simpay-checkout-btn,
.simpay-checkout-form .simpay-btn.simpay-checkout-btn {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 14px 28px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: var(--brand);
  background-image: none;
  box-shadow: none;
  color: var(--paper-on-dark);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: normal;
  text-align: center;
  text-shadow: none;
  text-transform: none;
  cursor: pointer;
  transition: background-color 200ms ease-out, color 200ms ease-out, border-color 200ms ease-out, opacity 200ms ease-out;
}

.simpay-checkout-form button.simpay-checkout-btn:hover,
.simpay-checkout-form button.simpay-checkout-btn:focus,
.simpay-checkout-form .simpay-btn.simpay-checkout-btn:hover,
.simpay-checkout-form .simpay-btn.simpay-checkout-btn:focus {
  background: var(--brand-hover);
  background-image: none;
  box-shadow: none;
  color: var(--paper-on-dark);
  outline: none;
}

.simpay-checkout-form button.simpay-checkout-btn:disabled,
.simpay-checkout-form button.simpay-checkout-btn[aria-disabled="true"],
.simpay-checkout-form .simpay-btn.simpay-checkout-btn:disabled,
.simpay-checkout-form .simpay-btn.simpay-checkout-btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Stripe injects a nested <span> / <span class="simpay-pay-amount"> — keep flat. */
.simpay-checkout-form button.simpay-checkout-btn > span,
.simpay-checkout-form .simpay-btn.simpay-checkout-btn > span {
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
  color: inherit !important;
  font: inherit !important;
  text-shadow: none !important;
  padding: 0 !important;
  display: inline !important;
  height: auto !important;
  line-height: inherit !important;
}

.checkout-unavailable {
  margin-bottom: 32px;
}

.checkout-unavailable a {
  font-weight: 500;
}

.checkout-summary {
  grid-area: summary;
  position: sticky;
  top: 32px;
}

.summary-head {
  padding: 28px 28px 24px;
  border-bottom: 1px solid var(--border);
}

.summary-head .kicker {
  margin-bottom: 10px;
}

.summary-head h2 {
  font-size: 25px;
}

.summary-price {
  padding: 28px;
  border-bottom: 1px solid var(--border);
}

.summary-price .price {
  font-family: var(--font-numeric);
  font-size: 40px;
  font-weight: 500;
  line-height: 1;
  color: var(--money);
  font-variant-numeric: tabular-nums lining-nums;
}

.summary-price .price.is-range {
  font-size: 29px;
  letter-spacing: -.035em;
  white-space: nowrap;
}

.summary-price .price-note {
  margin-top: 10px;
  color: var(--ink-muted);
  font-size: 13px;
}

.summary-price .price-note.is-style-quiet-term {
  font-weight: 400;
  letter-spacing: -.008em;
  line-height: 1.62;
  text-transform: none;
}

.summary-price .price-reference {
  margin-top: 10px;
  color: var(--ink-muted);
  font-size: 13px;
}

.summary-price .price-reference[hidden] {
  display: none;
}

.summary-price .price-reference-amount {
  margin-left: 5px;
  color: var(--money);
  font-family: var(--font-numeric);
  font-variant-numeric: tabular-nums lining-nums;
}

.summary-price .price-reference.is-discounted .price-reference-amount {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.summary-price .price-reference:not([hidden]) + .price-note {
  margin-top: 6px;
}

.summary-lines {
  padding: 24px 28px 28px;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}

.summary-line:first-child {
  padding-top: 0;
}

.summary-line span:first-child {
  color: var(--ink-muted);
}

.summary-line span:last-child {
  text-align: right;
  font-weight: 500;
}

.summary-includes {
  /* Divider into this block comes from the last .summary-line border — don't double it. */
  padding: 8px 28px 28px;
}

.summary-includes .factline {
  margin: 8px 0 4px;
}

.summary-includes ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.summary-includes li {
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.45;
}

.summary-includes li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.summary-guarantee {
  margin: 0 28px 28px;
  padding: 18px 18px 18px 20px;
  border-left: 3px solid var(--money);
  background: var(--guarantee-bg);
}

.summary-guarantee .factline {
  color: var(--money);
  margin-bottom: 8px;
}

.summary-guarantee p:last-child {
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.45;
}

.summary-foot {
  padding: 0 28px 28px;
  color: var(--ink-muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.summary-foot p + p {
  margin-top: 8px;
}

.payment-stage[hidden] {
  display: none;
}

.payment-stage.is-loading .stripe-element-shell,
.payment-stage.is-loading .stripe-address-shell {
  opacity: .55;
  pointer-events: none;
}

.payment-total-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 20px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.payment-total-line span:first-child {
  color: var(--ink-muted);
  font-size: 14px;
}

.payment-total {
  color: var(--money);
  font-family: var(--font-numeric);
  font-size: 22px;
  font-weight: 500;
  font-variant-numeric: tabular-nums lining-nums;
}

.promotion-code {
  margin-bottom: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.promotion-code-heading {
  margin-bottom: 16px;
}

.promotion-code-heading .form-label {
  margin-bottom: 0;
}

.promotion-code-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.promotion-code-controls .btn {
  min-height: 48px;
}

.promotion-code-result {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-top: 8px;
  color: var(--money);
  font-size: 13px;
  line-height: 1.45;
}

.promotion-code-result.is-error {
  color: #8A3033;
}

.promotion-code-result[hidden] {
  display: none;
}

.promotion-code-result button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  flex-shrink: 0;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--brand);
  font: 500 13px/1.45 var(--font-body);
  text-decoration: underline;
  text-decoration-color: var(--highlight);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  cursor: pointer;
}

.promotion-code-result button:hover {
  text-decoration-color: var(--money);
}

.promotion-code-result button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.promotion-code-result button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.stripe-element-shell {
  min-height: 180px;
}

.stripe-address-shell {
  min-height: 240px;
  margin-top: 24px;
}

.payment-submit {
  width: 100%;
  margin-top: 24px;
  text-align: center;
}

.payment-security-note {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
  margin-top: 16px;
  color: var(--ink-muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.payment-security-note .fig {
  color: var(--ink-muted);
  font-size: 11px;
}

.checkout-complete {
  max-width: 760px;
  margin: 0 auto;
}

.complete-document {
  padding: 48px;
}

.complete-rule {
  width: 56px;
  border: 0;
  border-top: 3px solid var(--money);
  margin: 0 0 28px;
}

.complete-document .kicker {
  margin-bottom: 14px;
}

.complete-document h1 {
  max-width: 16ch;
  margin-bottom: 20px;
}

.complete-document .lead {
  max-width: 56ch;
  color: var(--ink-muted);
}

.complete-ledger {
  margin: 40px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.complete-ledger .summary-line {
  padding: 16px 0;
}

/* The booking grid needs far more room than this page's prose column, so the
   embed breaks out of the document padding and centres itself on the viewport. */
.scheduler-embed {
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  width: min(1180px, calc(100vw - 48px));
  margin: 0 0 28px;
  border: 1px solid var(--border);
  background: var(--surface-card);
}

.scheduler-embed iframe {
  display: block;
  width: 100%;
  height: 680px;
  border: 0;
}

.scheduler-embed[hidden] {
  display: none;
}

.complete-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.complete-actions[hidden],
.complete-state[hidden] {
  display: none;
}

.checkout-footer {
  padding-top: 40px;
  padding-bottom: 48px;
}

.checkout-footer .footer-inner {
  gap: 12px;
}

@media (max-width: 960px) {
  .checkout-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "summary"
      "form";
    gap: 40px;
  }

  .checkout-summary {
    position: static;
  }

  .summary-lines {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 24px;
  }
}

@media (max-width: 720px) {
  .checkout-main {
    padding: 56px 0 80px;
  }

  .checkout-intro {
    margin-bottom: 40px;
  }

  .checkout-intro h1 {
    font-size: 2.35rem;
  }

  .checkout-document-head,
  .checkout-stage,
  .summary-head,
  .summary-price,
  .summary-lines,
  .summary-foot {
    padding-left: 22px;
    padding-right: 22px;
  }

  .checkout-document-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .form-field--wide {
    grid-column: auto;
  }

  .checkout-action {
    align-items: stretch;
    flex-direction: column;
  }

  .checkout-action .btn {
    width: 100%;
    text-align: center;
  }

  .summary-lines {
    display: block;
  }

  .summary-guarantee {
    margin-left: 22px;
    margin-right: 22px;
  }

  .payment-security-note {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .promotion-code-controls {
    grid-template-columns: minmax(0, 1fr);
  }

  .promotion-code-controls .btn {
    width: 100%;
  }

  .complete-document {
    padding: 32px 22px 40px;
  }

  .scheduler-embed {
    width: calc(100vw - 32px);
  }

  .scheduler-embed iframe {
    height: 1000px;
  }

  .complete-actions .btn {
    width: 100%;
    text-align: center;
  }
}

@media print {
  .checkout-footer,
  .payment-stage,
  .checkout-action {
    display: none !important;
  }

  .checkout-grid {
    display: block;
  }

  .checkout-summary {
    margin-bottom: 32px;
  }
}
