/**
 * Upaya Order Tracking
 *
 * Palette taken from upaya.com.np: navy #003d87, deep navy #1d1b4c,
 * blue #077cfa, orange #ff5527, body text #333, panel #eceef2.
 * Everything is scoped under .uot so it cannot leak into the theme.
 */

.uot {
	--uot-navy: #003d87;
	--uot-navy-deep: #1d1b4c;
	--uot-blue: #077cfa;
	--uot-orange: #ff5527;
	--uot-green: #12855a;
	--uot-amber: #b26a00;
	--uot-red: #c0392b;

	--uot-ink: #1d1b4c;
	--uot-body: #333333;
	--uot-muted: #6b7280;
	--uot-line: #dce1e7;
	--uot-panel: #eceef2;
	--uot-surface: #ffffff;
	--uot-shell: #f6f8fb;

	--uot-radius: 14px;
	--uot-radius-sm: 9px;
	--uot-shadow: 0 1px 2px rgba(29, 27, 76, .05), 0 8px 24px rgba(0, 61, 135, .06);

	--uot-max-width: 780px;

	box-sizing: border-box;
	width: 100%;
	max-width: var(--uot-max-width);
	margin-inline: auto;
	color: var(--uot-body);
	font-size: 15px;
	line-height: 1.55;
	text-align: left;
}

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

.uot--align-left {
	margin-inline: 0;
}

