.ms-customer-portal {
	--ms-portal-heading: #0d223f;
	--ms-portal-text: #42526a;
	--ms-portal-muted: #6b7a93;
	--ms-portal-line: #e3e8ef;
	--ms-portal-surface: #f2f7fb;
	--ms-portal-primary: #0067ff;
	--ms-portal-primary-hover: #005ee9;
	--ms-portal-aqua: #00b8d9;
	--ms-portal-deep: #081423;
	--ms-portal-valid: #1d7a55;
	--ms-portal-valid-bg: #e5f4ec;
	--ms-portal-error: #b3261e;
	--ms-portal-error-bg: #fdeeed;
	--ms-portal-radius: 14px;
	--ms-portal-radius-card: 22px;
	--ms-portal-shadow-card: 0 24px 58px -50px rgba(9, 9, 11, 0.58);
	--ms-portal-focus-ring: 0 0 0 4px rgba(0, 94, 233, 0.12);
	color: var(--ms-portal-text);
	font-family: "Inter", sans-serif;
	margin: 0 auto;
	max-width: 1040px;
	padding: clamp(8px, 1.5vw, 16px) 18px clamp(24px, 5vw, 64px);
}

body.ms-has-customer-portal .ms-content-template {
	padding-top: clamp(24px, 4vw, 48px);
}

.ms-customer-portal * {
	box-sizing: border-box;
}

/* === Auth screens === */

.ms-customer-portal__auth {
	margin: 0 auto;
	max-width: 560px;
}

.ms-customer-portal__panel {
	background: #fff;
	border: 1px solid var(--ms-portal-line);
	border-radius: var(--ms-portal-radius-card);
	box-shadow: var(--ms-portal-shadow-card);
	padding: clamp(28px, 5vw, 44px);
	text-align: center;
}

.ms-customer-portal__badge {
	align-items: center;
	background: var(--ms-portal-surface);
	border-radius: 999px;
	color: var(--ms-portal-primary);
	display: inline-flex;
	height: 60px;
	justify-content: center;
	margin-bottom: 18px;
	width: 60px;
}

.ms-customer-portal__badge svg {
	display: block;
	height: 26px;
	width: 26px;
}

.ms-customer-portal__eyebrow {
	color: var(--ms-portal-primary);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.1em;
	margin: 0 0 10px;
	text-transform: uppercase;
}

.ms-customer-portal h1 {
	color: var(--ms-portal-heading);
	font-size: clamp(28px, 4vw, 38px);
	font-weight: 800;
	line-height: 1.12;
	margin: 0;
}

.ms-customer-portal__lead {
	color: var(--ms-portal-muted);
	font-size: 15px;
	line-height: 1.6;
	margin: 12px auto 0;
	max-width: 40ch;
}

.ms-customer-portal__lead strong {
	color: var(--ms-portal-heading);
	overflow-wrap: anywhere;
}

.ms-customer-portal__form {
	margin-top: 26px;
	text-align: left;
}

.ms-customer-portal__form label {
	color: var(--ms-portal-heading);
	display: block;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.25;
	margin-bottom: 7px;
}

.ms-customer-portal input {
	background: #fff;
	border: 1px solid #d3d5d8;
	border-radius: var(--ms-portal-radius);
	color: var(--ms-portal-heading);
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	min-height: 52px;
	padding: 0 16px;
	transition: border-color 160ms ease, box-shadow 160ms ease;
	width: 100%;
}

.ms-customer-portal input:focus {
	border-color: var(--ms-portal-primary-hover);
	box-shadow: var(--ms-portal-focus-ring);
	outline: none;
}

.ms-customer-portal button {
	font-family: inherit;
}

.ms-customer-portal__submit,
.ms-customer-portal__download {
	align-items: center;
	background: var(--ms-portal-primary);
	border: 1px solid var(--ms-portal-primary);
	border-radius: var(--ms-portal-radius);
	box-shadow: 0 18px 32px -24px rgba(0, 103, 255, 0.85);
	color: #fff;
	cursor: pointer;
	display: inline-flex;
	font-size: 15px;
	font-weight: 800;
	gap: 8px;
	justify-content: center;
	line-height: 1;
	min-height: 52px;
	padding: 0 24px;
	text-decoration: none;
	transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
	white-space: nowrap;
}

.ms-customer-portal__submit {
	margin-top: 16px;
	width: 100%;
}

