/* Shop components: account, dialogs, packages, downloads, notices. Builds on styles.css and readability.css. */

/* Manrope and DM Mono come from /fonts.css on this server; system fonts are the fallback. */
:root {
  --sans: 'Manrope', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'DM Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --danger: #ffb4a8;
}

[hidden] { display: none !important; }

.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 40;
  background: var(--acid); color: #10140e; padding: 10px 14px; font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.test-banner {
  margin: 0; padding: 8px 16px; text-align: center;
  background: #2b2f14; color: #e9ffa8; font-size: 14px; border-bottom: 1px solid #50581e;
}

/* Header */
.header-actions { gap: 10px; }
.credit-pill { font-family: var(--mono); }
.credit-pill .credit-label { font-family: var(--sans); }
.credit-pill .plus { line-height: 1; padding-bottom: 1px; }
.account-button {
  height: 46px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--text); border: 1px solid var(--line);
  font: inherit; font-size: 15px; font-weight: 700;
}
.account-button:hover { border-color: var(--lilac); }

/* Notice after returning from the payment page */
.notice {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  margin-top: 20px; padding: 16px 18px;
  background: var(--panel); border: 1px solid var(--lilac); border-radius: 5px;
}
.notice p { margin: 0; font-size: 17px; }
.notice-close {
  flex: none; width: 36px; height: 36px; margin: -6px -6px 0 0; border: 0; cursor: pointer;
  background: transparent; color: var(--muted); font-size: 24px; line-height: 1;
}

/* Gallery: previews are small renders of the real files. */
.wallpaper-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.shop:focus { outline: none; }
.loading-note { color: var(--muted); grid-column: 1 / -1; }
.wallpaper-card.owned { border-color: rgba(216, 255, 114, .45); }
.download-button { text-decoration: none; }
.download-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.download-links .download-button { margin-top: 14px; }

/* Packages on the page */
.plans { grid-template-columns: repeat(3, 1fr); }
.plan { min-height: 132px; gap: 6px; }
.plan .bonus { display: block; font-family: var(--mono); font-size: 14px; letter-spacing: 0; color: var(--acid); }
.plan .bonus.muted { color: var(--muted); }
@media (max-width: 900px) { .plans { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .plans { grid-template-columns: 1fr; } .plan { min-height: 96px; } }

/* Footer */
.site-footer { flex-wrap: wrap; gap: 12px 24px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.footer-links a { color: var(--text); }

/* Dialogs */
.sheet {
  width: min(480px, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow: auto;
  padding: 32px; border: 1px solid rgba(255, 255, 255, .15); border-radius: 4px;
  background: #181c23; color: var(--text); box-shadow: 0 20px 80px #000;
}
.sheet::backdrop { background: rgba(2, 4, 7, .72); backdrop-filter: blur(8px); }
.sheet h2 { font-size: clamp(30px, 6vw, 40px); line-height: 1.1; letter-spacing: -.05em; margin: 8px 40px 18px 0; }
.sheet .modal-close { position: absolute; right: 12px; top: 10px; width: 44px; height: 44px; }
.sheet-intro { color: #d4d9df; font-size: 16px; margin: -6px 0 18px; }
.sheet-form { display: grid; gap: 14px; }

.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 18px; }
.tabs button {
  height: 46px; border: 1px solid var(--line); background: transparent; color: var(--muted);
  font: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
}
.tabs button[aria-pressed="true"] { border-color: var(--lilac); color: var(--text); background: #20252d; }

.field { display: grid; gap: 6px; font-size: 15px; font-weight: 600; }
.field input {
  height: 50px; padding: 0 14px; border: 1px solid rgba(255, 255, 255, .28); border-radius: 4px;
  background: #0f1217; color: var(--text); font: inherit; font-size: 17px; font-weight: 400;
}
.field input:focus-visible { outline: 2px solid var(--acid); outline-offset: 2px; }
.field-hint { margin: 0; color: #c1c8d0; font-size: 14px; line-height: 1.5; }
.field-hint a, .check a { color: var(--text); }
.form-error {
  margin: 0; padding: 10px 12px; border-left: 3px solid var(--danger);
  background: rgba(255, 120, 100, .1); color: var(--danger); font-size: 15px;
}

.sheet .checkout-submit { margin-top: 4px; }
.sheet .checkout-submit:disabled { opacity: .6; cursor: progress; }
.secondary-button {
  width: 100%; height: 52px; border: 1px solid var(--line); background: transparent; color: var(--text);
  font: inherit; font-size: 16px; font-weight: 700; cursor: pointer;
}

.package-options { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.package-options legend { margin-bottom: 8px; font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: #c1c8d0; }
.package-option {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  min-height: 52px; padding: 8px 14px; border: 1px solid transparent; background: #20252d; cursor: pointer; font-size: 15px;
}
.package-option:has(input:checked) { border-color: var(--lilac); }
.package-option input { width: 18px; height: 18px; accent-color: var(--acid); }
.package-price { font-family: var(--mono); color: var(--lilac); white-space: nowrap; }
.checkout-summary { margin: 0; font-size: 16px; }

.check { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; font-size: 15px; line-height: 1.5; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--acid); }

.facts { display: grid; gap: 8px; margin: 0 0 16px; }
.facts div { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.facts dt { color: #c1c8d0; }
.facts dd { margin: 0; font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.unlock-preview { height: 160px; margin-bottom: 18px; }
#unlock-dialog .field-hint { margin-bottom: 16px; }

.toast { max-width: calc(100% - 32px); text-align: center; }

@media (max-width: 600px) {
  .sheet { padding: 26px 18px; }
  .account-button { height: 42px; padding: 0 13px; font-size: 14px; }
  .notice p { font-size: 16px; }
  .download-links { grid-template-columns: 1fr; gap: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
