/* Buy page. The order status uses the download page's poster (download.css);
   the order form is its own one-screen page: a small header, then two columns
   (plans + QR | details), no scrolling on a computer (the user, 2026-10-28). */
html:has(.buy-body) { height: auto; overflow: auto; }
.buy-body { min-height: 100vh; min-height: 100dvh; display: flex; }
.buy-page {
  width: 100%;
  max-width: 1080px;
  margin: auto;
  padding: clamp(14px, 4vh, 44px) clamp(16px, 4vw, 40px);
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 3.6vh, 36px);
}
.buy-top { display: flex; align-items: center; justify-content: center; gap: 16px;
           padding-bottom: clamp(10px, 3vh, 28px); }
.buy-top .tile { width: clamp(44px, 7.5vh, 64px); height: auto; border-radius: 12px; flex: none; }
.buy-top h1 { margin: 0; font-size: clamp(1.6rem, 5.4vh, 2.6rem); }
.buy-top .lede { margin: 4px 0 0; font-size: 17px; }

form.buy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
}
form.buy .col:first-child { padding-right: clamp(24px, 4vw, 52px); }
form.buy .col.fields { padding-left: clamp(24px, 4vw, 52px); border-left: 1px solid var(--rule); }
form.buy .note { margin-top: 14px; }

fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend, .step-title {
  display: block;
  margin: 0 0 10px;
  padding: 0;
  font-weight: 800;
  font-size: 16px;
}

/* plans */
.plans { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: clamp(16px, 3.4vh, 28px); }
.plans legend { grid-column: 1 / -1; }
.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 14px 12px;
  border: 2px solid var(--rule);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 120ms, background-color 120ms;
}
.plan:hover { border-color: #b9b9c1; }
.plan input { position: absolute; opacity: 0; pointer-events: none; }
.plan:has(input:checked) { border-color: var(--ink); background: #f4f4f6; }
.plan:has(input:focus-visible) { outline: 3px solid var(--grey); outline-offset: 2px; }
.plan-name { font-weight: 700; font-size: 14px; }
.plan { padding: 12px 11px 10px; }
.plan-sub { white-space: nowrap; }
.plan-price {
  font-stretch: 125%;
  font-variation-settings: "wdth" 125;
  font-weight: 800;
  font-size: 23px;
  line-height: 1.15;
}
.plan-sub { color: var(--grey); font-size: 13px; }
.badge {
  position: absolute;
  top: -10px;
  right: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
}

/* pay */
.pay { margin: 0; }
[hidden] { display: none !important; }
.grp { display: flex; flex-direction: column; }
.lite-info { padding: 16px 18px; border-radius: 6px; background: #f4f4f6; }
.lite-info p { margin: 0 0 8px; }
.lite-info p:last-child { margin: 0; }
.pay-row { display: flex; gap: 18px; align-items: center; }
.qr { width: min(210px, 27vh); height: auto; flex: none; border: 1px solid var(--rule); border-radius: 8px; background: #fff; }
.qr.none { height: min(210px, 27vh); }
.qr.none { display: grid; place-items: center; color: var(--grey); font-size: 13px; text-align: center; padding: 12px; }
.muted-text { margin: 0; color: var(--grey); font-size: 15px; }
.muted-text b { color: var(--ink); }

/* fields */
.fields { display: flex; flex-direction: column; }
.fields label { margin: 12px 0 6px; font-weight: 700; font-size: 15px; }
.fields .step-title + label { margin-top: 0; }
.fields label span { color: var(--grey); font-weight: 400; margin-left: 6px; }
.fields input:not([type=file]), details input {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}
.fields input::placeholder { color: #a6a6ae; }
.fields input:focus-visible, .send:focus-visible, summary:focus-visible { outline: 3px solid var(--grey); outline-offset: 2px; }
input[type=file] { font: inherit; font-size: 15px; color: var(--grey); }
input[type=file]::file-selector-button {
  margin-right: 12px;
  padding: 9px 16px;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
input[type=file]::file-selector-button:hover { background: #f4f4f6; }
details { margin-top: 16px; }
summary { cursor: pointer; font-weight: 600; font-size: 15px; }
details input { margin: 10px 0 6px; letter-spacing: .04em; }
.send {
  margin-top: 22px;
  padding: 13px 22px;
  border: 0;
  border-radius: 4px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 120ms;
}
.send:hover { background: var(--brand-deep); }
.fields .err { margin-top: 16px; }

/* status */
.done.ok { background: #eef7f1; }
.done.bad { background: #fdeeee; }
.keybox { display: flex; gap: 10px; align-items: center; margin: 10px 0 12px; flex-wrap: wrap; }
.keybox code {
  font-size: 20px;
  letter-spacing: .06em;
  padding: 8px 14px;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: #fff;
}
.keybox button {
  padding: 10px 18px;
  border: 0;
  border-radius: 4px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

/* Short windows: tighter, still one screen. */
@media (max-height: 760px) and (min-width: 861px) {
  .fields label { margin: 8px 0 4px; }
  .fields input:not([type=file]), details input { padding: 8px 12px; }
  .plan { padding: 10px 12px 9px; }
  .plan-price { font-size: 22px; }
  details { margin-top: 10px; }
  .send { margin-top: 14px; padding: 11px 22px; }
}
/* Narrow screens (phones): one column; scrolling is fine there. */
@media (max-width: 860px) {
  form.buy { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  form.buy .col:first-child { padding-right: 0; }
  form.buy .col.fields { padding-left: 0; border-left: 0; padding-top: 22px; border-top: 1px solid var(--rule); }
  .buy-top { justify-content: flex-start; }
  .buy-top h1 { font-size: clamp(1.5rem, 8vw, 2.2rem); white-space: normal; }
  .buy-top .lede { font-size: 15px; }
  .buy-page { overflow-x: hidden; }
}
@media (max-width: 760px) {
  .plans { grid-template-columns: minmax(0, 1fr); }
  .plan { flex-direction: row; align-items: baseline; gap: 10px; padding: 10px 12px; }
  .plan-price { font-size: 20px; margin-left: auto; order: 2; }
  .badge { position: static; order: 1; align-self: center; }
  .plan-sub { order: 1; }
  .pay-row { flex-direction: column; align-items: flex-start; }
}
