:root {
	--ink: #102033;
	--muted: #64748b;
	--line: #d8e0e8;
	--paper: #ffffff;
	--wash: #f5f8fb;
	--green: #19a974;
	--blue: #1264d8;
	--yellow: #ffcf33;
	--danger: #b42318;
	--shadow: 0 20px 60px rgba(16, 32, 51, 0.14);
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	color: var(--ink);
	background: linear-gradient(180deg, #f8fbfd 0%, #eef4f7 100%);
	font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
	font: inherit;
}

.topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	max-width: 1180px;
	margin: 0 auto;
	padding: 24px;
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	color: var(--ink);
	font-size: 1.25rem;
	font-weight: 800;
	text-decoration: none;
}

.brand img {
	display: block;
	filter: drop-shadow(0 10px 22px rgba(18, 100, 216, 0.25));
}

.topbar nav {
	display: flex;
	gap: 10px;
}

.topbar nav span {
	border: 1px solid var(--line);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.74);
	padding: 8px 14px;
	color: #334155;
	font-weight: 700;
}

.preview-mode {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: var(--muted);
	font-weight: 800;
}

.mode-switch {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: flex-end;
	min-width: 116px;
	min-height: 38px;
	border: 1px solid #b9c6d6;
	border-radius: 999px;
	background: #fff;
	color: var(--ink);
	cursor: pointer;
	font-weight: 900;
	padding: 0 14px 0 42px;
	transition: background 0.2s ease, color 0.2s ease;
}

.mode-switch::before {
	position: absolute;
	left: 6px;
	width: 26px;
	height: 26px;
	border-radius: 999px;
	background: var(--green);
	content: "";
	transition: left 0.2s ease, background 0.2s ease;
}

.mode-switch[aria-checked="true"] {
	justify-content: flex-start;
	background: var(--ink);
	color: #fff;
	padding: 0 42px 0 14px;
}

.mode-switch[aria-checked="true"]::before {
	left: calc(100% - 32px);
	background: var(--yellow);
}

main {
	max-width: 1180px;
	margin: 0 auto;
	padding: 12px 24px 48px;
}

.hero {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 420px;
	align-items: center;
	gap: 44px;
	min-height: 430px;
	padding: 28px 0 48px;
}

.eyebrow {
	margin: 0 0 14px;
	color: var(--green);
	font-weight: 900;
	letter-spacing: 0;
	text-transform: uppercase;
}

h1,
h2,
p {
	margin-top: 0;
}

h1 {
	max-width: 780px;
	margin-bottom: 20px;
	font-size: 5.15rem;
	line-height: 0.95;
	letter-spacing: 0;
}

.subline {
	max-width: 680px;
	color: #475569;
	font-size: 1.1rem;
	line-height: 1.65;
}

.label-preview {
	position: relative;
	min-height: 360px;
}

.parcel-card {
	position: absolute;
	inset: 10px 0 auto auto;
	width: min(100%, 390px);
	transform: rotate(2deg);
	border: 1px solid rgba(16, 32, 51, 0.12);
	border-radius: 8px;
	background: var(--paper);
	box-shadow: var(--shadow);
	padding: 22px;
}

.parcel-head,
.parcel-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	border-bottom: 2px solid var(--ink);
	padding-bottom: 14px;
	font-weight: 800;
}

.parcel-head strong {
	background: var(--yellow);
	border-radius: 4px;
	padding: 5px 8px;
}

.parcel-grid {
	display: grid;
	grid-template-columns: 150px 1fr;
	gap: 20px;
	padding: 24px 0;
}

.mock-qr {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 8px;
	aspect-ratio: 1;
	border: 8px solid #0b1f33;
	padding: 10px;
}

.mock-qr span {
	background: #0b1f33;
	min-height: 18px;
}

.mock-qr span:nth-child(3n),
.mock-qr span:nth-child(5n) {
	background: transparent;
}

.parcel-lines {
	display: grid;
	align-content: center;
	gap: 14px;
}

.parcel-lines i {
	display: block;
	height: 13px;
	background: #d7dee8;
	border-radius: 2px;
}

.parcel-lines i:nth-child(2) {
	width: 72%;
}

.parcel-lines i:nth-child(3) {
	width: 88%;
}

.parcel-lines i:nth-child(4) {
	width: 56%;
}

.parcel-foot {
	border-top: 1px solid var(--line);
	border-bottom: 0;
	color: var(--muted);
	font-size: 0.84rem;
	font-weight: 700;
	line-height: 1.4;
	padding: 16px 0 0;
}

.workspace {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 22px;
	align-items: start;
}

