/*
 * NZDWorld Link Generator - popup styles.
 *
 * Design notes
 * ------------
 * The popup is deliberately "glass without blur": no backdrop-filter anywhere,
 * only a very light scrim, and a translucent surface that lets the page show
 * through. It also inherits the site's own font so it reads as part of the
 * theme instead of a separate widget.
 *
 * Every colour is a CSS custom property on the overlay, so a site owner can
 * adjust the look without touching the rest of the stylesheet, e.g.:
 *
 *   .nzd-lg-overlay { --nzd-lg-surface: rgba(255,255,255,0.72); --nzd-lg-text: #111827; }
 *
 * Self-contained (no framework) and scoped to the .nzd-lg- classes.
 */

.nzd-lg-overlay,
.nzd-lg-overlay *,
.nzd-lg-reopen {
	box-sizing: border-box;
}

.nzd-lg-overlay,
.nzd-lg-reopen {
	--nzd-lg-scrim: rgba(4, 8, 18, 0.28);
	--nzd-lg-surface: rgba(11, 17, 32, 0.62);
	--nzd-lg-surface-strong: rgba(11, 17, 32, 0.82);
	--nzd-lg-border: rgba(255, 255, 255, 0.16);
	--nzd-lg-text: #f8fafc;
	--nzd-lg-muted: rgba(229, 236, 246, 0.86);
	--nzd-lg-faint: rgba(203, 213, 225, 0.72);
	--nzd-lg-accent: #7cb3ff;
	--nzd-lg-accent-strong: #2563eb;
	--nzd-lg-ring-track: rgba(255, 255, 255, 0.16);
	--nzd-lg-danger-bg: rgba(127, 29, 29, 0.55);
	--nzd-lg-danger-text: #fecaca;
	--nzd-lg-shadow: 0 24px 60px rgba(2, 6, 23, 0.35), 0 2px 10px rgba(2, 6, 23, 0.18);
}

.nzd-lg-overlay {
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: var(--nzd-lg-scrim);
	-webkit-animation: nzd-lg-fade-in 0.22s ease-out;
	animation: nzd-lg-fade-in 0.22s ease-out;
}

.nzd-lg-overlay[hidden],
.nzd-lg-error[hidden],
.nzd-lg-ready[hidden],
.nzd-lg-waiting[hidden] {
	display: none !important;
}

.nzd-lg-modal {
	position: relative;
	width: 100%;
	max-width: 420px;
	max-height: calc(100vh - 40px);
	overflow-y: auto;
	padding: 30px 26px 26px;
	border: 1px solid var(--nzd-lg-border);
	border-radius: 18px;
	background: var(--nzd-lg-surface);
	color: var(--nzd-lg-text);
	box-shadow: var(--nzd-lg-shadow);
	text-align: center;
	font-family: inherit;
	font-size: 15px;
	line-height: 1.55;
	-webkit-animation: nzd-lg-pop 0.26s cubic-bezier(0.16, 1, 0.3, 1);
	animation: nzd-lg-pop 0.26s cubic-bezier(0.16, 1, 0.3, 1);
	outline: none;
}

.nzd-lg-modal:focus {
	outline: none;
}

.nzd-lg-close {
	position: absolute;
	top: 10px;
	right: 12px;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--nzd-lg-faint);
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.nzd-lg-close:hover,
.nzd-lg-close:focus-visible {
	background: rgba(255, 255, 255, 0.14);
	color: var(--nzd-lg-text);
}

.nzd-lg-head {
	margin-bottom: 18px;
}

