/* Payment state is owned by state.js. Keep hidden stronger than layout rules. */
[hidden] { display: none !important; }

.payment-page { min-height: 100svh; display: flex; flex-direction: column; }
.payment-page .site-header { position: relative; }
.back-link { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.back-link:hover { color: var(--ink); }
.back-link svg { width: 16px; height: 16px; }
.payment-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); width: min(980px, calc(100% - 96px)); margin: 64px auto 72px; gap: 54px; align-items: start; }
.purchase-summary { padding: 28px 0; }
.product-art { display: grid; place-items: center; position: relative; isolation: isolate; height: 210px; margin-bottom: 30px; overflow: hidden; border: 1px solid #dce3d4; border-radius: 24px; background: radial-gradient(ellipse at 20% 10%, #edf0d9, transparent 75%), linear-gradient(135deg, #e8eddf, #d3decf); }
.product-art::before, .product-art::after { content: ""; position: absolute; z-index: -1; width: 180px; height: 250px; border: 1px solid #ffffff9c; border-radius: 22px; background: linear-gradient(135deg, #ffffff5e, #ffffff05); transform: rotate(-32deg); }
.product-art::before { left: -60px; top: 55px; }
.product-art::after { right: -48px; top: -90px; }
.product-art img { width: 80px; height: 80px; transform: rotate(-8deg); filter: drop-shadow(0 16px 16px #27332130); }
.purchase-summary h2 { font-size: 25px; letter-spacing: -.8px; }
.purchase-summary > p { margin: 10px 0 24px; max-width: 26ch; color: var(--muted); font-size: 14px; line-height: 1.7; }
.purchase-facts { margin: 0; padding: 22px 0 0; border-top: 1px solid var(--line); list-style: none; }
.purchase-facts li { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; color: #5a6853; font-size: 12px; line-height: 1.5; }
.purchase-facts svg { width: 16px; height: 16px; }
.purchase-facts a { text-decoration: underline; text-underline-offset: 3px; }
.payment { min-width: 0; padding: 38px; border: 1px solid #e2e4db; border-radius: 24px; background: #fffefa; box-shadow: 0 20px 55px -35px #35442a33, inset 0 1px 0 #fff; animation: rise-in .7s var(--entrance-ease) both; }
.payment-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 27px; border: 1px solid #dfe6d8; border-radius: 14px; background: #edf2e7; color: #57734b; }
.payment-icon svg { width: 23px; height: 23px; }
.payment h1 { margin: 0 0 16px; font-size: clamp(32px, 3.3vw, 40px); font-weight: 620; line-height: 1.13; letter-spacing: -1.8px; }
.payment p { margin: 0 0 20px; color: var(--muted); font-size: 14px; line-height: 1.75; overflow-wrap: anywhere; }
.payment p:last-child { margin-bottom: 0; }
.payment p a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.payment .button { font-size: 14px; }
.payment b { color: var(--ink); font-weight: 550; }
.payment-note { margin-top: 28px !important; padding-top: 22px; border-top: 1px solid #e7e8df; font-size: 12px !important; }
.payment-note a { white-space: nowrap; }
.payment-status { display: flex; align-items: flex-start; gap: 10px; padding: 15px 16px; border: 1px solid #e4e8dc; border-radius: 12px; background: #f3f6ee; }
.payment-status::before { content: ""; flex: 0 0 7px; width: 7px; height: 7px; margin-top: 8px; border-radius: 50%; background: #7c906d; }
.payment-status--loading::before { flex-basis: 13px; width: 13px; height: 13px; margin-top: 5px; border: 1.5px solid #c8d2bf; border-top-color: #57734b; background: none; animation: payment-spin 1s linear infinite; }
.payment-status--warning { background: #f8f3e8; border-color: #e9dfc8; }
.payment-status--warning::before { background: #a18a56; }
.payment-status--error { background: #faf1ed; border-color: #eddfd7; }
.payment-status--error::before { background: #ad7058; }
.payment-status > span { min-width: 0; }

.licence-panel { margin: 24px 0; padding: 18px; border: 1px solid #dce4d3; border-radius: 14px; background: #f1f5ea; }
.licence-label { display: block; margin-bottom: 12px; color: #536648; font-size: 11px; font-weight: 650; letter-spacing: .8px; text-transform: uppercase; }
.licence-key { display: block; max-height: 180px; overflow: auto; padding: 14px; border: 1px solid #e0e6d7; border-radius: 8px; background: #ffffffb3; color: #415437; font: 12px/1.75 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; user-select: all; }
.key-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin-top: 15px; }
.key-actions .button { min-height: 40px; padding: 10px 14px; font-size: 12px; border-radius: 9px; }
.key-actions [data-copied] { color: #45643a; font-size: 12px; }
.activation-steps { display: grid; gap: 13px; margin: 22px 0 28px; padding: 0; list-style: none; counter-reset: activate; }
.activation-steps li { display: flex; align-items: baseline; gap: 11px; color: var(--muted); font-size: 13px; line-height: 1.7; counter-increment: activate; }
.activation-steps li::before { content: counter(activate); flex-shrink: 0; display: grid; place-items: center; width: 21px; height: 21px; border: 1px solid var(--line); border-radius: 50%; color: #69775e; font-size: 10px; }
.payment form { display: grid; gap: 10px; margin: 26px 0 22px; }
.payment label { font-size: 12px; font-weight: 600; }
.payment input { width: 100%; min-width: 0; min-height: 50px; padding: 13px 15px; border: 1px solid #d6dccf; border-radius: 10px; background: #fff; font-size: 16px; transition: border-color .2s, box-shadow .2s; }
.payment input::placeholder { color: #90978a; }
.payment input:focus { border-color: #7f9870; box-shadow: 0 0 0 3px #e9efdf; }
.payment form .button { width: 100%; margin-top: 6px; }
.payment[data-state="invalid"] input { border-color: #b97b61; }
.payment form + .payment-status { margin-top: 18px; }
.payment-footer { display: flex; justify-content: space-between; gap: 20px; width: min(980px, calc(100% - 96px)); margin: auto auto 28px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.6; }
.payment-footer a { text-underline-offset: 3px; }
.payment-footer a:hover { text-decoration: underline; }
@keyframes payment-spin { to { transform: rotate(360deg); } }

@media (max-width: 1000px) {
  .payment-layout { grid-template-columns: 230px minmax(0, 1fr); width: calc(100% - 56px); gap: 32px; margin-top: 44px; }
  .payment { padding: 30px; }
  .payment-footer { width: calc(100% - 56px); }
}

@media (max-width: 760px) {
  .payment-layout { width: min(520px, calc(100% - 36px)); grid-template-columns: minmax(0, 1fr); gap: 28px; margin-block: 28px 42px; }
  .purchase-summary { display: grid; grid-template-columns: 68px 1fr; column-gap: 17px; padding: 0 5px; }
  .product-art { grid-row: span 2; width: 68px; height: 68px; margin: 0; border-radius: 17px; }
  .product-art img { width: 42px; height: 42px; }
  .product-art::before, .product-art::after { display: none; }
  .purchase-summary h2 { align-self: end; font-size: 22px; }
  .purchase-summary > p { max-width: none; margin: 6px 0 0; font-size: 12px; line-height: 1.6; }
  .purchase-facts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 19px; padding-top: 16px; }
  .purchase-facts li { margin: 0; gap: 6px; font-size: 11px; }
  .purchase-facts svg { width: 14px; height: 14px; }
  .payment { padding: 27px; border-radius: 19px; }
  .payment-icon { width: 42px; height: 42px; margin-bottom: 23px; border-radius: 12px; }
  .payment h1 { font-size: 33px; }
  .payment p { font-size: 13px; }
  .payment-footer { width: calc(100% - 36px); font-size: 10px; }
}

@media (max-width: 380px) {
  .payment { padding: 23px; }
  .payment h1 { font-size: 30px; }
  .payment-footer { flex-direction: column; gap: 8px; }
}
