/* AAG Legal banners — public front end. Kept small, no layout shift (the
   root is empty and hidden until a banner is opened by script). */

.aagbn-root {
	--aagbn-bg: #0b1f3a;
	--aagbn-text: #ffffff;
	--aagbn-accent: #ce8d00;
	--aagbn-button: #ce8d00;
	--aagbn-button-text: #14112b;
	--aagbn-panel: #f7f5ef;
	--aagbn-radius: 18px;
	--aagbn-mbar: 0px;
	--aagbn-wa: 68px;
	--aagbn-font-h: var(--cr-font-heading, "Bricolage Grotesque", "Outfit", ui-sans-serif, system-ui, sans-serif);
	--aagbn-font-b: var(--cr-font-body, "Inter", ui-sans-serif, system-ui, sans-serif);
	--aagbn-z: 200000;
	box-sizing: border-box;
	position: fixed;
	inset: 0;
	z-index: var(--aagbn-z);
	display: none;
	font-family: var(--aagbn-font-b);
	color: var(--aagbn-text);
	line-height: 1.45;
	-webkit-font-smoothing: antialiased;
}
.aagbn-root *,
.aagbn-root *::before,
.aagbn-root *::after {
	box-sizing: border-box;
}
.aagbn-root.is-open {
	display: block;
}
.aagbn-root[hidden] {
	display: none !important;
}

body.aag-has-mbar .aagbn-root {
	--aagbn-mbar: calc(64px + env(safe-area-inset-bottom, 0px));
}

/* ---- Backdrop (for modal / sheet / stack) ---- */
.aagbn-root .aagbn-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(11, 31, 58, 0.55);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	border: 0;
	padding: 0;
	margin: 0;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	animation: aagbn-fade 0.28s ease;
}
.aagbn-root[data-layout="slide"] .aagbn-backdrop,
.aagbn-root[data-layout="bar"] .aagbn-backdrop {
	background: transparent;
	-webkit-backdrop-filter: none;
	backdrop-filter: none;
	pointer-events: none;
	animation: none;
}
@media (max-width: 780px) {
	.aagbn-root .aagbn-backdrop {
		background: rgba(11, 31, 58, 0.38);
		-webkit-backdrop-filter: blur(3px);
		backdrop-filter: blur(3px);
	}
}

/* ---- Close ---- */
.aagbn-close {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 3;
	width: 44px;
	height: 44px;
	min-width: 44px;
	min-height: 44px;
	border: 0;
	border-radius: 50%;
	background: #ffffff;
	color: #14112b;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	line-height: 1;
	-webkit-tap-highlight-color: transparent;
}
.aagbn-close:hover,
.aagbn-close:focus-visible {
	background: #f3f0e8;
	outline: 2px solid var(--aagbn-accent);
	outline-offset: 2px;
}
.aagbn-close svg {
	width: 18px;
	height: 18px;
	display: block;
	pointer-events: none;
}

/* ---- Card shell ---- */
.aagbn-root .aagbn-card {
	position: absolute;
	background: var(--aagbn-bg);
	color: var(--aagbn-text);
	border-radius: var(--aagbn-radius);
	box-shadow: 0 18px 50px rgba(8, 14, 30, 0.35);
	overflow: hidden;
	animation: aagbn-pop 0.32s ease;
	max-width: calc(100vw - 32px);
}
.aagbn-root[data-corners="sharp"] { --aagbn-radius: 0px; }
.aagbn-root[data-corners="soft"] { --aagbn-radius: 18px; }
.aagbn-root[data-corners="round"] { --aagbn-radius: 28px; }
.aagbn-root[data-size="small"] .aagbn-card--modal { width: 680px; }
.aagbn-root[data-size="medium"] .aagbn-card--modal { width: 880px; }
.aagbn-root[data-size="large"] .aagbn-card--modal { width: 1040px; }