.workspace.is-step-one-only {
	grid-template-columns: minmax(0, 720px);
	justify-content: center;
}

.upload-panel,
.delivery-panel {
	border: 1px solid rgba(16, 32, 51, 0.12);
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.88);
	box-shadow: 0 10px 34px rgba(16, 32, 51, 0.08);
	padding: 24px;
}

.panel-head {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	margin-bottom: 22px;
}

.step {
	display: inline-grid;
	place-items: center;
	flex: 0 0 34px;
	width: 34px;
	height: 34px;
	border-radius: 999px;
	background: var(--ink);
	color: #fff;
	font-weight: 900;
}

.panel-head h2 {
	margin-bottom: 5px;
	font-size: 1.35rem;
	line-height: 1.15;
}

.panel-head p {
	margin-bottom: 0;
	color: var(--muted);
	line-height: 1.45;
}

.dropzone {
	display: grid;
	place-items: center;
	min-height: 220px;
	border: 2px dashed #b7c4d4;
	border-radius: 8px;
	background: #f8fbfd;
	padding: 28px;
	text-align: center;
	cursor: pointer;
	transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.dropzone:hover,
.dropzone.is-dragging,
.dropzone.is-processing {
	border-color: var(--blue);
	background: #eef7ff;
	transform: translateY(-1px);
}

.dropzone.is-processing {
	cursor: progress;
}

.dropzone input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
}

.drop-icon {
	display: grid;
	place-items: center;
	width: 72px;
	height: 72px;
	margin-bottom: 14px;
	border-radius: 20px;
	background: #e7f6ef;
	color: var(--green);
}

.drop-icon svg {
	width: 38px;
	height: 38px;
	fill: currentColor;
}

.upload-preview {
	width: min(160px, 52vw);
	height: min(160px, 52vw);
	margin-bottom: 16px;
	border: 1px solid #d4dee9;
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 10px 24px rgba(16, 32, 51, 0.12);
	object-fit: contain;
	padding: 10px;
}

.dropzone.has-preview .drop-icon {
	display: none;
}

.dropzone strong {
	font-size: 1.15rem;
}

.dropzone small {
	color: var(--muted);
}

label {
	display: grid;
	gap: 8px;
	margin-bottom: 16px;
	color: #334155;
	font-weight: 800;
}

.contact-fields {
	display: grid;
	grid-template-columns: 1fr;
	gap: 4px;
}

.contact-hint {
	margin: 0 0 10px;
	color: var(--muted);
	font-weight: 800;
	line-height: 1.35;
}

.contact-fields label {
	margin-bottom: 16px;
}

input[type="date"],
input[type="email"],
input[type="tel"],
input[type="text"],
select,
textarea {
	width: 100%;
	border: 1px solid #bdc9d6;
	border-radius: 8px;
	background: #fff;
	color: var(--ink);
}

input[type="date"],
input[type="email"],
input[type="tel"],
input[type="text"],
select {
	min-height: 50px;
	padding: 0 14px;
}

.phone-field {
	display: grid;
	grid-template-columns: 118px minmax(0, 1fr);
	gap: 0;
}

.phone-field select {
	border-right: 0;
	border-radius: 8px 0 0 8px;
	font-weight: 800;
}

.phone-field input {
	border-radius: 0 8px 8px 0;
}

.phone-status {
	display: block;
	margin-top: 7px;
	font-weight: 800;
	line-height: 1.35;
}

.phone-status.is-valid {
	color: #15803d;
}

.phone-status.is-invalid {
	color: var(--danger);
}

.phone-status[hidden] {
	display: none;
}

textarea {
	min-height: 132px;
	padding: 12px 14px;
	line-height: 1.45;
	resize: vertical;
}

input:disabled,
select:disabled,
textarea:disabled {
	background: #edf2f7;
	color: #8291a5;
}

.primary {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	min-height: 52px;
	border: 0;
	border-radius: 8px;
	background: var(--blue);
	color: #fff;
	font-weight: 900;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.2s ease;
}

.primary svg {
	width: 20px;
	height: 20px;
	fill: currentColor;
	flex: 0 0 20px;
}

.primary:hover:not(:disabled) {
	background: #0f55ba;
	transform: translateY(-1px);
}

.primary:disabled {
	background: #94a3b8;
	color: #fff;
	cursor: not-allowed;
}

.upload-panel .primary {
	margin-top: 18px;
}

.result-card {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
	margin-bottom: 10px;
	border: 1px solid var(--line);
	border-radius: 8px;
	background: #f8fbfd;
	padding: 14px;
}

.expiry-status {
	margin: 0 0 18px;
	font-weight: 900;
	line-height: 1.35;
}

