/**
 * Fastcoo Tracking — front-end styles.
 * All selectors are scoped to .fastcoo-tracker so the theme is not affected.
 */

.fastcoo-tracker {
	--fastcoo-accent: #cb2f3d;
	--fastcoo-accent-strong: #b82030;
	--fastcoo-accent-contrast: #ffffff;
	--fastcoo-bg: #ffffff;
	--fastcoo-bg-soft: #eef3ff;
	--fastcoo-text: #1e2f5f;
	--fastcoo-muted: #70798a;
	--fastcoo-border: #e1e8f6;
	--fastcoo-border-strong: #cbd6ef;
	--fastcoo-radius: 20px;
	--fastcoo-radius-sm: 12px;
	--fastcoo-shadow: 0 12px 36px rgba(30, 47, 95, 0.08);
	--fastcoo-success: #15803d;
	--fastcoo-success-bg: #dcfce7;
	--fastcoo-info: #1d4ed8;
	--fastcoo-info-bg: #dbeafe;
	--fastcoo-warning: #b45309;
	--fastcoo-warning-bg: #fef3c7;
	--fastcoo-danger: #b91c1c;
	--fastcoo-danger-bg: #fee2e2;

	box-sizing: border-box;
	position: relative;
	width: 100vw;
	max-width: none;
	margin: 0 calc(50% - 50vw);
	padding: 0;
	border: 0;
	border-radius: 0;
	background: var(--fastcoo-bg);
	color: var(--fastcoo-text);
	box-shadow: none;
	font-size: 1rem;
	line-height: 1.65;
	text-align: start;
	overflow: hidden;
}

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

.fastcoo-tracker .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.fastcoo-tracker__head {
	max-width: 720px;
	margin: 0 auto 1.5rem;
	text-align: center;
}

.fastcoo-tracker__title {
	margin: 0 0 0.45rem;
	padding: 0;
	font-size: clamp(2.1rem, 5vw, 3.4rem);
	line-height: 1.15;
	color: #ffffff;
	font-weight: 800;
}

.fastcoo-tracker__subtitle {
	margin: 0;
	color: rgba(255, 255, 255, 0.84);
	font-size: clamp(0.95rem, 1.7vw, 1.1rem);
}

.fastcoo-tracker__hero {
	position: relative;
	display: grid;
	min-height: 350px;
	place-items: center;
	padding: clamp(3.5rem, 8vw, 6rem) 1.25rem 2.75rem;
	background:
		linear-gradient(180deg, rgba(20, 43, 82, 0.72), rgba(28, 46, 91, 0.96)),
		url("https://nip.sa/wp-content/uploads/2026/11/magnific__-169-__14043-2.png") center 48% / cover no-repeat,
		#1e2f5f;
}

.fastcoo-tracker__hero-inner {
	width: min(100%, 760px);
	margin: 0 auto;
}

.fastcoo-tracker__form {
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
	align-items: stretch;
	max-width: 550px;
	margin: 0 auto 0.6rem;
}

.fastcoo-tracker .fastcoo-tracker__form input[type="search"],
.fastcoo-tracker .fastcoo-tracker__form input[type="text"] {
	flex: 1 1 auto;
	width: 100%;
	min-width: 0;
	margin: 0;
	min-height: 54px;
	padding: 0.85rem 1rem;
	border: 1px solid transparent;
	border-radius: var(--fastcoo-radius-sm);
	background: #f0f4ff;
	color: var(--fastcoo-text);
	font: inherit;
	line-height: 1.4;
	box-shadow: none;
	appearance: none;
}

.fastcoo-tracker .fastcoo-tracker__form input[type="search"]:focus,
.fastcoo-tracker .fastcoo-tracker__form input[type="text"]:focus {
	border-color: var(--fastcoo-accent);
	outline: 3px solid rgba(203, 47, 61, 0.22);
	outline-offset: 1px;
}

