@import "https://assets.elements.dev/assets/app/shared/styles/page.ff0dc0f91a65e37.css";
@import "https://assets.elements.dev/assets/app/shared/styles/stepper.ded13db313da5d0b.css";

/*
 * /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 sits in the wide marketing column (left edge aligns
 * with feed / install / learn) with its content capped at the form
 * width and left-aligned — both come from the shared shell rules in
 * app/shared/styles/site.css. The H1 / lede rules below match
 * the canonical page-hero scale (.page-hero-title / .page-hero-lede in
 * site.css). This file otherwise owns only the per-section visual
 * structure.
 */

/* Canonical top-level page h1 — 48px desktop, 40px on phones. */
.purchase-h1 {
  font-family: var(--font-sans);
  font-weight: var(--weight-bold);
  font-size: var(--page-title);
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--ink);
  margin: 2rem 0 var(--space-4);
}

@media (max-width: 640px) {
  .purchase-h1 {
    font-size: 2.5rem;
    line-height: 1.1;
    margin-top: 1.5rem;
  }
}

.purchase-page .purchase-lede {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  color: var(--ink-soft);
  line-height: 1.6;
  margin: 0 0 var(--space-8);
}

.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(--weight-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(--weight-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. */

/* ─── 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;
}
/* Each amount is a fixed-width cell: the + or = sits at its left edge, in
   one column, and the number at its right. */
.purchase-receipt-amount {
  display: inline-flex;
  justify-content: flex-end;
  min-width: 5.5rem;
}
.purchase-receipt-op {
  margin-right: auto;
  color: var(--ink-dim);
}
.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(--weight-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(--weight-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 { color: var(--link-hover); }

.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(--weight-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;
}

/* 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(--danger);
  margin: 0.5rem 0 0;
  text-align: center;
  line-height: 1.5;
}

/* ─── 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;
  }
}

.purchase-page .purchase-receipt-note {
  margin: var(--space-3) 0 0;
  font-size: 0.8125rem;
  color: var(--ink-dim);
}

.purchase-page .nowrap {
  white-space: nowrap;
}

/* Prose on the page reads at half the page's width, so lines stay short
   beside the stepper and the receipt amounts. */
.purchase-page .purchase-shell p,
.purchase-page .purchase-licenses-row > div:first-child {
  max-width: 50%;
}
.purchase-page .purchase-licenses-row p,
.purchase-page .purchase-shell .purchase-lede {
  max-width: none;
}
