/* ==========================================================================
   NEXA-PING design system — the page of the sponsors
   The form a sponsor orders with — three steps: the plan, the mark (an address of a picture)
   and the name of the site, the way of paying — and at the right of it how the place will look
   and what it is; the same page tells of an order the gateway sent the buyer back for.
   =============
*/

/* ---- the page: the form at the left, what comes beside it at the right ------- */

.nx-sp { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.nx-sp-form { display: grid; gap: 22px; padding: 24px 28px 26px; }
.nx-sp-step { display: grid; gap: 14px; }
.nx-sp-step-title { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--ink); font-size: 15.5px; font-weight: 700; }
.nx-sp-step-no { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-size: 12.5px; font-weight: 800; }

/* ---- the plans: three cards side by side; the chosen one is drawn with the accent, a tint
   and a mark of its own — the same box as the others, so the three always line up ----------- */

.nx-sp-plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.nx-sp-plan {
	position: relative; display: grid; gap: 1px; padding: 14px 44px 14px 16px; overflow: hidden;
	border: 1.5px solid var(--line); border-radius: 16px; background: var(--surface-2); cursor: pointer;
	transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}
/* the radio covers its card: the card is pressed wherever it is touched, and the keyboard
   rings the card */
.nx-sp-plan input, .nx-sp-method input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.nx-sp-plan:hover { border-color: color-mix(in srgb, var(--accent) 42%, var(--line)); }
.nx-sp-plan:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.nx-sp-plan:has(input:focus-visible), .nx-sp-method:has(input:focus-visible) { outline: 3px solid var(--accent-ring); outline-offset: 3px; }
.nx-sp-plan-name { color: var(--ink-2); font-size: 13px; font-weight: 600; }
.nx-sp-plan-price { color: var(--ink); font-size: 28px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.nx-sp-plan-price small { margin-right: 2px; color: var(--ink-3); font-size: 15px; font-weight: 700; }
.nx-sp-plan-unit { margin-top: -3px; color: var(--ink-3); font-size: 12.5px; }
.nx-sp-plan-note { margin-top: 6px; color: var(--ink-4); font-size: 12px; }
/* the round mark at the corner: empty, then a cross of its own when the card is chosen */
.nx-sp-plan::after { content: ""; position: absolute; top: 12px; right: 12px; width: 18px; height: 18px; border: 1.5px solid var(--line-2); border-radius: 50%; background: var(--surface); transition: border-color 0.18s var(--ease), background 0.18s var(--ease); }
.nx-sp-plan::before { content: ""; position: absolute; top: 15px; right: 17px; z-index: 1; width: 5px; height: 9px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(45deg) scale(0); transition: transform 0.18s var(--ease-out); }
.nx-sp-plan:has(input:checked)::after { border-color: var(--accent); background: var(--accent); }
.nx-sp-plan:has(input:checked)::before { transform: rotate(45deg) scale(1); }

/* ---- the mark, the name and the address -------------------------------------- */

.nx-sp-fields { display: grid; gap: 16px; }
.nx-sp-field { display: grid; gap: 6px; }
.nx-sp-label { color: var(--ink-2); font-size: 13.5px; font-weight: 600; }
.nx-sp-label em { margin-left: 6px; padding: 1px 7px; border-radius: var(--r-pill); background: var(--surface-3); color: var(--ink-4); font-size: 11.5px; font-style: normal; font-weight: 600; }
.nx-sp-input {
	box-sizing: border-box; width: 100%; height: 44px; padding: 0 14px;
	border: 1px solid var(--line-2); border-radius: var(--r-md); background: var(--surface); color: var(--ink);
	font-family: inherit; font-size: 14.5px; transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.nx-sp-input::placeholder { color: var(--ink-4); }
.nx-sp-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.nx-sp-field.is-bad .nx-sp-input { border-color: var(--bad); }
.nx-sp-field-error { margin: 0; padding: 6px 10px; border-radius: var(--r-xs); background: var(--bad-soft); color: var(--bad); font-size: 12.5px; font-weight: 500; line-height: 1.5; }
.nx-sp-field-error[hidden] { display: none; }
.nx-sp-hint { color: var(--ink-4); font-size: 12.5px; line-height: 1.6; }
/* the mark is an address: its picture is shown as it is typed, beside the address */
.nx-sp-mark { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 10px; align-items: stretch; }
.nx-sp-mark-thumb {
	display: grid; place-items: center; width: 44px; height: 44px; overflow: hidden;
	border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface-2); color: var(--ink-4); font-size: 20px;
	transition: border-color 0.18s var(--ease), color 0.18s var(--ease);
}
.nx-sp-mark-thumb .ic { width: 20px; height: 20px; }
.nx-sp-mark-thumb:has(img:not([hidden])) .ic { display: none; }
.nx-sp-mark-thumb img { width: 100%; height: 100%; object-fit: contain; }
.nx-sp-mark-thumb img[hidden] { display: none; }
.nx-sp-mark-thumb.is-ok { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); color: var(--ok); }
.nx-sp-mark-thumb.is-bad { border-color: var(--bad); color: var(--bad); }
.nx-sp-field.is-bad .nx-sp-mark-thumb.is-bad { border-color: transparent; }