.fastcoo-tracker .fastcoo-tracker__submit {
	flex: 0 0 auto;
	margin: 0;
	min-height: 52px;
	padding: 0.8rem 1.35rem;
	border: 1px solid var(--fastcoo-accent);
	border-radius: var(--fastcoo-radius-sm);
	background: var(--fastcoo-accent);
	color: var(--fastcoo-accent-contrast);
	font: inherit;
	font-weight: 700;
	line-height: 1.4;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}

.fastcoo-tracker .fastcoo-tracker__submit:hover {
	background: var(--fastcoo-accent-strong);
	border-color: var(--fastcoo-accent-strong);
	color: var(--fastcoo-accent-contrast);
}

.fastcoo-tracker .fastcoo-tracker__submit:active {
	transform: translateY(1px);
}

.fastcoo-tracker .fastcoo-tracker__submit:focus-visible {
	outline: 3px solid color-mix(in srgb, var(--fastcoo-accent) 35%, transparent);
	outline-offset: 2px;
}

.fastcoo-tracker__hint {
	max-width: 550px;
	margin: 0 auto;
	color: rgba(255, 255, 255, 0.74);
	font-size: 0.84rem;
	text-align: center;
}

.fastcoo-tracker__result:empty,
.fastcoo-tracker__result.is-empty {
	display: none;
}

.fastcoo-tracker__result:not(:empty) {
	max-width: 1000px;
	margin: 0 auto;
	padding: 1.5rem 1.25rem 3rem;
}

/* Notices */
.fastcoo-notice {
	margin: 0.9rem 0;
	padding: 0.85rem 1rem;
	border: 1px solid var(--fastcoo-border);
	border-radius: var(--fastcoo-radius-sm);
	background: var(--fastcoo-bg-soft);
}

.fastcoo-notice strong {
	display: block;
	margin-bottom: 0.15rem;
}

.fastcoo-notice p {
	margin: 0;
}

.fastcoo-notice code {
	padding: 0.1rem 0.35rem;
	border-radius: 6px;
	background: rgba(15, 23, 42, 0.07);
	font-size: 0.9em;
}

.fastcoo-notice--error {
	border-color: #fecaca;
	background: var(--fastcoo-danger-bg);
	color: #7f1d1d;
}

.fastcoo-notice--empty {
	border-color: var(--fastcoo-border-strong);
	background: var(--fastcoo-bg-soft);
}

.fastcoo-notice--warning {
	border-color: #fde68a;
	background: var(--fastcoo-warning-bg);
	color: #78350f;
}

/* Result header */
.fastcoo-result {
	max-width: 900px;
	margin: 0 auto;
	padding: 1.5rem 1.25rem;
	border: 0;
	border-top: 3px solid var(--fastcoo-text);
	border-radius: 0 0 var(--fastcoo-radius) var(--fastcoo-radius);
	background: #ffffff;
	box-shadow: var(--fastcoo-shadow);
}

.fastcoo-result__head {
	display: flex;
	gap: 1rem;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 1.5rem;
}

.fastcoo-result__identity {
	min-width: 0;
}

