/*
 * The coin choice and payment details. They sit inside someone else's theme, so
 * fonts are inherited and every rule is scoped. The one strong idea is the
 * address, split into groups so it's easy to compare with a wallet's screen.
 */

.dcc {
	--dcc-ink: #17202b;
	--dcc-slate: #4a5664;
	--dcc-rule: #d5dce4;
	--dcc-rule-strong: #a9b4c1;
	--dcc-mist: #f1f4f7;
	--dcc-mist-strong: #dfe6ed;
	--dcc-ledger: #0e6b5c;
	--dcc-ledger-wash: #e5f3f0;
	--dcc-caution: #6b4300;
	--dcc-caution-wash: #fff3d9;
	--dcc-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, "Liberation Mono", monospace;

	display: grid;
	gap: 1rem;
	color: var(--dcc-ink);
	line-height: 1.45;
	text-align: left;
}

.dcc *,
.dcc *::before,
.dcc *::after {
	box-sizing: border-box;
}

.dcc p {
	margin: 0;
}

.dcc .dcc__label {
	display: block;
	margin: 0 0 0.3rem;
	font-size: 0.95em;
	font-weight: 600;
}

.dcc .dcc__optional {
	font-weight: 400;
	color: var(--dcc-slate);
}

.dcc .dcc__select,
.dcc .dcc__input {
	display: block;
	width: 100%;
	height: auto;
	margin: 0;
	padding: 0.6rem 0.75rem;
	font: inherit;
	line-height: 1.4;
	color: var(--dcc-ink);
	background-color: #fff;
	border: 1px solid var(--dcc-rule-strong);
	border-radius: 6px;
	box-shadow: none;
}

.dcc .dcc__select:focus,
.dcc .dcc__input:focus {
	border-color: var(--dcc-ledger);
	outline: 2px solid var(--dcc-ledger);
	outline-offset: 0;
}

.dcc .dcc__input--mono {
	font-family: var(--dcc-mono);
	font-size: 0.9em;
}

.dcc .dcc__hint {
	margin-top: 0.3rem;
	font-size: 0.85em;
	color: var(--dcc-slate);
}

/* Payment details */

.dcc .dcc__details {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 1.1rem;
	padding: 1.1rem;
	background: #fff;
	border: 1px solid var(--dcc-rule);
	border-radius: 12px;
}

.dcc .dcc__details[hidden] {
	display: none;
}

.dcc .dcc__qr {
	justify-self: center;
	width: 100%;
	max-width: 11rem;
	aspect-ratio: 1;
	background: #fff;
	border: 1px solid var(--dcc-rule);
	border-radius: 8px;
}

.dcc .dcc__qr svg {
	display: block;
	width: 100%;
	height: 100%;
}

.dcc .dcc__info {
	display: grid;
	align-content: start;
	gap: 0.9rem;
	min-width: 0;
}

.dcc .dcc__row-label {
	display: block;
	margin-bottom: 0.2rem;
	font-size: 0.85em;
	color: var(--dcc-slate);
}

.dcc .dcc__line {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 0.75rem;
	min-width: 0;
}

.dcc .dcc__amount {
	min-width: 0;
	font-size: 1.5em;
	font-weight: 650;
	font-variant-numeric: tabular-nums;
	line-height: 1.2;
	letter-spacing: -0.01em;
	overflow-wrap: anywhere;
}

/*
 * The groups stay inline-block with nothing between them, so selecting the
 * address by hand still copies it exactly. The first and last groups are
 * strongest because those are the characters people actually check.
 */
.dcc code.dcc__address {
	display: block;
	min-width: 0;
	margin: 0;
	padding: 0;
	font-family: var(--dcc-mono);
	font-size: 0.92em;
	line-height: 1.75;
	color: var(--dcc-ink);
	background: none;
	border: 0;
	white-space: normal;
}

.dcc .dcc__address span {
	display: inline-block;
	margin-right: 0.28em;
	padding: 0 0.22em;
	border-radius: 3px;
}

.dcc .dcc__address span:nth-child(odd) {
	background: var(--dcc-mist);
}

.dcc .dcc__address span:first-child,
.dcc .dcc__address span:last-child {
	font-weight: 700;
	background: var(--dcc-mist-strong);
}

.dcc .dcc__copy {
	flex: none;
	width: auto;
	min-width: 4.2em;
	min-height: 0;
	margin: 0;
	padding: 0.28rem 0.6rem;
	font: inherit;
	font-size: 0.82em;
	font-weight: 600;
	line-height: 1.35;
	letter-spacing: normal;
	text-align: center;
	text-transform: none;
	color: var(--dcc-ink);
	background: #fff;
	border: 1px solid var(--dcc-rule-strong);
	border-radius: 6px;
	box-shadow: none;
	cursor: pointer;
}

.dcc .dcc__copy:hover {
	color: var(--dcc-ink);
	background: var(--dcc-mist);
}

.dcc .dcc__copy.is-copied,
.dcc .dcc__copy.is-copied:hover {
	color: var(--dcc-ledger);
	background: var(--dcc-ledger-wash);
	border-color: var(--dcc-ledger);
}

.dcc .dcc__copy:focus-visible {
	outline: 2px solid var(--dcc-ledger);
	outline-offset: 2px;
}

.dcc .dcc__equivalent {
	font-weight: 600;
}

.dcc .dcc__warning {
	padding: 0.5rem 0.7rem;
	font-size: 0.86em;
	color: var(--dcc-caution);
	background: var(--dcc-caution-wash);
	border-radius: 6px;
}

.dcc .dcc__note,
.dcc .dcc__after {
	font-size: 0.9em;
	color: var(--dcc-slate);
}

/* After the order is placed */

.dcc--order {
	margin: 1.5rem 0;
}

.dcc .dcc__title {
	margin: 0;
}

.dcc__description {
	margin: 0 0 0.75rem;
}

.dcc .dcc__sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* The QR code moves beside the details once there's room. */
@media (min-width: 640px) {
	.dcc .dcc__details {
		grid-template-columns: 10rem minmax(0, 1fr);
		gap: 1.4rem;
	}

	.dcc .dcc__qr {
		align-self: start;
	}
}
