/*
 * Xypher global custom styles. Site-wide rules only — never put page CSS
 * in templates; add it here.
 */

/*
 * Scrollable tab bars.
 * Usage: <div class="scroll-tabs"><ul class="nav ...">…</ul></div>
 * The first child scrolls; arrows and edge fades are driven by xypher.js,
 * which toggles .at-start/.at-end on the wrapper.
 */
.scroll-tabs {
	position: relative;
}
.scroll-tabs > :first-child {
	flex-wrap: nowrap;
	white-space: nowrap;
	overflow-x: auto;
	scrollbar-width: none;
}
.scroll-tabs > :first-child::-webkit-scrollbar {
	display: none;
}
/* fade the edge that has more content off-screen */
.scroll-tabs:not(.at-end) > :first-child {
	-webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 3.5rem), transparent);
	mask-image: linear-gradient(90deg, #000 calc(100% - 3.5rem), transparent);
}
.scroll-tabs:not(.at-start) > :first-child {
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 3.5rem);
	mask-image: linear-gradient(90deg, transparent, #000 3.5rem);
}
.scroll-tabs:not(.at-start):not(.at-end) > :first-child {
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 3.5rem, #000 calc(100% - 3.5rem), transparent);
	mask-image: linear-gradient(90deg, transparent, #000 3.5rem, #000 calc(100% - 3.5rem), transparent);
}
.scroll-tabs-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2;
	display: none;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--bs-secondary-bg);
	color: var(--bs-body-color);
	font-size: 0.85rem;
	opacity: 0.85;
}
.scroll-tabs-arrow:hover {
	opacity: 1;
}
.scroll-tabs-arrow-prev {
	left: 0;
}
.scroll-tabs-arrow-next {
	right: 0;
}
.scroll-tabs:not(.at-start) > .scroll-tabs-arrow-prev,
.scroll-tabs:not(.at-end) > .scroll-tabs-arrow-next {
	display: flex;
}
@media (hover: none) {
	/* touch devices swipe; arrows would only cover the edge tabs */
	.scroll-tabs-arrow {
		display: none !important;
	}
}

/* let hover pass through disabled buttons so tooltips on their wrappers work */
.btn:disabled,
.btn.disabled {
	pointer-events: none;
}

/* Site news header and bottom-right announcement queue. */
.xy-news-header {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	min-height: 42px;
	padding: 0.55rem 3rem;
	background: #087f5b;
	color: #fff;
	text-align: center;
}
.xy-news-header-link {
	color: inherit;
}
.xy-news-header-link:hover {
	color: #fff;
	text-decoration: underline;
}
.xy-news-header-close {
	position: absolute;
	right: 1rem;
}

/* fixed main header: match the real header heights instead of the kit defaults,
   and keep the news banner visible below it */
@media (min-width: 992px) {
	body.header-fixed[data-kt-sticky-header="on"] .header {
		height: 104px;
	}
	body.header-fixed[data-kt-sticky-header="on"] .wrapper {
		padding-top: 104px;
	}
}
@media (max-width: 991.98px) {
	body.header-fixed[data-kt-sticky-header="on"] .wrapper {
		padding-top: 60px;
	}
}
body[data-kt-sticky-header="on"]:has(.xy-news-header:not(.d-none)) .wrapper {
	padding-top: 0;
}
@media (min-width: 992px) {
	body[data-kt-sticky-header="on"]:has(.xy-news-header:not(.d-none)) #xy-news-header-region {
		padding-top: 104px;
	}
}
@media (max-width: 991.98px) {
	body[data-kt-sticky-header="on"]:has(.xy-news-header:not(.d-none)) #xy-news-header-region {
		padding-top: 60px;
	}
}
.xy-news-toast-region {
	z-index: 1090;
	width: min(420px, 100%);
	pointer-events: none;
}
.xy-news-toast {
	width: 100%;
	max-width: 390px;
	margin-left: auto;
	background: var(--bs-body-bg);
	box-shadow: 0 0.75rem 2rem rgba(0, 0, 0, 0.28);
	pointer-events: auto;
}
.news-article-content {
	line-height: 1.75;
}
.news-article-content pre,
.news-article-content code {
	white-space: pre-wrap;
	word-break: break-word;
}