.fastcoo-result__eyebrow {
	display: block;
	margin-bottom: 0.15rem;
	color: var(--fastcoo-muted);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.fastcoo-result__awb {
	margin: 0 0 0.5rem;
	padding: 0;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
	font-size: clamp(1.2rem, 2.4vw, 1.55rem);
	line-height: 1.25;
	word-break: break-word;
	color: var(--fastcoo-text);
}

.fastcoo-result__badges {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	align-items: center;
}

.fastcoo-tracker .fastcoo-result__refresh {
	flex: 0 0 auto;
	display: inline-block;
	padding: 0.45rem 0.8rem;
	border: 1px solid var(--fastcoo-border-strong);
	border-radius: 999px;
	background: var(--fastcoo-bg);
	color: var(--fastcoo-text);
	font-size: 0.85rem;
	font-weight: 600;
	line-height: 1.4;
	text-decoration: none;
	white-space: nowrap;
}

.fastcoo-tracker .fastcoo-result__refresh:hover {
	border-color: var(--fastcoo-accent);
	color: var(--fastcoo-accent);
	background: var(--fastcoo-bg);
}

/* Badges */
.fastcoo-badge {
	display: inline-flex;
	gap: 0.35rem;
	align-items: baseline;
	padding: 0.25rem 0.65rem;
	border: 1px solid transparent;
	border-radius: 999px;
	background: var(--fastcoo-bg-soft);
	color: var(--fastcoo-text);
	font-size: 0.82rem;
	font-weight: 700;
	line-height: 1.5;
}

.fastcoo-badge__code {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
	font-size: 0.7rem;
	font-weight: 600;
	opacity: 0.7;
}

.fastcoo-badge.is-processing {
	border-color: #bfdbfe;
	background: var(--fastcoo-info-bg);
	color: #1e3a8a;
}

.fastcoo-badge.is-transit {
	border-color: #fde68a;
	background: var(--fastcoo-warning-bg);
	color: #78350f;
}

.fastcoo-badge.is-delivered {
	border-color: #bbf7d0;
	background: var(--fastcoo-success-bg);
	color: #14532d;
}

.fastcoo-badge.is-hold {
	border-color: var(--fastcoo-border-strong);
	background: #f1f5f9;
	color: #334155;
}

.fastcoo-badge.is-unknown {
	border-color: var(--fastcoo-border);
	background: var(--fastcoo-bg-soft);
	color: var(--fastcoo-muted);
}

.fastcoo-badge--final {
	border-color: var(--fastcoo-border-strong);
	background: transparent;
	color: var(--fastcoo-muted);
	font-weight: 600;
}

/* Field grid */
.fastcoo-fields {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.8rem;
	max-width: 650px;
	margin: 0 auto 1.5rem;
}

.fastcoo-field {
	min-width: 0;
	padding: 0.9rem 1rem;
	border: 0;
	border-radius: 17px;
	background: var(--fastcoo-bg-soft);
}

.fastcoo-field__label {
	display: block;
	margin-bottom: 0.15rem;
	color: var(--fastcoo-muted);
	font-size: 0.76rem;
	font-weight: 600;
	line-height: 1.4;
}

.fastcoo-field__value {
	display: block;
	color: var(--fastcoo-text);
	font-size: 0.95rem;
	font-weight: 700;
	line-height: 1.5;
	word-break: break-word;
}

.fastcoo-field__value--mono {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
	font-size: 0.9rem;
	letter-spacing: 0.01em;
}

/* Receiver */
.fastcoo-receiver {
	margin: 0 0 1.1rem;
	padding: 0.9rem;
	border: 1px solid var(--fastcoo-border);
	border-radius: var(--fastcoo-radius-sm);
	background: #ffffff;
}

.fastcoo-receiver h4 {
	margin: 0 0 0.6rem;
	padding: 0;
	font-size: 0.95rem;
	color: var(--fastcoo-text);
}

.fastcoo-receiver .fastcoo-fields {
	margin-bottom: 0;
}

/* Timeline */
.fastcoo-timeline-block {
	max-width: 780px;
	margin: 2rem auto 0;
}

.fastcoo-timeline-block__head {
	display: flex;
	gap: 0.75rem;
	align-items: baseline;
	justify-content: space-between;
	margin-bottom: 1rem;
	padding-bottom: 0.75rem;
	border-bottom: 1px solid var(--fastcoo-border);
}

.fastcoo-timeline-block__head h4 {
	margin: 0;
	padding: 0;
	font-size: clamp(1.15rem, 2.4vw, 1.45rem);
	color: var(--fastcoo-text);
}

.fastcoo-muted {
	color: var(--fastcoo-muted);
	font-size: 0.82rem;
}

.fastcoo-empty {
	margin: 0;
	padding: 0.9rem 1rem;
	border: 1px dashed var(--fastcoo-border-strong);
	border-radius: var(--fastcoo-radius-sm);
	color: var(--fastcoo-muted);
}

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

.fastcoo-timeline__item {
	position: relative;
	margin: 0;
	padding: 0 0 1rem 1.35rem;
	border-inline-start: 2px solid var(--fastcoo-border);
}

.fastcoo-tracker[dir="rtl"] .fastcoo-timeline__item {
	padding: 0 1.35rem 1rem 0;
}

.fastcoo-timeline__item:last-child {
	padding-bottom: 0;
	border-inline-start-color: transparent;
}

.fastcoo-timeline__dot {
	position: absolute;
	inset-inline-start: -0.42rem;
	top: 0.3rem;
	width: 0.7rem;
	height: 0.7rem;
	border: 2px solid var(--fastcoo-bg);
	border-radius: 50%;
	background: var(--fastcoo-border-strong);
	box-shadow: 0 0 0 1px var(--fastcoo-border-strong);
}

.fastcoo-timeline__dot.is-processing {
	background: var(--fastcoo-info);
	box-shadow: 0 0 0 1px var(--fastcoo-info);
}

.fastcoo-timeline__dot.is-transit {
	background: var(--fastcoo-warning);
	box-shadow: 0 0 0 1px var(--fastcoo-warning);
}

.fastcoo-timeline__dot.is-delivered {
	background: var(--fastcoo-success);
	box-shadow: 0 0 0 1px var(--fastcoo-success);
}

.fastcoo-timeline__dot.is-hold {
	background: #64748b;
	box-shadow: 0 0 0 1px #64748b;
}

.fastcoo-timeline__body {
	min-width: 0;
}

.fastcoo-timeline__top {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem 0.55rem;
	align-items: baseline;
}

.fastcoo-timeline__status {
	color: var(--fastcoo-text);
	font-size: 0.95rem;
	line-height: 1.45;
}

.fastcoo-timeline__code {
	padding: 0.05rem 0.35rem;
	border-radius: 5px;
	background: var(--fastcoo-bg-soft);
	color: var(--fastcoo-muted);
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
	font-size: 0.7rem;
	font-weight: 600;
}

.fastcoo-timeline__time {
	margin-inline-start: auto;
	color: var(--fastcoo-muted);
	font-size: 0.8rem;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.fastcoo-timeline__meta {
	margin-top: 0.15rem;
	color: var(--fastcoo-muted);
	font-size: 0.84rem;
	line-height: 1.55;
}

.fastcoo-timeline__comment {
	margin: 0.35rem 0 0;
	padding: 0.45rem 0.65rem;
	border-inline-start: 3px solid var(--fastcoo-border-strong);
	background: var(--fastcoo-bg-soft);
	color: var(--fastcoo-text);
	font-size: 0.86rem;
	line-height: 1.55;
	white-space: pre-wrap;
}

/* Responsive */
@media (max-width: 640px) {
	.fastcoo-tracker {
		margin: 0 calc(50% - 50vw);
		padding: 0;
		border-radius: 0;
	}

	.fastcoo-tracker__hero {
		min-height: 320px;
		padding: 3.5rem 1rem 2rem;
		background-position: center center;
	}

	.fastcoo-tracker__result:not(:empty) {
		padding: 1.25rem 1rem 2rem;
	}

	.fastcoo-tracker__form {
		flex-direction: column;
	}

	.fastcoo-tracker__submit {
		width: 100%;
	}

	.fastcoo-result__head {
		flex-direction: column;
	}

	.fastcoo-result__refresh {
		align-self: flex-start;
	}

	.fastcoo-fields {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.fastcoo-timeline__time {
		margin-inline-start: 0;
		width: 100%;
	}
}

@media (max-width: 420px) {
	.fastcoo-fields {
		grid-template-columns: 1fr;
	}

	.fastcoo-result {
		padding: 1rem 0.85rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.fastcoo-tracker * {
		transition: none !important;
	}
}