.uot--font-montserrat,
.uot--font-montserrat button,
.uot--font-montserrat input {
	font-family: Montserrat, "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.uot--font-poppins,
.uot--font-poppins button,
.uot--font-poppins input {
	font-family: Poppins, "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ---------- Header ---------- */

.uot-header {
	margin: 0 0 20px;
	text-align: center;
}

.uot--align-left .uot-header {
	text-align: left;
}

.uot-header__title {
	margin: 0 0 6px;
	color: var(--uot-navy-deep);
	font-size: clamp(22px, 3.4vw, 30px);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -.01em;
}

.uot-header__subtitle {
	margin: 0;
	color: var(--uot-muted);
	font-size: 15px;
}

/* ---------- Cards ---------- */

.uot-card {
	margin: 0 0 14px;
	padding: 20px;
	background: var(--uot-surface);
	border: 1px solid var(--uot-line);
	border-radius: var(--uot-radius);
	box-shadow: var(--uot-shadow);
}

.uot-card:last-child {
	margin-bottom: 0;
}

.uot-card__title {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 16px;
	color: var(--uot-navy-deep);
	font-size: 16px;
	font-weight: 700;
	letter-spacing: -.005em;
}

.uot-eyebrow {
	margin: 0 0 4px;
	color: var(--uot-muted);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .07em;
	text-transform: uppercase;
}

/* ---------- Form ---------- */

.uot-form__label {
	display: block;
	margin-bottom: 6px;
	color: var(--uot-navy-deep);
	font-size: 13px;
	font-weight: 600;
}

.uot-form__control {
	display: flex;
	gap: 10px;
	align-items: stretch;
	flex-wrap: wrap;
}

.uot-form__input {
	flex: 1 1 240px;
	min-width: 0;
	padding: 12px 14px;
	color: var(--uot-navy-deep);
	font: inherit;
	font-size: 15px;
	letter-spacing: .02em;
	background: var(--uot-surface);
	border: 1.5px solid var(--uot-line);
	border-radius: var(--uot-radius-sm);
	transition: border-color .15s ease, box-shadow .15s ease;
}

.uot-form__input::placeholder {
	color: #9aa3b0;
	letter-spacing: 0;
}

.uot-form__input:focus {
	outline: none;
	border-color: var(--uot-navy);
	box-shadow: 0 0 0 3px rgba(7, 124, 250, .16);
}

.uot-form__input.is-invalid {
	border-color: var(--uot-orange);
	box-shadow: 0 0 0 3px rgba(255, 85, 39, .14);
}

.uot-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-width: 132px;
	padding: 12px 26px;
	color: #fff;
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
	background: var(--uot-navy);
	border: 0;
	border-radius: var(--uot-radius-sm);
	cursor: pointer;
	transition: background-color .15s ease, transform .1s ease;
}

.uot-btn:hover,
.uot-btn:focus-visible {
	color: #fff;
	background: #002d66;
}

.uot-btn:active {
	transform: translateY(1px);
}

.uot-btn:focus-visible {
	outline: 3px solid rgba(7, 124, 250, .35);
	outline-offset: 2px;
}

.uot-btn[disabled] {
	opacity: .7;
	cursor: progress;
}

.uot-btn__spinner {
	display: none;
	width: 15px;
	height: 15px;
	border: 2px solid rgba(255, 255, 255, .45);
	border-top-color: #fff;
	border-radius: 50%;
	animation: uot-spin .7s linear infinite;
}

.uot-btn.is-loading .uot-btn__spinner {
	display: block;
}

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

.uot-form__hint {
	margin: 8px 0 0;
	color: var(--uot-muted);
	font-size: 12.5px;
}

/* ---------- Notice ---------- */

.uot-notice {
	display: flex;
	gap: 11px;
	align-items: flex-start;
	margin-top: 14px;
	padding: 15px 17px;
	color: #7c2d12;
	font-size: 14.5px;
	background: #fff5f1;
	border: 1px solid #ffd7c7;
	border-radius: var(--uot-radius);
}

.uot-notice__icon {
	flex: 0 0 auto;
	width: 19px;
	height: 19px;
	margin-top: 1px;
	fill: none;
	stroke: var(--uot-orange);
	stroke-width: 1.7;
	stroke-linecap: round;
}

.uot-notice__icon .uot-dot {
	fill: var(--uot-orange);
	stroke: none;
}

/* ---------- Result ---------- */

.uot-result {
	margin-top: 14px;
	animation: uot-rise .32s ease both;
}

@keyframes uot-rise {
	from { opacity: 0; transform: translateY(8px); }
	to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.uot-result { animation: none; }
	.uot-btn__spinner { animation-duration: 2s; }
}

/* Summary */

.uot-summary__head {
	display: flex;
	flex-wrap: wrap;
	gap: 18px;
	justify-content: space-between;
	align-items: flex-start;
	padding-bottom: 18px;
	border-bottom: 1px solid var(--uot-line);
}

.uot-code {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	color: var(--uot-navy-deep);
	font-size: clamp(18px, 2.6vw, 22px);
	font-weight: 700;
	letter-spacing: -.01em;
	word-break: break-all;
}

.uot-copy {
	display: inline-flex;
	flex: 0 0 auto;
	padding: 5px;
	color: var(--uot-muted);
	background: transparent;
	border: 0;
	border-radius: 6px;
	cursor: pointer;
	transition: color .15s ease, background-color .15s ease;
}

.uot-copy:hover,
.uot-copy:focus-visible {
	color: var(--uot-navy);
	background: var(--uot-panel);
}

.uot-copy svg {
	width: 16px;
	height: 16px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.7;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.uot-copy.is-copied {
	color: var(--uot-green);
}

.uot-summary__ref {
	margin: 4px 0 0;
	color: var(--uot-muted);
	font-size: 12.5px;
}

.uot-summary__status {
	text-align: right;
}

/* The highlighted current status */

.uot-status {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 7px 15px 7px 13px;
	font-size: 14.5px;
	font-weight: 700;
	letter-spacing: -.005em;
	border-radius: 999px;
	border: 1.5px solid transparent;
}

.uot-status__pulse {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: currentColor;
	box-shadow: 0 0 0 0 currentColor;
	animation: uot-pulse 2.2s ease-out infinite;
}

@keyframes uot-pulse {
	0%   { box-shadow: 0 0 0 0 rgba(0, 0, 0, .28); }
	70%  { box-shadow: 0 0 0 7px rgba(0, 0, 0, 0); }
	100% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
	.uot-status__pulse { animation: none; }
}

.uot-status--progress {
	color: var(--uot-navy);
	background: #e7f0fb;
	border-color: #c3dbf6;
}

.uot-status--success {
	color: var(--uot-green);
	background: #e6f6ee;
	border-color: #b9e5cf;
}

.uot-status--warning {
	color: var(--uot-amber);
	background: #fff6e6;
	border-color: #ffe0ad;
}

.uot-status--danger {
	color: var(--uot-red);
	background: #fdeceb;
	border-color: #f7c9c5;
}

/* Facts */

.uot-facts {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 16px 20px;
	margin: 18px 0 0;
}

.uot-fact dt {
	margin: 0 0 3px;
	color: var(--uot-muted);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .07em;
	text-transform: uppercase;
}

.uot-fact dd {
	margin: 0;
	color: var(--uot-navy-deep);
	font-size: 14.5px;
	font-weight: 600;
}

/* Sender / receiver */

.uot-parties {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	gap: 18px;
	align-items: center;
}

.uot-party__name {
	margin: 0;
	color: var(--uot-navy-deep);
	font-size: 16px;
	font-weight: 700;
}

.uot-party__line {
	margin: 3px 0 0;
	color: var(--uot-body);
	font-size: 14px;
}

.uot-party__line--muted {
	color: var(--uot-muted);
	font-size: 12.5px;
}

.uot-party__arrow svg {
	width: 40px;
	height: 16px;
	fill: none;
	stroke: var(--uot-orange);
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* Timeline */

.uot-timeline {
	margin: 0;
	padding: 0;
	list-style: none;
}

.uot-timeline__item {
	position: relative;
	display: flex;
	gap: 14px;
	align-items: flex-start;
	padding: 0 0 20px 26px;
}

.uot-timeline__item.is-collapsed {
	display: none;
}

.uot-timeline.is-expanded .uot-timeline__item.is-collapsed {
	display: flex;
}

.uot-timeline__item::before {
	content: "";
	position: absolute;
	top: 16px;
	bottom: -4px;
	left: 5px;
	width: 2px;
	background: var(--uot-line);
}

.uot-timeline__item:last-child::before {
	display: none;
}

.uot-timeline__marker {
	position: absolute;
	top: 5px;
	left: 0;
	width: 12px;
	height: 12px;
	background: #fff;
	border: 3px solid var(--uot-line);
	border-radius: 50%;
}

.uot-timeline__item--progress .uot-timeline__marker { border-color: #9dc2ee; }
.uot-timeline__item--success  .uot-timeline__marker { border-color: #7fcfa8; }
.uot-timeline__item--warning  .uot-timeline__marker { border-color: #f0b459; }
.uot-timeline__item--danger   .uot-timeline__marker { border-color: #e79a92; }

.uot-timeline__item.is-current .uot-timeline__marker {
	width: 14px;
	height: 14px;
	left: -1px;
	top: 4px;
	border-width: 4px;
	border-color: var(--uot-navy);
	box-shadow: 0 0 0 4px rgba(0, 61, 135, .1);
}

.uot-timeline__item--warning.is-current .uot-timeline__marker {
	border-color: var(--uot-amber);
	box-shadow: 0 0 0 4px rgba(178, 106, 0, .12);
}

.uot-timeline__item--success.is-current .uot-timeline__marker {
	border-color: var(--uot-green);
	box-shadow: 0 0 0 4px rgba(18, 133, 90, .12);
}

.uot-timeline__item--danger.is-current .uot-timeline__marker {
	border-color: var(--uot-red);
	box-shadow: 0 0 0 4px rgba(192, 57, 43, .12);
}

.uot-timeline__body {
	flex: 1 1 auto;
	min-width: 0;
}

.uot-timeline__title {
	margin: 0;
	color: var(--uot-navy-deep);
	font-size: 14.5px;
	font-weight: 600;
	line-height: 1.35;
}

.uot-timeline__item.is-current .uot-timeline__title {
	color: var(--uot-navy);
	font-weight: 700;
}

.uot-timeline__item--warning.is-current .uot-timeline__title { color: var(--uot-amber); }
.uot-timeline__item--success.is-current .uot-timeline__title { color: var(--uot-green); }
.uot-timeline__item--danger.is-current  .uot-timeline__title { color: var(--uot-red); }

.uot-timeline__meta {
	margin: 2px 0 0;
	color: var(--uot-muted);
	font-size: 12.5px;
}

.uot-timeline__meta:empty {
	display: none;
}

.uot-timeline__time {
	flex: 0 0 auto;
	color: var(--uot-muted);
	font-size: 12.5px;
	text-align: right;
	white-space: nowrap;
}

.uot-timeline__time span {
	display: block;
	font-size: 12px;
	opacity: .85;
}

.uot-more {
	display: inline-flex;
	align-items: center;
	padding: 8px 16px;
	color: var(--uot-navy);
	font: inherit;
	font-size: 13.5px;
	font-weight: 600;
	background: var(--uot-panel);
	border: 0;
	border-radius: 999px;
	cursor: pointer;
	transition: background-color .15s ease;
}

.uot-more:hover,
.uot-more:focus-visible {
	background: #dfe4ec;
}

/* Hub */

.uot-hub__grid {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 18px;
	align-items: baseline;
}

.uot-hub__name {
	margin: 0;
	color: var(--uot-navy-deep);
	font-size: 15px;
	font-weight: 700;
}

.uot-hub__line {
	margin: 0;
	color: var(--uot-body);
	font-size: 14px;
}

.uot-hub__line a {
	color: var(--uot-navy);
	font-weight: 600;
	text-decoration: none;
	border-bottom: 1px solid rgba(0, 61, 135, .28);
}

.uot-hub__line a:hover {
	border-bottom-color: var(--uot-navy);
}

.uot-hub__person {
	margin-left: 8px;
	color: var(--uot-muted);
	font-size: 12.5px;
}

/* Skeleton */

.uot-skeleton {
	margin-top: 14px;
	padding: 20px;
	background: var(--uot-surface);
	border: 1px solid var(--uot-line);
	border-radius: var(--uot-radius);
}

.uot-skeleton__bar {
	height: 13px;
	margin-bottom: 12px;
	border-radius: 7px;
	background: linear-gradient(90deg, #eceef2 25%, #f6f8fb 50%, #eceef2 75%);
	background-size: 200% 100%;
	animation: uot-shimmer 1.3s infinite;
}

.uot-skeleton__bar--lg { width: 55%; height: 20px; }
.uot-skeleton__bar--sm { width: 35%; margin-bottom: 0; }

@keyframes uot-shimmer {
	0%   { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
	.uot-card {
		padding: 16px;
	}

	.uot-summary__head {
		flex-direction: column;
		gap: 14px;
	}

	.uot-summary__status {
		text-align: left;
	}

	.uot-parties {
		grid-template-columns: 1fr;
		gap: 12px;
	}

	.uot-party__arrow {
		transform: rotate(90deg);
		width: 40px;
	}

	.uot-form__control {
		flex-direction: column;
	}

	/* flex-basis becomes height once the row stacks. */
	.uot-form__input {
		flex: 0 0 auto;
		width: 100%;
	}

	.uot-btn {
		width: 100%;
	}

	.uot-party__arrow {
		margin-inline: auto;
	}

	.uot-timeline__item {
		flex-wrap: wrap;
		gap: 2px 14px;
	}

	.uot-timeline__time {
		flex-basis: 100%;
		text-align: left;
	}

	.uot-timeline__time span {
		display: inline;
		margin-left: 6px;
	}
}