.ms-customer-portal__submit:hover,
.ms-customer-portal__submit:focus-visible,
.ms-customer-portal__download:hover,
.ms-customer-portal__download:focus-visible {
	background: var(--ms-portal-primary-hover);
	border-color: var(--ms-portal-primary-hover);
	color: #fff;
	outline: none;
	transform: translateY(-1px);
}

.ms-customer-portal__submit:disabled {
	cursor: wait;
	opacity: 0.65;
	transform: none;
}

.ms-customer-portal__link-button {
	background: none;
	border: 0;
	color: var(--ms-portal-primary);
	cursor: pointer;
	font-size: 14px;
	font-weight: 700;
	padding: 4px 6px;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
	transition: color 160ms ease;
}

.ms-customer-portal__link-button:hover,
.ms-customer-portal__link-button:focus-visible {
	color: var(--ms-portal-primary-hover);
	outline: none;
}

.ms-customer-portal__link-button:disabled {
	color: var(--ms-portal-muted);
	cursor: default;
	text-decoration: none;
}

.ms-customer-portal__auth-footer {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 4px 18px;
	justify-content: center;
	margin-top: 22px;
}

.ms-customer-portal__hint {
	color: var(--ms-portal-muted);
	font-size: 13px;
	margin: 18px 0 0;
}

/* === OTP input === */

.ms-customer-portal__otp-group {
	display: flex;
	gap: clamp(6px, 1.6vw, 10px);
	justify-content: center;
	margin-top: 24px;
}

.ms-customer-portal__otp-group input.ms-customer-portal__otp-digit {
	border-radius: var(--ms-portal-radius);
	caret-color: var(--ms-portal-primary);
	flex: 0 1 58px;
	font-size: 26px;
	font-weight: 800;
	height: 64px;
	min-height: 0;
	padding: 0;
	text-align: center;
	width: 58px;
}

.ms-customer-portal__otp-digit:nth-child(4) {
	margin-left: clamp(6px, 2vw, 14px);
}

.ms-customer-portal__otp-group input.ms-customer-portal__otp-digit.is-filled {
	border-color: var(--ms-portal-heading);
}

.ms-customer-portal__otp-group input.ms-customer-portal__otp-digit:focus {
	border-color: var(--ms-portal-primary-hover);
	box-shadow: var(--ms-portal-focus-ring);
}

.ms-customer-portal__otp-group.is-invalid input.ms-customer-portal__otp-digit {
	animation: ms-portal-shake 320ms ease;
	border-color: var(--ms-portal-error);
}

@keyframes ms-portal-shake {
	0%, 100% {
		transform: translateX(0);
	}
	25% {
		transform: translateX(-4px);
	}
	50% {
		transform: translateX(4px);
	}
	75% {
		transform: translateX(-2px);
	}
}

/* === Messages === */

.ms-customer-portal__message {
	align-items: flex-start;
	background: var(--ms-portal-surface);
	border: 1px solid transparent;
	border-radius: var(--ms-portal-radius);
	color: var(--ms-portal-heading);
	display: flex;
	font-size: 14px;
	font-weight: 600;
	gap: 10px;
	line-height: 1.5;
	margin: 22px 0 0;
	padding: 13px 16px;
	text-align: left;
}

.ms-customer-portal__message svg {
	flex: 0 0 auto;
	height: 18px;
	margin-top: 1px;
	width: 18px;
}

.ms-customer-portal__message--info {
	color: #0b4ea2;
}

.ms-customer-portal__message--success {
	background: var(--ms-portal-valid-bg);
	color: var(--ms-portal-valid);
}

.ms-customer-portal__message--error {
	background: var(--ms-portal-error-bg);
	color: var(--ms-portal-error);
}

/* === Loading === */

.ms-customer-portal__loading {
	align-items: center;
	color: var(--ms-portal-muted);
	display: flex;
	flex-direction: column;
	font-weight: 600;
	gap: 16px;
	justify-content: center;
	padding: clamp(48px, 10vw, 96px) 18px;
	text-align: center;
}

.ms-customer-portal__spinner {
	animation: ms-portal-spin 700ms linear infinite;
	border: 3px solid var(--ms-portal-surface);
	border-radius: 999px;
	border-top-color: var(--ms-portal-primary);
	height: 38px;
	width: 38px;
}

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

