/* QC Global Announcement / Alert Popup styles (story 131032, QC-GBL-002).
 *
 * Rebuilt 2026-09-28 against the Figma frames linked on ADO 131032
 * (file J3e1thav8NIu6a3XhC6Wcl, page 1579:26247):
 *   light  EN desktop 6839:274965 / 274968 / 274971, EN mobile 6839:274930-274932,
 *          AR desktop 6839:274969 / 274972,          AR mobile 6839:274967-274973
 *   dark   EN desktop 6839:276633 / 276636 / 276639, and the AR/mobile siblings.
 *
 * Every colour below was sampled from the rendered Figma frames rather than
 * taken from the variable names: the dark frame re-themes the card, the icon
 * chip, the preference panel and the text, but deliberately leaves BOTH action
 * buttons on their light styling (white Close pill, #911731 primary), which the
 * token aliases in Figma's generated code report the other way round.
 *
 * Logical properties (inset-inline-*, padding-inline-start, text-align:start)
 * so the same rules mirror under dir="rtl" for Arabic (AC-6). Responsive from
 * the Mobile frame down (AC-7) - not a shrunken desktop. The JS removes the
 * whole overlay on close, so it never blocks page content afterwards.
 */

.qc-ann-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	padding: 24px;
	background: rgba(29, 29, 27, 0.55);
	-webkit-backdrop-filter: blur(2px);
	backdrop-filter: blur(2px);
	animation: qc-ann-fade 0.2s ease-out;
}

.qc-ann-overlay *,
.qc-ann-overlay *::before,
.qc-ann-overlay *::after {
	box-sizing: border-box;
}

/* Card: 648 wide, 40px padding, 24px gap, 16px radius, 0 0 32px shadow. */
.qc-ann-card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 24px;
	width: 100%;
	max-width: 648px;
	max-height: calc(100vh - 48px);
	padding: 40px;
	background: #ffffff;
	border-radius: 16px;
	box-shadow: 0 0 32px rgba(29, 29, 27, 0.3);
	font-family: "Cairo", system-ui, -apple-system, "Segoe UI", sans-serif;
	text-align: start;
	animation: qc-ann-pop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------------------------------------------------------------- header */

.qc-ann-header {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	width: 100%;
}

.qc-ann-head-main {
	display: flex;
	flex: 1 1 0;
	gap: 16px;
	align-items: center;
	min-width: 0;
}

.qc-ann-icon {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	background: #f6f6f6;
	border: 1px solid #ededed;
	border-radius: 8px;
	color: #6c6c6b;
}

.qc-ann-icon svg {
	display: block;
	width: 24px;
	height: 24px;
}

.qc-ann-heading {
	display: flex;
	flex: 1 1 0;
	flex-direction: column;
	min-width: 0;
}

.qc-ann-eyebrow {
	margin: 0;
	font-size: 12px;
	font-weight: 400;
	line-height: 18px;
	color: #911731;
}

.qc-ann-title {
	margin: 0;
	font-size: 24px;
	font-weight: 600;
	line-height: 32px;
	color: #1d1d1b;
	word-wrap: break-word;
}

.qc-ann-close {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	padding: 0;
	background: #f6f6f6;
	border: 0;
	border-radius: 4px;
	color: #a8a8a7;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.qc-ann-close svg {
	display: block;
	width: 13px;
	height: 13px;
}

.qc-ann-close:focus-visible {
	outline: 2px solid #911731;
	outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
	.qc-ann-close:hover {
		background: #ededed;
		color: #6c6c6b;
	}
}

/* ------------------------------------------------------------------ body */

.qc-ann-body {
	display: flex;
	flex-direction: column;
	gap: 16px;
	width: 100%;
	min-height: 0;
	overflow-x: hidden;
	overflow-y: auto;
}

.qc-ann-desc {
	font-size: 16px;
	font-weight: 400;
	line-height: 24px;
	color: #343432;
	word-wrap: break-word;
}

.qc-ann-desc > * {
	margin: 0;
}

.qc-ann-desc > * + * {
	margin-top: 16px;
}

.qc-ann-desc ul,
.qc-ann-desc ol {
	padding-inline-start: 24px;
}

.qc-ann-desc ul {
	list-style: square;
}

.qc-ann-desc a {
	color: #911731;
	text-decoration: underline;
}

/* --------------------------------------------- "do not show again" panel */

.qc-ann-pref {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	padding: 12px;
	background: #f6f0ec;
	border: 1px solid #e9dbd0;
	border-radius: 8px;
	cursor: pointer;
	user-select: none;
}

.qc-ann-pref-cb {
	position: relative;
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	margin: 0;
	-webkit-appearance: none;
	appearance: none;
	background: #ffffff;
	border: 1px solid #d0d0d0;
	border-radius: 4px;
	cursor: pointer;
}

.qc-ann-pref-cb:checked {
	background: #911731;
	border-color: #911731;
}

.qc-ann-pref-cb:checked::after {
	content: "";
	position: absolute;
	inset-block-start: 2px;
	inset-inline-start: 6px;
	width: 5px;
	height: 10px;
	border: solid #ffffff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.qc-ann-pref-cb:focus-visible {
	outline: 2px solid #911731;
	outline-offset: 2px;
}

.qc-ann-pref-text {
	display: flex;
	flex: 1 1 0;
	flex-direction: column;
	min-width: 0;
}

.qc-ann-pref-label {
	font-size: 14px;
	font-weight: 600;
	line-height: 22px;
	color: #1d1d1b;
}

.qc-ann-pref-help {
	font-size: 14px;
	font-weight: 400;
	line-height: 22px;
	color: #7c7b7b;
}

