

/*
 * /purchase — single 640px column. Three sections (LICENSES, ACCOUNT,
 * ORDER), each preceded by a hairline-rule eyebrow. Plain-text line
 * items, no card chrome around the form. Stepper is the one exception
 * (it's a control, not a container) — it keeps its own border.
 *
 * .purchase-shell width is forced to --container-form by the canonical
 * shell rule in app/shared/styles/global.css; the H1 is forced to the
 * canonical 48px page-title size by the .purchase-h1 rule there too.
 * This file owns only the per-section visual structure.
 */

.purchase-page .purchase-lede {
  margin: 0 0 var(--space-8) !important;
}

.purchase-section {
  margin-bottom: var(--space-8);
}
.purchase-section:last-of-type {
  margin-bottom: var(--space-6);
}

.purchase-section-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: var(--font-medium);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin: 0 0 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule-soft);
}

/* ─── Licenses row ─────────────────────────────────────────────── */

.purchase-licenses-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
/* Left side (label + hint) gets all the slack and is allowed to shrink;
   the stepper is fixed-size and must never be squeezed off the right
   edge on narrow viewports. */
.purchase-licenses-row > :first-child {
  flex: 1 1 auto;
  min-width: 0;
}
.purchase-licenses-row > .stepper {
  flex: 0 0 auto;
}

.purchase-licenses-label {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: var(--font-medium);
  color: var(--ink);
  margin: 0 0 0.25rem;
}
.purchase-licenses-hint {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  color: var(--ink-dim);
  margin: 0;
}

/* Stepper visual styling lives in app/shared/styles/stepper.css and is
   shared with /account/licenses. */

/* ─── Receipt (line items, no card) ────────────────────────────── */

.purchase-receipt {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
}
.purchase-receipt-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.375rem 0;
  color: var(--ink-soft);
  gap: 1rem;
}
.purchase-receipt-amount {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.purchase-receipt-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.75rem 0 0.125rem;
  border-top: 1px solid var(--rule);
  margin-top: 0.5rem;
  font-weight: var(--font-medium);
  color: var(--ink);
  gap: 1rem;
}

/* ─── Account ──────────────────────────────────────────────────── */

.purchase-acct-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.purchase-acct-name {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: var(--font-medium);
  color: var(--ink);
  margin: 0 0 0.125rem;
}
.purchase-acct-email {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  color: var(--ink-dim);
}
.purchase-acct-signout {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 3px;
}
.purchase-acct-signout:hover { text-decoration: underline; }

.purchase-acct-already {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  color: var(--ink-dim);
  margin: 0 0 1.25rem;
}
.purchase-acct-already a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ─── Order ────────────────────────────────────────────────────── */

.purchase-order-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--rule-soft);
  margin-bottom: 1.25rem;
}
.purchase-order-label {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: var(--font-medium);
  color: var(--ink);
  margin: 0 0 0.25rem;
}
.purchase-order-hint {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  color: var(--ink-dim);
  margin: 0;
  line-height: 1.5;
}

/* Terms checkbox row */
.purchase-terms {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  margin-bottom: 1rem;
}
.purchase-terms label {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  color: var(--ink-soft);
  line-height: 1.6;
  font-weight: var(--font-regular);
  cursor: pointer;
}
.purchase-terms label .purchase-terms-link {
  /* Force inline + reset every framework button chrome so the link
     flows as inline text inside the label. Without these resets the
     buttons render as 44px-tall inline-flex blocks, which inflates
     the label's line-height and visually splits the checkbox from
     the sentence. */
  display: inline;
  height: auto;
  line-height: inherit;
  gap: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: normal;
  cursor: pointer;
}
.purchase-terms label .purchase-terms-link:hover { color: var(--accent-deep); }
.purchase-terms label .purchase-terms-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Submit button — inherits .btn .btn-primary .btn-lg from
   @elements/style; this rule just stretches it to the column width
   and pins the spacing above/below. */
.purchase-submit {
  width: 100%;
  margin-top: 0.5rem;
}

/* Inline server error under the button. The "complete the form
   above to continue" hint was dropped per spec — disabled state on
   the button already reads as "not yet". */
.purchase-submit-error {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--red);
  margin: 0.5rem 0 0;
  text-align: center;
  line-height: 1.5;
}

.purchase-fine-print {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--ink-faint);
  margin: 0.625rem 0 0;
  line-height: 1.5;
  text-align: center;
}

/* ─── Mobile ───────────────────────────────────────────────────── */

@media (max-width: 700px) {
  .purchase-licenses-row,
  .purchase-order-row {
    /* Don't stack — keep label + control on one row even on narrow
       phones. Collapsing them ate vertical space without buying any
       legibility. */
    align-items: center;
  }
}
