/*
 * KeyNhanh License Delivery – keys shown to customers (order-received page, Tài khoản, [license_keys]).
 * Same look as the site's cart/checkout (mu-plugins/kn-checkout): cream paper, 2px ink border, offset shadow.
 * Uses the site's colour/font variables when present, with the same fallbacks.
 * Selectors start with .tld-keys so Hello's button reset and the Elementor kit (a, h2, h3) do not win.
 */

.tld-keys {
	--t-kem: var(--kem, #FFF4E8);
	--t-giay: var(--giay, #FFFBF6);
	--t-muc: var(--muc, #1C1410);
	--t-cam: var(--cam-lua, #FF5A1F);
	--t-cam-dam: var(--cam-dam, #C2410C);
	--t-chanh: var(--chanh, #D4FF3A);
	--t-phu: var(--chu-phu, #6B5A4E);
	--t-line: rgba(28, 20, 16, .14);
	--t-h: var(--font-tieu-de, 'Bricolage Grotesque'), system-ui, sans-serif;
	--t-b: var(--font-noi-dung, 'Be Vietnam Pro'), system-ui, sans-serif;
	--t-m: var(--font-so, 'JetBrains Mono'), ui-monospace, monospace;

	box-sizing: border-box;
	margin: 0;
	padding: 28px;
	background: var(--t-giay);
	border: 2px solid var(--t-muc);
	border-radius: 16px;
	box-shadow: 6px 6px 0 var(--t-muc);
	font: 400 16px/1.55 var(--t-b);
	color: var(--t-muc);
}
.tld-keys *,
.tld-keys *::before,
.tld-keys *::after {
	box-sizing: border-box;
}
.tld-keys--waiting {
	box-shadow: 4px 4px 0 var(--t-muc);
	border-left-width: 10px;
	border-left-color: var(--t-chanh);
}

/* Same size as the other card headings on the order-received and account pages. */
.tld-keys .tld-keys__title {
	margin: 0 0 8px;
	font: 700 22px/1.25 var(--t-h);
	letter-spacing: -.01em;
	color: var(--t-muc);
}
.tld-keys .tld-keys__intro,
.tld-keys .tld-keys__notice,
.tld-keys .tld-keys__help {
	margin: 0 0 16px;
	font-size: 15px;
	line-height: 1.55;
	color: var(--t-phu);
}
.tld-keys .tld-keys__intro strong {
	color: var(--t-muc);
	overflow-wrap: anywhere;
}
.tld-keys .tld-keys__notice {
	padding: 10px 14px;
	background: #FFE3D6;
	border: 2px solid var(--t-muc);
	border-radius: 12px;
	color: var(--t-muc);
}
.tld-keys .tld-keys__help {
	margin: 20px 0 0;
	padding-top: 16px;
	border-top: 1.5px dashed rgba(28, 20, 16, .25);
	font-size: 14px;
}
.tld-keys a:not(.tld-btn) {
	color: var(--t-muc);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}
.tld-keys a:not(.tld-btn):hover {
	color: var(--t-cam-dam);
}

/* ---------- Key cards ---------- */
.tld-keys .tld-keys__list {
	display: grid;
	gap: 14px;
	margin: 16px 0 0;
	padding: 0;
	list-style: none;
}
.tld-keys .tld-key {
	margin: 0;
	padding: 16px 18px;
	background: #fff;
	border: 2px solid var(--t-muc);
	border-radius: 14px;
}
.tld-keys .tld-key__head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 4px 12px;
	margin: 0 0 10px;
}
.tld-keys .tld-key__product {
	font: 700 17px/1.3 var(--t-h);
	color: var(--t-muc);
}
.tld-keys .tld-key__term {
	padding: 2px 10px;
	background: var(--t-chanh);
	border: 1.5px solid var(--t-muc);
	border-radius: 999px;
	font: 700 12.5px/1.5 var(--t-m);
	white-space: nowrap;
	color: var(--t-muc);
}
.tld-keys .tld-key__row {
	display: grid;
	grid-template-columns: minmax(96px, 120px) minmax(0, 1fr) auto;
	gap: 6px 12px;
	align-items: center;
	padding: 10px 0;
	border-top: 1px solid var(--t-line);
}
.tld-keys .tld-key__label {
	font: 600 13px/1.4 var(--t-b);
	color: var(--t-phu);
}
.tld-keys .tld-key__value {
	display: block;
	min-width: 0;
	margin: 0;
	padding: 0;
	background: none;
	border: 0;
	font: 700 16px/1.45 var(--t-m);
	letter-spacing: .02em;
	color: var(--t-muc);
	overflow-wrap: anywhere;
	user-select: all;
}
.tld-keys .tld-key__actions {
	display: inline-flex;
	gap: 8px;
}
.tld-keys .tld-key__extra,
.tld-keys .tld-key__meta {
	margin: 8px 0 0;
	font-size: 13.5px;
	color: var(--t-phu);
}

/* ---------- Buttons ---------- */
.tld-keys .tld-btn,
.tld-keys .tld-btn:focus {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	margin: 0;
	padding: 6px 14px;
	background: var(--t-giay);
	border: 2px solid var(--t-muc);
	border-radius: 10px;
	box-shadow: none;
	font: 700 14px/1.2 var(--t-b);
	color: var(--t-muc);
	text-decoration: none;
	text-transform: none;
	white-space: nowrap;
	cursor: pointer;
}
.tld-keys .tld-btn:hover {
	background: var(--t-muc);
	border-color: var(--t-muc);
	color: var(--t-kem);
}
.tld-keys .tld-btn:focus-visible {
	outline: 3px solid var(--t-cam-dam);
	outline-offset: 2px;
}
.tld-keys .tld-btn.is-done,
.tld-keys .tld-btn.is-done:hover {
	background: var(--t-chanh);
	color: var(--t-muc);
}
.tld-keys .tld-btn--ghost,
.tld-keys .tld-btn--ghost:focus {
	background: transparent;
}
.tld-keys a.tld-btn--primary,
.tld-keys a.tld-btn--primary:focus {
	min-height: 48px;
	padding: 10px 20px;
	background: var(--t-cam);
	box-shadow: 3px 3px 0 var(--t-muc);
	font: 800 16px/1.2 var(--t-h);
	color: var(--t-muc);
}
.tld-keys a.tld-btn--primary:hover {
	background: var(--t-cam);
	color: var(--t-muc);
	transform: translate(-1px, -1px);
	box-shadow: 4px 4px 0 var(--t-muc);
}

/* ---------- Per-product installer + note ---------- */
.tld-keys .tld-guide {
	margin: 16px 0 0;
	padding: 14px 16px;
	background: var(--t-kem);
	border: 2px dashed rgba(28, 20, 16, .35);
	border-radius: 14px;
}
.tld-keys .tld-guide__title {
	margin: 0 0 6px;
	font: 700 16px/1.3 var(--t-h);
	color: var(--t-muc);
}
.tld-keys .tld-guide__text {
	font-size: 14.5px;
	line-height: 1.55;
}
.tld-keys .tld-guide__text p {
	margin: 0 0 8px;
}
.tld-keys .tld-guide__text p:last-child {
	margin-bottom: 0;
}
.tld-keys .tld-guide__action {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin: 10px 0 0;
}

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

/* ---------- Phones ---------- */
@media (max-width: 767px) {
	.tld-keys {
		padding: 20px;
		box-shadow: 4px 4px 0 var(--t-muc);
	}
	.tld-keys .tld-key {
		padding: 14px;
	}
	.tld-keys .tld-key__row {
		grid-template-columns: minmax(0, 1fr) auto;
	}
	.tld-keys .tld-key__label {
		grid-column: 1 / -1;
	}
	.tld-keys .tld-key__value {
		font-size: 15px;
	}
	.tld-keys .tld-btn,
	.tld-keys .tld-btn:focus {
		min-height: 44px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tld-keys a.tld-btn--primary:hover {
		transform: none;
	}
}