/* ---- the ways of paying: two cards of one size, each with the mark of its app and its
   name, the two on one line in the middle of the card ---------------------------------- */

.nx-sp-methods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 420px; }
.nx-sp-method {
	position: relative; display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 44px 0 16px;
	border: 1.5px solid var(--line); border-radius: 16px; background: var(--surface-2); color: var(--ink-2);
	font-size: 14.5px; font-weight: 600; line-height: 1; cursor: pointer;
	transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.nx-sp-method:hover { border-color: color-mix(in srgb, var(--accent) 42%, var(--line)); }
.nx-sp-method:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
/* the mark of the app is a square of 28, drawn in the 28 the page gives it (the icons of the
   site are 1.3em: here they are told their size) */
.nx-sp-method-mark { display: grid; place-items: center; flex: 0 0 28px; width: 28px; height: 28px; }
.nx-sp-method-mark .ic { width: 28px; height: 28px; }
.nx-sp-method-mark--wxpay { color: #07c160; }
.nx-sp-method-mark--alipay { color: #1677ff; }
/* the round mark at the corner, as on the cards of the plans */
.nx-sp-method::after { content: ""; position: absolute; top: 50%; right: 16px; width: 18px; height: 18px; border: 1.5px solid var(--line-2); border-radius: 50%; background: var(--surface); transform: translateY(-50%); transition: border-color 0.18s var(--ease), background 0.18s var(--ease); }
.nx-sp-method::before { content: ""; position: absolute; top: 50%; right: 21px; z-index: 1; width: 5px; height: 9px; margin-top: -4px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(45deg) scale(0); transition: transform 0.18s var(--ease-out); }
.nx-sp-method:has(input:checked)::after { border-color: var(--accent); background: var(--accent); }
.nx-sp-method:has(input:checked)::before { transform: rotate(45deg) scale(1); }

/* ---- what is to be paid, and the way to pay it -------------------------------- */

.nx-sp-submit { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding-top: 20px; border-top: 1px solid var(--line); }
.nx-sp-total { margin: 0; color: var(--ink-3); font-size: 13.5px; }
.nx-sp-total strong { margin-left: 6px; color: var(--ink); font-size: 26px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.nx-sp-total-note { margin-left: 4px; color: var(--ink-3); font-size: 13px; }
.nx-sp-pay { min-width: 172px; height: 46px; font-size: 15px; }
.nx-sp-pay[disabled] { opacity: 0.7; cursor: default; }
.nx-sp-pay .kkyun-loading { width: 15px; height: 15px; border-width: 2px; }
.nx-sp-agree { margin: -8px 0 0; color: var(--ink-4); font-size: 12.5px; line-height: 1.6; text-align: right; }

/* ---- beside the form: how the place will look, and what it is ------------------ */

.nx-sp-side { position: sticky; top: calc(var(--header-h) + 16px); display: grid; gap: 14px; }
.nx-sp-preview, .nx-sp-notes { display: grid; gap: 10px; padding: 20px 22px; }
.nx-sp-side-title { margin: 0; color: var(--ink); font-size: 15px; font-weight: 700; }
.nx-sp-side-note { margin: -6px 0 0; color: var(--ink-4); font-size: 12.5px; }
/* the stage is the ground of the home page, with the place as it stands there */
.nx-sp-preview-stage { display: grid; place-items: center; min-height: 136px; margin-top: 4px; padding: 18px; border-radius: var(--r-lg); background: var(--bg); }
.nx-slot.nx-slot--demo { flex: none; width: 176px; }
.nx-sp-notes ul { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.nx-sp-notes li { position: relative; padding-left: 16px; color: var(--ink-3); font-size: 13px; line-height: 1.7; }
.nx-sp-notes li::before { content: ""; position: absolute; left: 0; top: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* the page before the payment is set up */
.nx-sp-closed { display: flex; align-items: center; gap: 10px; grid-column: 1 / -1; padding: 18px 22px; color: var(--ink-2); font-size: 14px; }
.nx-sp-closed-ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-size: 18px; }

/* ---- the order, as the gateway sent the buyer back for it --------------------- */

.nx-sp-result { display: grid; justify-items: center; gap: 8px; grid-column: 1 / -1; max-width: 480px; margin: 12px auto 0; padding: 40px 28px 34px; text-align: center; }
.nx-sp-result-icon { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 8px; border-radius: 22px; font-size: 30px; animation: nx-pop 0.3s var(--ease-out); }
.nx-sp-result-icon.is-ok { background: var(--ok-soft); color: var(--ok); }
.nx-sp-result-icon.is-wait { background: var(--accent-soft); color: var(--accent-ink); }
.nx-sp-result-icon.is-bad { background: var(--bad-soft); color: var(--bad); }
.nx-sp-result-icon.is-off { background: var(--surface-3); color: var(--ink-3); }
.nx-sp-result-icon .ic { width: 30px; height: 30px; }
.nx-sp-result-icon .kkyun-loading { width: 26px; height: 26px; border-width: 3px; }
.nx-sp-result h2 { margin: 0; color: var(--ink); font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
.nx-sp-result > p { max-width: 380px; margin: 0; color: var(--ink-3); font-size: 14px; line-height: 1.7; }
.nx-sp-result-dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 20px; width: 100%; box-sizing: border-box; margin: 14px 0 4px; padding: 14px 18px; border-radius: var(--r-md); background: var(--surface-2); font-size: 13.5px; text-align: left; }
.nx-sp-result-dl dt { color: var(--ink-3); }
.nx-sp-result-dl dd { margin: 0; color: var(--ink); font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.nx-sp-result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 14px; }
.nx-sp-result-actions .nx-btn { min-width: 132px; }

/* ---- responsive ------------------------------------------------------------ */

/* a tablet keeps the two, the one beside narrower */
@media (max-width: 1024px) {
	.nx-sp { grid-template-columns: minmax(0, 1fr) 280px; }
}
/* under this the one beside goes under the form, in two cards */
@media (max-width: 860px) {
	.nx-sp { grid-template-columns: minmax(0, 1fr); }
	.nx-sp-side { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.nx-sp-side > .nx-card { min-width: 0; }
}
@media (max-width: 640px) {
	.nx-sp-form { gap: 20px; padding: 18px 16px 20px; }
	.nx-sp-step { gap: 12px; }
	.nx-sp-plans { gap: 8px; }
	.nx-sp-plan { padding: 12px 34px 11px 10px; border-radius: 14px; }
	.nx-sp-plan-price { font-size: 22px; }
	.nx-sp-plan-price small { font-size: 13px; }
	.nx-sp-plan-note { display: none; }
	.nx-sp-plan::after { top: 9px; right: 9px; width: 16px; height: 16px; }
	.nx-sp-plan::before { top: 11px; right: 13px; width: 4px; height: 8px; }
	.nx-sp-methods { max-width: none; gap: 8px; }
	.nx-sp-method { height: 52px; padding: 0 38px 0 12px; gap: 8px; font-size: 14px; border-radius: 14px; }
	.nx-sp-method::after { right: 11px; width: 16px; height: 16px; }
	.nx-sp-method::before { right: 15px; width: 4px; height: 8px; margin-top: -3px; }
	.nx-sp-mark { grid-template-columns: 40px minmax(0, 1fr); }
	.nx-sp-mark-thumb { width: 40px; height: 40px; }
	.nx-sp-submit { flex-direction: column; align-items: stretch; padding-top: 16px; }
	.nx-sp-total { text-align: center; font-size: 13px; }
	.nx-sp-pay { width: 100%; }
	.nx-sp-agree { margin: -6px 0 0; text-align: center; }
	.nx-sp-side { grid-template-columns: minmax(0, 1fr); }
	.nx-sp-result { padding: 28px 14px 22px; }
	.nx-sp-result-actions { width: 100%; }
	.nx-sp-result-actions .nx-btn { flex: 1 1 40%; min-width: 0; }
}