/* Centre a modal */
.aagbn-root[data-layout="split"] .aagbn-card,
.aagbn-root[data-layout="image"] .aagbn-card,
.aagbn-root[data-layout="stack"] .aagbn-card {
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	max-height: calc(100vh - 48px);
	max-height: calc(100dvh - 48px);
	display: flex;
	flex-direction: column;
}

/* ---- Split ---- */
.aagbn-split {
	display: grid;
	grid-template-columns: 1.08fr 0.92fr;
	min-height: 420px;
	width: 100%;
	max-height: inherit;
}
.aagbn-root[data-image-side="left"] .aagbn-split {
	grid-template-columns: 0.92fr 1.08fr;
}
.aagbn-root[data-image-side="left"] .aagbn-visual {
	order: -1;
}
.aagbn-copy {
	padding: 36px 36px 32px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 0;
	min-width: 0;
	overflow: auto;
}
.aagbn-root .aagbn-logo {
	display: block;
	height: 40px;
	width: auto;
	max-height: 40px;
	max-width: 96px;
	object-fit: contain;
	object-position: left center;
	margin: 0 0 16px;
	padding: 3px 5px;
	background: #fff;
	border-radius: 6px;
	/* .aagbn-copy is a column flex; without this the img stretches
	   to max-width and the white chip becomes a wide empty rectangle. */
	align-self: flex-start;
	flex: 0 0 auto;
}
.aagbn-kicker {
	margin: 0 0 10px !important;
	color: var(--aagbn-accent) !important;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--aagbn-accent);
	line-height: 1.3;
}
.aagbn-root :where(h1, h2, h3, p, li, span, a, button, ul, em) {
	color: inherit;
	font-family: inherit;
	margin: 0;
	padding: 0;
	background: none;
	box-shadow: none;
	text-transform: none;
	letter-spacing: normal;
}
.aagbn-headline {
	margin: 0 0 16px !important;
	font-family: var(--aagbn-font-h) !important;
	font-weight: 800 !important;
	font-size: clamp(2rem, 3.6vw, 3.15rem) !important;
	line-height: 0.96 !important;
	letter-spacing: -0.03em !important;
	color: var(--aagbn-text) !important;
	text-transform: none !important;
	background: none !important;
}
.aagbn-headline em {
	font-style: normal !important;
	color: var(--aagbn-accent) !important;
	display: block !important;
	font-size: inherit !important;
	font-weight: inherit !important;
	font-family: inherit !important;
	background: none !important;
}
.aagbn-desc {
	margin: 0 0 18px !important;
	font-size: 0.98rem;
	opacity: 0.92;
	max-width: 36em;
}
.aagbn-feats {
	list-style: none;
	margin: 4px 0 22px;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 11px;
}
.aagbn-feat {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	font-size: 0.98rem;
	font-weight: 500;
	line-height: 1.35;
}
.aagbn-feat-ico {
	flex: 0 0 32px;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: color-mix(in srgb, var(--aagbn-accent) 22%, transparent);
	color: var(--aagbn-accent);
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.aagbn-feat-ico svg {
	width: 17px;
	height: 17px;
	display: block;
}
.aagbn-cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-top: 4px;
	padding: 13px 28px;
	border: 0;
	border-radius: 999px;
	background: var(--aagbn-button);
	color: var(--aagbn-button-text);
	font-weight: 750;
	font-size: 0.95rem;
	letter-spacing: 0.04em;
	text-decoration: none;
	cursor: pointer;
	line-height: 1.2;
	box-shadow: 0 6px 18px color-mix(in srgb, var(--aagbn-button) 35%, transparent);
	align-self: flex-start;
	transition: transform 0.15s ease, filter 0.15s ease;
}
.aagbn-cta:hover,
.aagbn-cta:focus-visible {
	filter: brightness(1.06);
	transform: translateY(-1px);
	color: var(--aagbn-button-text);
	outline: 2px solid var(--aagbn-accent);
	outline-offset: 3px;
	text-decoration: none;
}
.aagbn-cta2 {
	display: inline-block;
	margin: 12px 0 0 4px;
	background: none;
	border: 0;
	padding: 8px 4px;
	color: color-mix(in srgb, var(--aagbn-text) 72%, transparent);
	font-size: 0.9rem;
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 3px;
	align-self: flex-start;
	min-height: 44px;
}
.aagbn-cta2:hover,
.aagbn-cta2:focus-visible {
	color: var(--aagbn-text);
	outline: none;
}
.aagbn-visual {
	position: relative;
	background: var(--aagbn-panel);
	min-height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	padding: 28px 24px 22px;
}
.aagbn-visual::before {
	content: "";
	position: absolute;
	top: -8%;
	bottom: -8%;
	width: 88px;
	background: var(--aagbn-bg);
	border-radius: 50%;
	pointer-events: none;
}
.aagbn-root[data-image-side="right"] .aagbn-visual::before {
	left: -52px;
}
.aagbn-root[data-image-side="left"] .aagbn-visual::before {
	right: -52px;
	left: auto;
}
.aagbn-visual img {
	position: relative;
	z-index: 1;
	max-width: 100%;
	max-height: 420px;
	width: auto;
	height: auto;
	object-fit: contain;
	display: block;
}
.aagbn-trust {
	position: relative;
	z-index: 1;
	margin: 16px 0 0;
	font-size: 0.82rem;
	color: #3a465c;
	text-align: center;
	font-weight: 500;
	letter-spacing: 0.01em;
}
.aagbn-copy .aagbn-trust {
	color: color-mix(in srgb, var(--aagbn-text) 70%, transparent);
	text-align: left;
	margin-top: 16px;
}