/* --------------------------------------------------------------- actions */

.qc-ann-actions {
	display: flex;
	gap: 10px;
	align-items: center;
	justify-content: flex-end;
	width: 100%;
}

.qc-ann-btn {
	display: inline-flex;
	flex: 0 0 auto;
	gap: 6px;
	align-items: center;
	justify-content: center;
	padding: 12px 18px;
	border-radius: 9999px;
	font-family: inherit;
	font-size: 16px;
	font-weight: 600;
	line-height: 24px;
	white-space: nowrap;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.qc-ann-btn-secondary {
	background: #ffffff;
	border: 1px solid #dededd;
	color: #4a4a49;
}

.qc-ann-btn-primary {
	background: #911731;
	border: 2px solid rgba(255, 255, 255, 0.12);
	color: #ffffff;
}

.qc-ann-btn-primary svg {
	display: block;
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
}

/* The arrow points away from the reading direction, so it mirrors in AR. */
[dir="rtl"] .qc-ann-btn-primary svg {
	transform: scaleX(-1);
}

/* Clay's global a:hover underlines every anchor and repaints it Clay blue;
   these compound selectors outrank it without !important
   (qc-hover-underline-reset). */
.qc-ann-overlay a.qc-ann-btn,
.qc-ann-overlay a.qc-ann-btn:hover,
.qc-ann-overlay a.qc-ann-btn:focus {
	text-decoration: none;
}

.qc-ann-overlay a.qc-ann-btn-primary,
.qc-ann-overlay a.qc-ann-btn-primary:hover,
.qc-ann-overlay a.qc-ann-btn-primary:focus {
	color: #ffffff;
}

.qc-ann-btn:focus-visible {
	outline: 2px solid #911731;
	outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
	.qc-ann-btn-secondary:hover {
		background: #f6f6f6;
		border-color: #d0d0d0;
	}

	.qc-ann-overlay a.qc-ann-btn-primary:hover {
		background: #7a1329;
	}
}

/* When no CTA is configured the lone Close button spans the row (Figma
   "Information only" state, 6839:274968). */
.qc-ann-actions--single .qc-ann-btn {
	flex: 1 1 auto;
}

/* ------------------------------------------------------------ animations */

@keyframes qc-ann-fade {
	from {
		opacity: 0;
	}

	to {
		opacity: 1;
	}
}

@keyframes qc-ann-pop {
	from {
		opacity: 0;
		transform: translateY(14px) scale(0.97);
	}

	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

@media (prefers-reduced-motion: reduce) {
	.qc-ann-overlay,
	.qc-ann-card {
		animation: none;
	}
}

/* ------------------------------------------------- mobile / tablet frame */

/* The Figma Mobile frame is 390 wide with a 350 card: 20px inline / 24px block
   padding, 18/28 title, 14/22 body, and a CTA that fills the remaining row.
   Extended up through the tablet range rather than inventing a third layout. */
@media (max-width: 640px) {
	.qc-ann-overlay {
		padding: 20px;
	}

	.qc-ann-card {
		max-width: 100%;
		max-height: calc(100vh - 40px);
		padding: 24px 20px;
	}

	.qc-ann-head-main {
		align-items: flex-start;
	}

	/* 44x44 touch target; the transparent border keeps the drawn 24px chip
	   and the negative margin keeps the header layout unchanged. */
	.qc-ann-close {
		box-sizing: border-box;
		width: 44px;
		height: 44px;
		margin: -10px;
		border: 10px solid transparent;
		background-clip: content-box;
	}

	.qc-ann-title {
		font-size: 18px;
		line-height: 28px;
	}

	.qc-ann-desc {
		font-size: 14px;
		line-height: 22px;
	}

	.qc-ann-desc ul,
	.qc-ann-desc ol {
		padding-inline-start: 21px;
	}

	.qc-ann-actions .qc-ann-btn-primary {
		flex: 1 1 0;
		min-width: 0;
	}
}

/* ------------------------------------------------------------- dark mode */

/* The accessibility panel sets data-theme="dark" on <html>; this CX hardcodes
   its palette, so it carries its own dark block (qc-dark-mode). Sampled from
   the Figma dark frames - note that the two action buttons stay light. */
:root[data-theme="dark"] .qc-ann-card {
	background: #1d1d1b;
}

:root[data-theme="dark"] .qc-ann-icon {
	background: #343432;
	border-color: #4a4a49;
	color: #dededd;
}

:root[data-theme="dark"] .qc-ann-close {
	background: #343432;
	color: #a8a8a7;
}

@media (hover: hover) and (pointer: fine) {
	:root[data-theme="dark"] .qc-ann-close:hover {
		background: #4a4a49;
		color: #dededd;
	}
}

:root[data-theme="dark"] .qc-ann-eyebrow {
	color: #c44561;
}

:root[data-theme="dark"] .qc-ann-title {
	color: #ffffff;
}

:root[data-theme="dark"] .qc-ann-desc {
	color: #f6f6f6;
}

:root[data-theme="dark"] .qc-ann-desc a {
	color: #c44561;
}

:root[data-theme="dark"] .qc-ann-pref {
	background: #422c1b;
	border-color: #533822;
}

:root[data-theme="dark"] .qc-ann-pref-cb {
	background: #1d1d1b;
	border-color: #7c7b7b;
}

:root[data-theme="dark"] .qc-ann-pref-cb:checked {
	background: #911731;
	border-color: #911731;
}

:root[data-theme="dark"] .qc-ann-pref-label {
	color: #ffffff;
}

:root[data-theme="dark"] .qc-ann-pref-help {
	color: #d0d0d0;
}