.buy-mobile-cta {
	z-index: 100;
}

/*
 * Feedback widget ({% feedback_widget %}).
 * Rating question: 5 segmented buttons driven by visually-hidden radios.
 */
.xy-feedback-rating {
	display: inline-flex;
	gap: 0.5rem;
}
.xy-feedback-rating input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}
.xy-feedback-rating label {
	width: 2.5rem;
	height: 2.5rem;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--bs-gray-400);
	border-radius: 0.475rem;
	cursor: pointer;
	color: var(--bs-gray-700);
}
.xy-feedback-rating label:hover,
.xy-feedback-rating input:focus-visible + label {
	border-color: var(--bs-info);
}
.xy-feedback-rating input:checked + label {
	background: var(--bs-info);
	border-color: var(--bs-info);
	color: var(--bs-info-inverse, #fff);
}

/* Post-signup activation flow. Keep presentation here, not in activate.html. */
#xy-activate {
	position: relative;
	min-height: 75vh;
}
#xy-activate .activation-card {
	overflow: hidden;
	border: 1px solid rgba(0, 158, 247, 0.18);
	background: linear-gradient(145deg, rgba(0, 158, 247, 0.055), transparent 38%), var(--bs-card-bg, var(--bs-body-bg));
	box-shadow: 0 1.25rem 3.5rem rgba(0, 0, 0, 0.09);
}
#xy-activate .activation-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 72px;
	height: 72px;
	border-radius: 22px;
	background: linear-gradient(145deg, rgba(0, 158, 247, 0.18), rgba(114, 57, 234, 0.12));
	box-shadow: inset 0 0 0 1px rgba(0, 158, 247, 0.16);
}
#xy-activate .activation-progress {
	display: flex;
	align-items: center;
	width: min(520px, 92vw);
}
#xy-activate .activation-step {
	display: flex;
	align-items: center;
	gap: 0.45rem;
	color: var(--bs-gray-500);
	font-size: 0.85rem;
	font-weight: 600;
	white-space: nowrap;
}
#xy-activate .activation-step-dot {
	display: inline-grid;
	place-items: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--bs-gray-200);
	color: var(--bs-gray-600);
	transition: 0.25s ease;
}
#xy-activate .activation-step.is-active {
	color: var(--bs-info);
}
#xy-activate .activation-step.is-active .activation-step-dot {
	color: #fff;
	background: var(--bs-info);
	box-shadow: 0 0 0 5px rgba(0, 158, 247, 0.12);
}
#xy-activate .activation-step.is-complete .activation-step-dot {
	color: #fff;
	background: var(--bs-success);
}
#xy-activate .activation-step-line {
	flex: 1;
	min-width: 22px;
	height: 2px;
	margin: 0 0.65rem;
	background: var(--bs-gray-300);
}
#xy-activate .activation-primary {
	border: 0;
	background: linear-gradient(110deg, #009ef7, #1684e8);
	box-shadow: 0 0.75rem 1.75rem rgba(0, 158, 247, 0.22);
}
#xy-activate .activation-primary:hover {
	background: linear-gradient(110deg, #1684e8, #0878d1);
}
@media (max-width: 575.98px) {
	#xy-activate .activation-step-label {
		display: none;
	}
	#xy-activate .activation-step {
		flex: 0 0 auto;
	}
}

