/* biome-ignore-all lint/style/noDescendingSpecificity: components in reading order, wider screens after the phone rules */
/* biome-ignore-all lint/suspicious/noDuplicateProperties: a plain colour stands before every color-mix(), for a browser that has none (Safari before 16.2) */
/* The order card: the invoice of a crypto payment (what to send, on which network, to which
   address, its QR code, the page's own check) and every state an order ends in. Calm and
   flat, lists and rows, one main button: the look of paying in the bot. It extends
   static/site.css and checkout.css, which names the three colours used here that the site's
   tokens do not have (--warn, --ok, --paper). */
/* the invoice has two columns on a laptop; order.js marks the column for it */
.acct__col[data-view="order"][data-order="invoice"] {
	max-width: 940px;
}
.ico {
	flex: none;
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* ---------- the card ---------- */
/* on a phone the card is the page itself: no box around the heading and the blocks */
.acct .order-card {
	gap: 0;
	padding: 0;
	border: 0;
	background: none;
	scroll-margin-top: 96px;
}
.order-head {
	display: flex;
	align-items: center;
	gap: 10px;
}
.order-title {
	min-width: 0;
	font: 700 24px / 28px var(--ff-d);
	letter-spacing: -0.02em;
}
/* the mark of something live: an invoice that waits, a check that runs */
.pulse {
	flex: none;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--cyan);
	box-shadow: 0 0 0 4px rgba(50, 215, 255, 0.16);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--cyan) 16%, transparent);
}
@keyframes order-pulse {
	50% {
		box-shadow: 0 0 0 7px rgba(50, 215, 255, 0.05);
		box-shadow: 0 0 0 7px color-mix(in srgb, var(--cyan) 5%, transparent);
	}
}
/* it breathes only for a visitor who did not ask for less motion */
@media (prefers-reduced-motion: no-preference) {
	.pulse {
		animation: order-pulse 2.4s ease-in-out infinite;
	}
}
/* the time left: quiet, and in the warning colour only in the last five minutes */
.order-clock {
	flex: none;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 32px;
	margin-left: auto;
	padding: 0 12px;
	border-radius: 99px;
	background: var(--s2);
	color: var(--muted);
	font: 500 14px / 1 var(--ff-m);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}
.order-clock--soon {
	color: var(--warn);
}
.order-sub {
	margin-top: 4px;
	color: var(--dim);
	font-size: 14px;
	line-height: 20px;
	overflow-wrap: anywhere;
}

/* ---------- the invoice ---------- */
.order-pay {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 12px;
	margin-top: 14px;
}
.order-blocks {
	border: 1px solid var(--line);
	border-radius: 20px;
	background: var(--s1);
}
/* a block: its label, and to the right of the label the Copy of its value; the value and
   what is said about it take the whole width under them */
.pay-line {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	gap: 0 12px;
	min-height: 40px;
	padding: 10px 12px 14px 16px;
	border-top: 1px solid var(--line);
}
.pay-line:first-child {
	border-top: 0;
}
.pay-line > * {
	grid-column: 1 / -1;
}
.pay-line > .pay-line__label {
	grid-column: 1;
	padding: 4px 0;
	color: var(--dim);
	font: 600 12px / 16px var(--ff-b);
	letter-spacing: 0.04em;
	text-transform: uppercase;
}
.pay-line > .copy-button {
	grid-column: 2;
	grid-row: 1;
}
.pay-line .detail-value {
	text-align: left;
}
/* the amount: the largest text of the card, every digit of it, never broken inside */
.pay-line--amount .figure {
	gap: 0 8px;
}
.pay-line--amount .figure strong {
	font: 600 30px / 34px var(--ff-m);
	font-size: min(30px, 100cqi / 10);
	letter-spacing: -0.01em;
}
.pay-line--amount .unit {
	color: var(--cyan);
	font: 600 16px / 34px var(--ff-m);
	letter-spacing: 0.04em;
}
.pay-line__hint {
	margin-top: 4px;
	color: var(--dim);
	font-size: 13px;
	line-height: 18px;
}
.copy-button:not(.text-button) {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 40px;
	padding: 0 12px;
	border: 0;
	border-radius: 11px;
	background: var(--s3);
	color: var(--text);
	font: 600 13px / 1 var(--ff-b);
	white-space: nowrap;
}
.copy-button:not(.text-button):hover {
	background: #494891;
	background: color-mix(in srgb, var(--violet) 34%, var(--s3));
}
.pay-net {
	display: flex;
	align-items: center;
	gap: 10px;
	font: 700 18px / 22px var(--ff-b);
}
/* a coin's or a network's mark on a white round pad */
.coin-mark {
	flex: none;
	box-sizing: border-box;
	width: 24px;
	height: 24px;
	padding: 4px;
	border-radius: 50%;
	background: var(--paper);
}
.pay-warn {
	display: flex;
	gap: 8px;
	margin-top: 8px;
	color: var(--warn);
	font: 500 13px / 18px var(--ff-b);
	text-align: left;
}
/* The address in groups of four. The gap is a margin of each group: there is no space in
   the text, so a selection made by hand copies the address itself, and a line breaks
   between groups, never inside one. */