/* Image-only */
.aagbn-imageonly {
	display: block;
	line-height: 0;
	background: var(--aagbn-panel);
}
.aagbn-imageonly img {
	display: block;
	width: 100%;
	height: auto;
	max-height: calc(100vh - 96px);
	object-fit: contain;
}
.aagbn-imageonly-link {
	display: block;
	cursor: pointer;
}

/* Slide-in (desktop corner) */
.aagbn-root[data-layout="slide"] .aagbn-card {
	top: auto;
	bottom: 24px;
	left: auto;
	right: 24px;
	transform: none;
	width: 380px;
	max-width: calc(100vw - 32px);
	animation: aagbn-slide-r 0.34s ease;
}
.aagbn-root[data-layout="slide"][data-slide="left"] .aagbn-card {
	right: auto;
	left: 24px;
	animation-name: aagbn-slide-l;
}
.aagbn-slide {
	padding: 28px 24px 22px;
	display: flex;
	flex-direction: column;
}
.aagbn-slide .aagbn-logo { height: 36px; max-height: 36px; margin-bottom: 12px; padding: 2px 4px; background: #fff; border-radius: 5px; }
.aagbn-slide .aagbn-headline { font-size: 1.7rem; margin-bottom: 10px; }
.aagbn-slide .aagbn-feats { gap: 8px; margin-bottom: 16px; }
.aagbn-slide .aagbn-visual {
	display: none;
}

/* Bar strip */
.aagbn-root[data-layout="bar"] {
	inset: auto 0 0 0;
	height: auto;
	background: transparent;
	pointer-events: none;
}
.aagbn-root[data-layout="bar"][data-bar="top"] {
	inset: 0 0 auto 0;
}
.aagbn-root[data-layout="bar"] .aagbn-card {
	position: relative;
	top: auto;
	left: auto;
	right: auto;
	transform: none;
	width: 100%;
	max-width: none;
	border-radius: 0;
	pointer-events: auto;
	animation: aagbn-bar-up 0.3s ease;
	box-shadow: 0 -8px 28px rgba(8, 14, 30, 0.18);
}
.aagbn-root[data-layout="bar"][data-bar="top"] .aagbn-card {
	animation-name: aagbn-bar-dn;
	box-shadow: 0 8px 28px rgba(8, 14, 30, 0.18);
}
.aagbn-bar {
	display: flex;
	align-items: center;
	gap: 16px 24px;
	padding: 12px 64px 12px 24px;
	max-width: 1200px;
	margin: 0 auto;
	flex-wrap: wrap;
}
.aagbn-bar .aagbn-logo { height: 32px; max-height: 32px; margin: 0; padding: 2px 4px; background: #fff; border-radius: 5px; }
.aagbn-bar .aagbn-headline {
	font-size: 1.15rem;
	margin: 0;
	letter-spacing: -0.02em;
	flex: 1 1 auto;
	line-height: 1.2;
}
.aagbn-bar .aagbn-headline em { display: inline; margin-left: 0.25em; }
.aagbn-bar .aagbn-kicker { margin: 0 0 2px; }
.aagbn-bar .aagbn-cta { margin: 0; }
.aagbn-bar .aagbn-cta2 { margin: 0; min-height: 0; padding: 8px; }
.aagbn-root[data-layout="bar"] .aagbn-close {
	top: 50%;
	transform: translateY(-50%);
	right: 12px;
}


.aagbn-split.is-no-image {
	grid-template-columns: 1fr;
	min-height: 0;
}
.aagbn-split.is-no-image .aagbn-copy {
	padding: 36px 40px 32px;
	max-width: 36rem;
	margin: 0 auto;
	width: 100%;
}
.aagbn-root:has(.aagbn-split.is-no-image) .aagbn-card--modal {
	width: 560px;
}

/* ---- Mobile: bottom sheet (default) or stacked card ---- */
@media (max-width: 780px) {
	.aagbn-root[data-mobile-layout="sheet"][data-layout="split"],
	.aagbn-root[data-mobile-layout="sheet"][data-layout="image"],
	.aagbn-root[data-mobile-layout="sheet"][data-layout="stack"],
	.aagbn-root[data-layout="slide"] {
		/* Sheet sits above the mobile bar and WhatsApp button so both stay usable. */
	}
	.aagbn-root[data-mobile-layout="sheet"][data-layout="split"] .aagbn-card,
	.aagbn-root[data-mobile-layout="sheet"][data-layout="image"] .aagbn-card,
	.aagbn-root[data-mobile-layout="sheet"][data-layout="slide"] .aagbn-card {
		top: auto;
		left: 10px;
		right: 10px;
		bottom: calc(var(--aagbn-mbar) + 76px);
		transform: none;
		width: auto;
		max-width: none;
		max-height: calc(100vh - var(--aagbn-mbar) - 100px);
		max-height: calc(100dvh - var(--aagbn-mbar) - 100px);
		border-radius: var(--aagbn-radius) var(--aagbn-radius) 18px 18px;
		animation: aagbn-sheet 0.34s ease;
	}
	.aagbn-split {
		grid-template-columns: 1fr;
		min-height: 0;
	}
	.aagbn-root[data-image-side="left"] .aagbn-visual {
		order: 0;
	}
	.aagbn-visual {
		min-height: 160px;
		max-height: 220px;
		padding: 16px 16px 12px;
	}
	.aagbn-visual::before { display: none; }
	.aagbn-visual img { max-height: 180px; }
	.aagbn-copy {
		padding: 22px 22px 20px;
	}
	.aagbn-headline { font-size: 1.85rem; }
	.aagbn-root .aagbn-logo { height: 36px; max-height: 36px; margin-bottom: 12px; }
	.aagbn-cta { width: 100%; align-self: stretch; min-height: 44px; }
	.aagbn-cta2 { align-self: center; }
	.aagbn-root[data-layout="slide"] .aagbn-card {
		right: 10px;
		left: 10px;
		width: auto;
	}
	.aagbn-root[data-layout="bar"] {
		bottom: var(--aagbn-mbar);
	}
	.aagbn-root[data-layout="bar"][data-bar="top"] {
		bottom: auto;
	}
	.aagbn-bar {
		padding: 12px 56px 12px 14px;
		gap: 8px;
	}
	.aagbn-bar .aagbn-headline { font-size: 1rem; }
	.aagbn-bar .aagbn-cta { width: 100%; }

	/* Stacked centred card (optional mobile layout). Still not full-screen. */
	.aagbn-root[data-mobile-layout="stack"][data-layout="split"] .aagbn-card,
	.aagbn-root[data-mobile-layout="stack"][data-layout="image"] .aagbn-card {
		top: 48%;
		left: 12px;
		right: 12px;
		bottom: auto;
		transform: translateY(-50%);
		width: auto;
		max-height: calc(100vh - var(--aagbn-mbar) - 96px);
		max-height: calc(100dvh - var(--aagbn-mbar) - 96px);
		animation: aagbn-pop 0.3s ease;
	}
}

/* Admin live preview: treat the frame as a phone when asked */
.aagbn-live-frame.is-mobile .aagbn-root[data-mobile-layout="sheet"] .aagbn-card,
.aagbn-live-frame.is-mobile .aagbn-root[data-layout="slide"] .aagbn-card {
	top: auto;
	left: 8px;
	right: 8px;
	bottom: 86px;
	transform: none;
	width: auto;
	max-width: none;
	max-height: calc(100% - 100px);
	border-radius: 18px;
	animation: none;
}
.aagbn-live-frame.is-mobile .aagbn-split {
	grid-template-columns: 1fr;
	min-height: 0;
}
.aagbn-live-frame.is-mobile .aagbn-visual::before { display: none; }
.aagbn-live-frame.is-mobile .aagbn-visual { min-height: 120px; max-height: 150px; padding: 12px; }
.aagbn-live-frame.is-mobile .aagbn-visual img { max-height: 120px; }
.aagbn-live-frame.is-mobile .aagbn-copy { padding: 16px; }
.aagbn-live-frame.is-mobile .aagbn-headline { font-size: 1.55rem; }
.aagbn-live-frame.is-mobile .aagbn-cta { width: 100%; }
.aagbn-live-frame.is-mobile .aagbn-root[data-layout="bar"] { inset: auto 0 0 0; }
.aagbn-live-frame.is-mobile .aagbn-root[data-layout="bar"][data-bar="top"] { inset: 0 0 auto 0; }

/* Preview root is relative inside the frame */
.aagbn-root--preview {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: none;
}
.aagbn-root--preview.is-open { display: block; }
.aagbn-root--preview .aagbn-backdrop { cursor: default; animation: none; }
.aagbn-root--preview .aagbn-card { animation: none; pointer-events: none; }
.aagbn-root--preview .aagbn-close { pointer-events: none; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
	.aagbn-root .aagbn-backdrop,
	.aagbn-root .aagbn-card,
	.aagbn-root .aagbn-cta {
		animation: none !important;
		transition: none !important;
		-webkit-backdrop-filter: none !important;
		backdrop-filter: none !important;
	}
}

@keyframes aagbn-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}
@keyframes aagbn-pop {
	from { opacity: 0; transform: translate(-50%, -48%) scale(0.97); }
	to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes aagbn-sheet {
	from { opacity: 0; transform: translateY(18px); }
	to { opacity: 1; transform: translateY(0); }
}
@keyframes aagbn-slide-r {
	from { opacity: 0; transform: translateX(20px); }
	to { opacity: 1; transform: translateX(0); }
}
@keyframes aagbn-slide-l {
	from { opacity: 0; transform: translateX(-20px); }
	to { opacity: 1; transform: translateX(0); }
}
@keyframes aagbn-bar-up {
	from { transform: translateY(100%); }
	to { transform: translateY(0); }
}
@keyframes aagbn-bar-dn {
	from { transform: translateY(-100%); }
	to { transform: translateY(0); }
}