/* === Dashboard === */

.ms-customer-portal__topbar {
	align-items: flex-end;
	display: flex;
	gap: 18px;
	justify-content: space-between;
	margin-bottom: 28px;
}

.ms-customer-portal__subtitle {
	color: var(--ms-portal-muted);
	font-size: 14px;
	margin: 10px 0 0;
}

.ms-customer-portal__subtitle strong {
	color: var(--ms-portal-heading);
	font-weight: 700;
	overflow-wrap: anywhere;
}

.ms-customer-portal__secondary {
	align-items: center;
	background: #fff;
	border: 1px solid var(--ms-portal-line);
	border-radius: var(--ms-portal-radius);
	color: var(--ms-portal-heading);
	cursor: pointer;
	display: inline-flex;
	font-size: 14px;
	font-weight: 700;
	gap: 8px;
	justify-content: center;
	min-height: 46px;
	padding: 0 18px;
	transition: border-color 160ms ease, color 160ms ease, transform 160ms ease;
	white-space: nowrap;
}

.ms-customer-portal__secondary svg {
	height: 16px;
	width: 16px;
}

.ms-customer-portal__secondary:hover,
.ms-customer-portal__secondary:focus-visible {
	border-color: var(--ms-portal-primary-hover);
	color: var(--ms-portal-primary-hover);
	outline: none;
	transform: translateY(-1px);
}

.ms-customer-portal__orders {
	display: grid;
	gap: 22px;
}

.ms-customer-portal__order,
.ms-customer-portal__standalone {
	background: #fff;
	border: 1px solid var(--ms-portal-line);
	border-radius: var(--ms-portal-radius-card);
	box-shadow: var(--ms-portal-shadow-card);
	padding: clamp(20px, 3.5vw, 30px);
}

.ms-customer-portal__standalone {
	margin-top: 22px;
}

.ms-customer-portal__standalone h2 {
	color: var(--ms-portal-heading);
	font-size: 22px;
	font-weight: 800;
	line-height: 1.25;
	margin: 0 0 16px;
}

.ms-customer-portal__order-header {
	align-items: flex-start;
	display: flex;
	gap: 14px;
	justify-content: space-between;
}

.ms-customer-portal__order-header h2 {
	color: var(--ms-portal-heading);
	font-size: 22px;
	font-weight: 800;
	line-height: 1.25;
	margin: 0;
}

.ms-customer-portal__order-header p {
	color: var(--ms-portal-muted);
	font-size: 14px;
	margin: 6px 0 0;
}

.ms-customer-portal__order-summary {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 8px;
}

.ms-customer-portal__order-summary strong {
	color: var(--ms-portal-heading);
	font-size: 20px;
	font-weight: 800;
	white-space: nowrap;
}

.ms-customer-portal__items {
	background: var(--ms-portal-surface);
	border-radius: 16px;
	display: grid;
	gap: 0;
	margin: 20px 0 0;
	padding: 6px 16px;
}

.ms-customer-portal__item {
	align-items: center;
	display: grid;
	gap: 12px;
	grid-template-columns: minmax(0, 1fr) 44px minmax(90px, auto);
	padding: 11px 0;
}

.ms-customer-portal__item + .ms-customer-portal__item {
	border-top: 1px solid rgba(13, 34, 63, 0.08);
}

.ms-customer-portal__item span:first-child {
	color: var(--ms-portal-heading);
	font-weight: 600;
}

.ms-customer-portal__item span:nth-child(2) {
	color: var(--ms-portal-muted);
	font-size: 14px;
	text-align: right;
}

.ms-customer-portal__item strong {
	color: var(--ms-portal-heading);
	font-weight: 800;
	text-align: right;
	white-space: nowrap;
}

.ms-customer-portal__resource-group {
	margin-top: 22px;
}

.ms-customer-portal__resource-group h3 {
	color: var(--ms-portal-heading);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.08em;
	line-height: 1.25;
	margin: 0 0 12px;
	text-transform: uppercase;
}

.ms-customer-portal__resources {
	display: grid;
	gap: 10px;
}

.ms-customer-portal__resource {
	align-items: center;
	border: 1px solid var(--ms-portal-line);
	border-radius: 16px;
	display: flex;
	gap: 14px;
	justify-content: space-between;
	padding: 14px 16px;
	transition: border-color 160ms ease;
}