.expiry-status.is-expired {
	color: var(--danger);
}

.expiry-status.is-valid {
	color: #15803d;
}

.expiry-status[hidden] {
	display: none;
}

.result-card div {
	min-width: 0;
}

.label {
	display: block;
	margin-bottom: 5px;
	color: var(--muted);
	font-size: 0.78rem;
	font-weight: 900;
	text-transform: uppercase;
}

.result-card strong {
	display: block;
	overflow-wrap: anywhere;
}

.tracking-value {
	font-size: clamp(0.88rem, 2.6vw, 1.08rem);
	line-height: 1.12;
	word-break: break-word;
}

.asset-preview-row {
	display: grid;
	gap: 16px;
	margin-top: 16px;
}

.asset-preview-row[hidden],
.qr-preview[hidden],
.pdf-preview[hidden] {
	display: none;
}

.asset-preview-row.is-compact {
	grid-template-columns: 184px 136px;
	align-items: start;
}

.qr-preview {
	display: grid;
	justify-items: start;
	gap: 10px;
	border: 1px solid var(--line);
	border-radius: 8px;
	background: #fff;
	padding: 14px;
}

.qr-preview img {
	width: 154px;
	height: 154px;
	border: 1px solid var(--line);
	border-radius: 6px;
	background: #fff;
	object-fit: contain;
}

.pdf-preview {
	display: grid;
	gap: 10px;
	border: 1px solid var(--line);
	border-radius: 8px;
	background: #fff;
	overflow: hidden;
	padding: 14px;
}

.pdf-preview iframe,
.pdf-preview img {
	width: 100%;
	height: auto;
	aspect-ratio: 105 / 160;
	border: 1px solid var(--line);
	border-radius: 6px;
	background: #edf2f7;
	pointer-events: none;
}

.asset-preview-row.is-compact .pdf-preview {
	width: 136px;
}

.asset-preview-row.is-compact .pdf-preview iframe,
.asset-preview-row.is-compact .pdf-preview img {
	height: 154px;
	aspect-ratio: auto;
}

.pdf-preview img {
	display: block;
	object-fit: contain;
}

.pdf-preview iframe[hidden],
.pdf-preview img[hidden] {
	display: none;
}

.marketing-prompts {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 18px;
	margin-top: 24px;
}

.marketing-prompts div {
	border: 1px solid rgba(16, 32, 51, 0.12);
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.78);
	padding: 18px;
}

.marketing-prompts strong,
.marketing-prompts span {
	display: block;
}

.marketing-prompts strong {
	font-size: 1.02rem;
	line-height: 1.25;
}

.marketing-prompts span {
	margin-top: 8px;
	color: var(--muted);
	line-height: 1.45;
}

.status-strip {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 18px;
	margin-top: 24px;
}

.status-strip div {
	border-left: 4px solid var(--green);
	background: rgba(255, 255, 255, 0.62);
	padding: 16px 18px;
}

.status-strip strong,
.status-strip span {
	display: block;
}

.status-strip span {
	margin-top: 5px;
	color: var(--muted);
	line-height: 1.45;
}

.toast {
	position: fixed;
	right: 20px;
	bottom: 20px;
	max-width: min(420px, calc(100vw - 40px));
	border-radius: 8px;
	background: var(--ink);
	color: #fff;
	box-shadow: var(--shadow);
	padding: 14px 16px;
	font-weight: 800;
	opacity: 0;
	transform: translateY(12px);
	pointer-events: none;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-visible {
	opacity: 1;
	transform: translateY(0);
}

.toast.is-error {
	background: var(--danger);
}

@media (max-width: 900px) {
	h1 {
		font-size: 3.7rem;
	}

	.hero,
	.workspace,
	.marketing-prompts,
	.status-strip {
		grid-template-columns: 1fr;
	}

	.hero {
		gap: 10px;
		padding-bottom: 32px;
	}

	.label-preview {
		min-height: 300px;
	}

	.parcel-card {
		position: relative;
		inset: auto;
		margin: 0 auto;
	}
}

@media (max-width: 620px) {
	.topbar {
		align-items: flex-start;
		flex-direction: column;
		padding: 18px;
	}

	main {
		padding: 0 18px 32px;
	}

	h1 {
		font-size: 2.55rem;
	}

	.parcel-grid,
	.result-card,
	.contact-fields {
		grid-template-columns: 1fr;
	}

	.asset-preview-row.is-compact {
		grid-template-columns: 184px 136px;
	}

	.mock-qr {
		width: 150px;
	}

	.upload-panel,
	.delivery-panel {
		padding: 18px;
	}
}