/* delivery endpoints */
#xy-deliveries .endpoint-url {
	display: inline-block;
	max-width: 22rem;
	vertical-align: middle;
}
#xy-deliveries .endpoint-actions {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5rem;
}
#xy-deliveries .endpoint-actions form {
	margin: 0;
}
/* failing badge pulses to draw the eye without bloating the row */
#xy-deliveries [data-endpoint-status] .status-failing {
	animation: xy-status-pulse 2s ease-in-out infinite;
}
@keyframes xy-status-pulse {
	0%, 100% {
		box-shadow: 0 0 0 0 rgba(249, 62, 62, 0.45);
	}
	50% {
		box-shadow: 0 0 0 4px rgba(249, 62, 62, 0);
	}
}
@media (prefers-reduced-motion: reduce) {
	#xy-deliveries [data-endpoint-status] .status-failing {
		animation: none;
	}
}
#xy-deliveries section {
	scroll-margin-top: 112px;
}
@media (max-width: 991.98px) {
	#xy-deliveries section {
		scroll-margin-top: 68px;
	}
}
#xy-deliveries .destination-picker {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}
/* the kit centres modal titles; the wizard header needs a plain back-title-close row */
#destination_picker .modal-header {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}
#destination_picker .modal-title {
	flex: 1 1 auto;
	margin: 0;
	text-align: start;
}
#xy-deliveries .destination-choice {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 0.75rem 1rem;
	border: 1px solid var(--bs-gray-300);
	border-radius: 0.6rem;
	background: var(--bs-body-bg);
	color: var(--bs-gray-700);
	text-align: start;
	transition: color 0.15s, border-color 0.15s, box-shadow 0.15s;
}
#xy-deliveries .destination-choice i {
	font-size: 1.5rem;
	color: var(--bs-info);
}
#xy-deliveries .destination-choice:hover,
#xy-deliveries .destination-choice:focus-visible {
	color: var(--bs-gray-800);
	border-color: var(--bs-info);
	box-shadow: 0 0.35rem 1rem rgba(0, 158, 247, 0.15);
}
#xy-deliveries .destination-choice:disabled {
	opacity: 0.6;
}
#xy-deliveries .destination-choice.recommended {
	border-color: var(--bs-info);
}
/* wizard: type intro, numbered steps, waiting and success states */
#xy-deliveries .wizard-type-head {
	display: flex;
	align-items: flex-start;
	gap: 1rem;
	margin-bottom: 1rem;
}
#xy-deliveries .wizard-type-head i {
	font-size: 1.75rem;
	line-height: 1;
	color: var(--bs-info);
}
#xy-deliveries .wizard-steps {
	margin: 0 0 1.25rem;
	padding-left: 1.5rem;
}
#xy-deliveries .wizard-steps li {
	padding: 0.35rem 0;
	font-weight: 600;
	color: var(--bs-gray-700);
}
#xy-deliveries .wizard-steps li::marker {
	color: var(--bs-info);
	font-weight: 700;
}
#xy-deliveries .wizard-center {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 1rem 0;
}
#xy-deliveries .wizard-done-icon {
	font-size: 3rem;
	margin-bottom: 0.75rem;
}
#xy-deliveries .wizard-step {
	animation: xy-wizard-fade 0.18s ease-out;
}
@keyframes xy-wizard-fade {
	from {
		opacity: 0;
		transform: translateY(4px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}
@media (prefers-reduced-motion: reduce) {
	#xy-deliveries .wizard-step {
		animation: none;
	}
}
@media (prefers-reduced-motion: no-preference) {
	html:has(#xy-deliveries) {
		scroll-behavior: smooth;
	}
}

/* sweetalert: the kit colours titles with --bs-dark, which vanishes on the dark theme */
.swal2-popup .swal2-title {
	color: var(--bs-gray-900);
}
.swal2-styled.swal2-confirm {
	background-color: var(--bs-info);
}
.swal2-styled.swal2-confirm:hover {
	background-color: var(--bs-info-active);
}
.swal2-styled.swal2-confirm:focus-visible {
	box-shadow: 0 0 0 3px var(--bs-info-light);
}

/* alert delivery center */
#xy-alert-history .history-tab {
	flex: 0 0 auto;
}
/* secondary text under the alert title / status badge: one line, then ellipsis */
#xy-alert-history .alert-excerpt,
#xy-alert-history .alert-detail {
	max-width: 34rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
@media (max-width: 767.98px) {
	#xy-alert-history .alert-excerpt,
	#xy-alert-history .alert-detail {
		max-width: 14rem;
	}
}