.pay-address {
	/* six groups to a line where there is room, so 48 characters stand as two even lines */
	max-width: 19em;
	margin-top: 2px;
	color: var(--muted);
	font: 500 15px / 24px var(--ff-m);
	letter-spacing: 0.02em;
}
.pay-address__g {
	display: inline-block;
	margin-right: 0.62em;
}
.pay-address__g--edge {
	color: var(--text);
	font-weight: 600;
}
.pay-memo {
	font: 600 16px / 24px var(--ff-m);
	overflow-wrap: anywhere;
}
/* the QR code: folded on a phone, which cannot scan its own screen */
.order-qr {
	display: none;
}
.order-qr[data-open="true"] {
	display: block;
}
.qr-tile {
	width: min(264px, 100%);
	margin: 0 auto;
	border-radius: 16px;
	background: var(--paper);
	overflow: hidden;
}
.qr-tile svg {
	display: block;
	width: 100%;
	height: auto;
}
.order-qr__note {
	margin: 12px 2px 0;
	color: var(--dim);
	font-size: 13px;
	line-height: 18px;
	text-align: center;
}
.acct .order-qr__toggle {
	min-height: 48px;
	border-radius: 14px;
	font-size: 15px;
}

/* ---------- what to do, and what the page does ---------- */
.order-act {
	display: grid;
	gap: 12px;
	margin-top: 16px;
}
.order-actions {
	display: grid;
	gap: 12px;
}
.order-check {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 4px;
	color: var(--muted);
	font-size: 14px;
	line-height: 20px;
}
.order-check__now {
	margin-left: auto;
	color: var(--text);
	font-size: 14px;
	white-space: nowrap;
}
.order-foot {
	margin: 12px 4px 0;
	color: var(--dim);
	font-size: 13px;
	line-height: 19px;
}
.order-foot .text-button {
	font-size: 14px;
}
.order-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0 20px;
}

/* ---------- a state that is not an invoice: a sign, a title, a sentence, a list ---------- */
.order-card--note {
	text-align: center;
}
.order-card--note .order-head {
	justify-content: center;
}
.order-card--note .order-title {
	font-size: 28px;
	line-height: 32px;
}
.order-card--note .order-sub {
	max-width: 34em;
	margin: 8px auto 0;
	color: var(--muted);
	font-size: 16px;
	line-height: 24px;
}
.order-card--note .order-links {
	justify-content: center;
}
/* a transfer that is seen: the live dot by the title, no sign, a quieter second paragraph */
.order-card--seen .order-head {
	margin-top: 20px;
}
.order-more {
	max-width: 34em;
	margin: 10px auto 0;
	color: var(--dim);
	font-size: 14px;
	line-height: 20px;
}
.order-card--note .order-check {
	text-align: left;
}
/* the plain colours before the mixes are the quiet tone's: a browser without color-mix()
   draws every sign on that ground, each still in its own colour */
.order-mark {
	--tone: var(--muted);
	display: grid;
	place-items: center;
	width: 92px;
	height: 92px;
	margin: 28px auto 22px;
	border-radius: 50%;
	background: rgba(188, 185, 223, 0.14);
	background: color-mix(in srgb, var(--tone) 14%, transparent);
	box-shadow: inset 0 0 0 2px rgba(188, 185, 223, 0.5);
	box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--tone) 50%, transparent);
	color: var(--tone);
}
.order-mark[data-kind="ok"] {
	--tone: var(--ok);
}
.order-mark[data-kind="warn"] {
	--tone: var(--warn);
}
.order-mark[data-kind="fail"] {
	--tone: var(--pink);
}
.order-mark .ico {
	width: 44px;
	height: 44px;
	stroke-width: 2.2;
}
.order-list {
	margin-top: 22px;
	border: 1px solid var(--line);
	border-radius: 20px;
	background: var(--s1);
	text-align: left;
}
.order-kv,
.order-list .ref-line {
	min-height: 46px;
	padding: 0 16px;
	border-top: 1px solid var(--line);
	font-size: 15px;
	line-height: 20px;
}
.order-list > :first-child {
	border-top: 0;
}
.order-kv {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding-block: 13px;
}
.order-kv span,
.ref-line__label {
	color: var(--dim);
}
.order-kv strong {
	font-weight: 500;
	text-align: right;
	overflow-wrap: anywhere;
}
.order-kv .mono {
	font-family: var(--ff-m);
}

/* ---------- a laptop: the invoice in a card, the QR code open beside the amount ---------- */
@media (min-width: 900px) {
	.acct .order-card--invoice {
		padding: 28px;
		border: 1px solid var(--line);
		border-radius: 24px;
		background: var(--s1);
	}
	.order-card--invoice .order-title {
		font-size: 30px;
		line-height: 36px;
	}
	.order-pay {
		grid-template-columns: 264px minmax(0, 1fr);
		gap: 28px;
		align-items: start;
	}
	.order-qr,
	.order-qr[data-open] {
		display: block;
		grid-column: 1;
		grid-row: 1;
	}
	.order-qr__note {
		text-align: left;
	}
	.acct .order-qr__toggle {
		display: none;
	}
	.order-blocks {
		grid-column: 2;
		grid-row: 1;
		border-radius: 18px;
		background: var(--deep);
	}
	.pay-line {
		padding: 12px 14px 16px 22px;
	}
	.pay-line--amount .figure strong {
		font-size: min(36px, 100cqi / 10);
		line-height: 42px;
	}
	.pay-line--amount .unit {
		line-height: 42px;
	}
	.pay-address {
		font-size: 17px;
		line-height: 26px;
	}
	.order-card--invoice .order-act {
		margin-top: 20px;
		padding-top: 18px;
		border-top: 1px solid var(--line);
	}
	.order-card--invoice .order-check {
		margin: 0;
	}
	.order-card--invoice .order-foot {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		justify-content: space-between;
		gap: 0 24px;
		margin: 4px 0 0;
		font-size: 14px;
		line-height: 20px;
	}
}
