:root {
	--brand: #01529D;
	--brand-dark: #013E78;
	--ink: #111827;
	--muted: #6b7280;
	--line: #e5e7eb;
	--bg1: #e8f1fb;
	--bg2: #f8fafc;
	--danger: #dc2626;
	--ok: #16a34a;
	--radius: 16px;
}

* { box-sizing: border-box; }

/* The hidden attribute must win over .alert/.success display rules. */
[hidden] { display: none !important; }

body {
	margin: 0;
	min-height: 100vh;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--ink);
	background: linear-gradient(160deg, var(--bg1), var(--bg2));
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: clamp(16px, 4vw, 40px);
}

.copyright {
	margin: 16px 0 0;
	font-size: 0.78rem;
	color: var(--muted);
	text-align: center;
}

.card {
	width: 100%;
	max-width: 560px;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: 0 20px 50px -12px rgba(1, 82, 157, 0.18);
	overflow: hidden;
}

/* Header band */
.head {
	background: linear-gradient(135deg, var(--brand), #0a74c9);
	color: #fff;
	padding: clamp(24px, 5vw, 36px) clamp(20px, 5vw, 36px);
}
.head-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	padding: 0;
	border: none;
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.16);
	color: #fff;
	margin-bottom: 16px;
	cursor: pointer;
	transition: background .15s;
}
.head-icon:hover { background: rgba(255, 255, 255, 0.28); }
.head-icon:active { transform: translateY(1px); }
.head-icon:focus-visible {
	outline: 3px solid rgba(255, 255, 255, 0.6);
	outline-offset: 2px;
}
.head h1 {
	margin: 0 0 10px;
	font-size: clamp(1.35rem, 4.5vw, 1.8rem);
	font-weight: 800;
	line-height: 1.2;
	letter-spacing: 0.2px;
}
.head p {
	margin: 0;
	font-size: clamp(0.92rem, 3vw, 1.02rem);
	opacity: 0.94;
}

.body { padding: clamp(20px, 5vw, 36px); }

.intro {
	color: var(--muted);
	font-size: 0.95rem;
	margin: 0 0 22px;
}

/* Status alert (order not found / request failed) */
.alert {
	display: flex;
	gap: 11px;
	align-items: flex-start;
	border-radius: 12px;
	padding: 14px 16px;
	font-size: 0.9rem;
	line-height: 1.45;
	margin-bottom: 22px;
}
.alert svg { flex: 0 0 auto; margin-top: 1px; }
.alert-error {
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #b91c1c;
}

.field { margin-bottom: 18px; }

label {
	display: block;
	font-weight: 600;
	font-size: 0.88rem;
	margin-bottom: 7px;
}

input[type="text"],
input[type="email"] {
	width: 100%;
	padding: 14px 16px;
	font-size: 1rem;
	font-family: inherit;
	color: var(--ink);
	border: 1.5px solid var(--line);
	border-radius: 12px;
	background: #fff;
	transition: border-color .15s, box-shadow .15s;
}
input[type="text"]:focus,
input[type="email"]:focus {
	outline: none;
	border-color: var(--brand);
	box-shadow: 0 0 0 4px rgba(1, 82, 157, 0.12);
}
.field.invalid input { border-color: var(--danger); }

/* Honeypot — off-screen, kept in the DOM for bot detection */
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* Live min-character indicator inside the order field */
.input-wrap { position: relative; }
.input-wrap input { padding-right: 52px; }
.min-counter {
	position: absolute;
	right: 12px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 0.78rem;
	font-weight: 600;
	color: var(--muted);
	pointer-events: none;
	font-variant-numeric: tabular-nums;
}
.min-counter.ok { color: var(--ok); }

.hint {
	color: var(--muted);
	font-size: 0.82rem;
	margin: 0 0 24px;
}

/* Lead-in line above the action button */
.cta-text {
	font-size: 0.9rem;
	color: var(--ink);
	margin: 0 0 12px;
}

.btn {
	display: block;
	width: 100%;
	padding: 16px 24px;
	font-size: 1.05rem;
	font-weight: 700;
	line-height: 1.3;
	color: #fff;
	background: var(--brand);
	border: none;
	border-radius: 12px;
	cursor: pointer;
	position: relative;
	overflow: hidden;
	transition: background .15s, transform .05s;
}
.btn:hover { background: var(--brand-dark); }
.btn:active { transform: translateY(1px); }
.btn:disabled { cursor: default; }
.btn:focus-visible {
	outline: 3px solid rgba(1, 82, 157, 0.4);
	outline-offset: 2px;
}

/* Loading state: hide the label, show the spinner */
.spinner {
	display: none;
	width: 1.2em;
	height: 1.2em;
	vertical-align: middle;
	border: 2.5px solid rgba(255, 255, 255, 0.45);
	border-top-color: #fff;
	border-radius: 50%;
	animation: spin .7s linear infinite;
}
.btn.is-loading { cursor: progress; }
.btn.is-loading .btn-label { display: none; }
.btn.is-loading .spinner { display: inline-block; }

@keyframes spin { to { transform: rotate(360deg); } }

/* Cooldown: a frosted overlay covers the button and "thaws" away left -> right */
.btn.is-cooldown { cursor: default; }
.btn.is-cooldown::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(90deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.5));
	-webkit-backdrop-filter: saturate(0.45) brightness(1.1);
	backdrop-filter: saturate(0.45) brightness(1.1);
	pointer-events: none;
	animation: cooldown-thaw var(--cooldown, 2500ms) linear forwards;
}
@keyframes cooldown-thaw {
	from { clip-path: inset(0 0 0 0); }
	to   { clip-path: inset(0 0 0 100%); }
}

input:disabled { opacity: .6; cursor: not-allowed; }

/* Success panel */
.success {
	text-align: center;
	padding: 14px 4px 6px;
}
.success-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: #dcfce7;
	color: var(--ok);
	margin-bottom: 16px;
}
.success p {
	margin: 0;
	font-size: 1rem;
	color: var(--ink);
}

/* Place the two lookup fields side by side on wider screens */
@media (min-width: 560px) {
	.grid {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 18px;
		margin-bottom: 18px;
	}
	.grid .field { margin-bottom: 0; }
}