.nzd-lg-preview {
	display: inline-block;
	margin: 0 0 12px;
	padding: 4px 10px;
	border: 1px solid rgba(245, 158, 11, 0.35);
	border-radius: 999px;
	background: rgba(245, 158, 11, 0.16);
	color: #fcd34d;
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

.nzd-lg-logo {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	margin: 0 auto 12px;
	border-radius: 16px;
	object-fit: contain;
}

.nzd-lg-logo-fallback {
	background: linear-gradient(135deg, #1d4ed8, #0ea5e9);
	color: #ffffff;
	box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

.nzd-lg-title {
	margin: 0 0 8px;
	font-size: 21px;
	line-height: 1.3;
	font-weight: 700;
	letter-spacing: -0.01em;
	color: var(--nzd-lg-text);
}

.nzd-lg-desc {
	margin: 0;
	color: var(--nzd-lg-muted);
	font-size: 14px;
}

.nzd-lg-ring-wrap {
	position: relative;
	width: 132px;
	height: 132px;
	margin: 6px auto 16px;
}

.nzd-lg-ring {
	display: block;
	width: 132px;
	height: 132px;
	transform: rotate(-90deg);
}

.nzd-lg-ring-track {
	fill: none;
	stroke: var(--nzd-lg-ring-track);
	stroke-width: 9;
}

.nzd-lg-ring-value {
	fill: none;
	stroke: var(--nzd-lg-accent);
	stroke-width: 9;
	stroke-linecap: round;
	stroke-dasharray: 326.73;
	stroke-dashoffset: 326.73;
	transition: stroke-dashoffset 0.3s linear;
}

.nzd-lg-seconds {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 34px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	color: var(--nzd-lg-text);
}

.nzd-lg-progress {
	width: 100%;
	height: 8px;
	border-radius: 999px;
	background: var(--nzd-lg-ring-track);
	overflow: hidden;
}

.nzd-lg-progress-bar {
	display: block;
	width: 0;
	height: 100%;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--nzd-lg-accent-strong), var(--nzd-lg-accent));
	transition: width 0.28s linear;
}

.nzd-lg-status {
	margin: 14px 0 0;
	font-size: 13.5px;
	color: var(--nzd-lg-muted);
}

.nzd-lg-status-seconds {
	display: block;
	margin-top: 2px;
	font-size: 12px;
	color: var(--nzd-lg-faint);
}

.nzd-lg-ready {
	padding: 6px 0 0;
}

.nzd-lg-check {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	margin-bottom: 10px;
	border: 1px solid rgba(134, 239, 172, 0.32);
	border-radius: 50%;
	background: rgba(34, 197, 94, 0.18);
	color: #86efac;
	-webkit-animation: nzd-lg-pop 0.3s ease-out;
	animation: nzd-lg-pop 0.3s ease-out;
}

.nzd-lg-ready-text {
	margin: 0 0 16px;
	color: var(--nzd-lg-muted);
	font-size: 14px;
}

.nzd-lg-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 50px;
	padding: 14px 22px;
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 12px;
	background: linear-gradient(135deg, #3b82f6, #1d4ed8);
	color: #ffffff !important;
	font-family: inherit;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none !important;
	cursor: pointer;
	box-shadow: 0 10px 24px rgba(37, 99, 235, 0.32);
	transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}

.nzd-lg-button:hover:not(:disabled),
.nzd-lg-button:focus-visible {
	transform: translateY(-1px);
	box-shadow: 0 14px 28px rgba(37, 99, 235, 0.38);
}

.nzd-lg-button:focus-visible {
	outline: 2px solid rgba(255, 255, 255, 0.65);
	outline-offset: 2px;
}

.nzd-lg-button:active:not(:disabled) {
	transform: translateY(0);
}

.nzd-lg-button:disabled {
	opacity: 0.65;
	cursor: progress;
}

.nzd-lg-error {
	padding: 6px 0 0;
}

.nzd-lg-error-text {
	margin: 0 0 16px;
	padding: 12px 14px;
	border: 1px solid rgba(248, 113, 113, 0.3);
	border-radius: 10px;
	background: var(--nzd-lg-danger-bg);
	color: var(--nzd-lg-danger-text);
	font-size: 14px;
	text-align: left;
}

.nzd-lg-error-actions {
	display: flex;
	flex-direction: column;
	gap: 12px;
	align-items: center;
}

.nzd-lg-link {
	color: var(--nzd-lg-accent);
	font-size: 13.5px;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.nzd-lg-noscript {
	margin: 14px 0 0;
	padding: 10px 12px;
	border-radius: 8px;
	background: rgba(245, 158, 11, 0.16);
	color: #fcd34d;
	font-size: 13px;
}

.nzd-lg-reopen {
	position: fixed;
	right: 18px;
	bottom: 18px;
	z-index: 2147482999;
	padding: 12px 18px;
	border: 1px solid var(--nzd-lg-border);
	border-radius: 999px;
	background: var(--nzd-lg-surface-strong);
	color: var(--nzd-lg-text);
	font-family: inherit;
	font-size: 13.5px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: var(--nzd-lg-shadow);
}

.nzd-lg-reopen[hidden] {
	display: none !important;
}

body.nzd-lg-open {
	overflow: hidden !important;
}

@-webkit-keyframes nzd-lg-fade-in {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes nzd-lg-fade-in {
	from { opacity: 0; }
	to { opacity: 1; }
}

@-webkit-keyframes nzd-lg-pop {
	from { opacity: 0; -webkit-transform: translateY(10px) scale(0.97); }
	to { opacity: 1; -webkit-transform: translateY(0) scale(1); }
}

@keyframes nzd-lg-pop {
	from { opacity: 0; transform: translateY(10px) scale(0.97); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 480px) {
	.nzd-lg-overlay {
		padding: 12px;
		align-items: flex-end;
	}

	.nzd-lg-modal {
		max-width: 100%;
		max-height: calc(100vh - 24px);
		padding: 26px 18px 20px;
		border-radius: 16px;
	}

	.nzd-lg-title {
		font-size: 19px;
	}

	.nzd-lg-ring-wrap,
	.nzd-lg-ring {
		width: 112px;
		height: 112px;
	}

	.nzd-lg-seconds {
		font-size: 29px;
	}

	.nzd-lg-button {
		min-height: 52px;
		font-size: 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.nzd-lg-overlay,
	.nzd-lg-modal,
	.nzd-lg-check,
	.nzd-lg-ring-value,
	.nzd-lg-progress-bar,
	.nzd-lg-button {
		-webkit-animation: none !important;
		animation: none !important;
		transition: none !important;
	}
}