.ms-customer-portal__resource:hover {
	border-color: rgba(0, 103, 255, 0.35);
}

.ms-customer-portal__resource-info {
	align-items: center;
	display: flex;
	gap: 14px;
	min-width: 0;
}

.ms-customer-portal__resource-icon {
	align-items: center;
	background: var(--ms-portal-surface);
	border-radius: 12px;
	color: var(--ms-portal-primary);
	display: inline-flex;
	flex: 0 0 auto;
	height: 44px;
	justify-content: center;
	width: 44px;
}

.ms-customer-portal__resource-icon svg {
	height: 20px;
	width: 20px;
}

.ms-customer-portal__resource strong {
	color: var(--ms-portal-heading);
	display: block;
	font-weight: 700;
	overflow-wrap: anywhere;
}

.ms-customer-portal__resource-info > div > span {
	color: var(--ms-portal-muted);
	display: block;
	font-size: 13px;
	margin: 3px 0 0;
}

.ms-customer-portal__resource-actions {
	align-items: center;
	display: flex;
	flex: 0 0 auto;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: flex-end;
}

.ms-customer-portal__download {
	border-radius: 12px;
	font-size: 14px;
	min-height: 44px;
	padding: 0 18px;
}

.ms-customer-portal__download svg {
	height: 16px;
	width: 16px;
}

.ms-customer-portal__status {
	align-items: center;
	border-radius: 999px;
	display: inline-flex;
	font-size: 13px;
	font-weight: 700;
	gap: 6px;
	line-height: 1;
	padding: 8px 12px;
	white-space: nowrap;
}

.ms-customer-portal__status::before {
	background: currentColor;
	border-radius: 999px;
	content: "";
	height: 6px;
	width: 6px;
}

.ms-customer-portal__status.is-valid {
	background: var(--ms-portal-valid-bg);
	color: var(--ms-portal-valid);
}

.ms-customer-portal__status.is-used {
	background: rgba(13, 34, 63, 0.08);
	color: var(--ms-portal-muted);
}

.ms-customer-portal__status.is-order {
	background: var(--ms-portal-surface);
	color: #0b4ea2;
}

.ms-customer-portal__status.is-pending {
	background: #fdf3e0;
	color: #9a6b00;
}

.ms-customer-portal__status.is-cancelled {
	background: var(--ms-portal-error-bg);
	color: var(--ms-portal-error);
}

.ms-customer-portal__empty {
	background: var(--ms-portal-surface);
	border-radius: var(--ms-portal-radius-card);
	color: var(--ms-portal-muted);
	padding: clamp(40px, 7vw, 72px) 24px;
	text-align: center;
}

.ms-customer-portal__empty h2 {
	color: var(--ms-portal-heading);
	font-size: 22px;
	font-weight: 800;
	margin: 0 0 6px;
}

.ms-customer-portal__empty p {
	margin: 0 auto;
	max-width: 44ch;
}

.ms-customer-portal__empty-icon {
	align-items: center;
	background: #fff;
	border-radius: 999px;
	box-shadow: var(--ms-portal-shadow-card);
	color: var(--ms-portal-primary);
	display: inline-flex;
	height: 64px;
	justify-content: center;
	margin-bottom: 18px;
	width: 64px;
}

.ms-customer-portal__empty-icon svg {
	height: 28px;
	width: 28px;
}

.ms-customer-portal__empty-cta {
	margin-top: 24px;
	width: auto;
}

/* === Responsive === */

@media (max-width: 700px) {
	.ms-customer-portal {
		padding-inline: 12px;
	}

	.ms-customer-portal__topbar {
		align-items: stretch;
		flex-direction: column;
	}

	.ms-customer-portal__order-header {
		flex-direction: column;
	}

	.ms-customer-portal__order-summary {
		align-items: flex-start;
		flex-direction: row-reverse;
		justify-content: space-between;
		width: 100%;
	}

	.ms-customer-portal__item {
		grid-template-columns: minmax(0, 1fr) 36px auto;
	}

	.ms-customer-portal__resource {
		align-items: stretch;
		flex-direction: column;
	}

	.ms-customer-portal__resource-actions {
		justify-content: space-between;
	}

	.ms-customer-portal__otp-group input.ms-customer-portal__otp-digit {
		flex: 1 1 0;
		font-size: 22px;
		height: 56px;
		min-width: 0;
	}
}
