/* ==========================================================================
   Cookie Consent — premium card, bottom-right
   Prefix: .idx-cc   (deliberately unique; nothing else in the theme uses it)
   Depends on: nothing. Falls back to sensible system fonts if tokens missing.
   ========================================================================== */

.idx-cc {
	--cc-brand: #e8622c;
	--cc-brand-dk: #c94e1c;
	--cc-ink: #151b22;
	--cc-ink-2: #53606d;
	--cc-line: #e3e8ee;
	--cc-bg: #ffffff;
	--cc-r: 18px;
	--cc-sh: 0 2px 6px rgba(16, 24, 40, .06), 0 18px 48px -12px rgba(16, 24, 40, .28);
	--cc-ease: cubic-bezier(.16, 1, .3, 1);

	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 9990; /* below the site's modal overlays so quote forms stay on top */
	width: min(420px, calc(100vw - 48px));
	font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
	font-size: 14px;
	line-height: 1.6;
	color: var(--cc-ink);
	-webkit-font-smoothing: antialiased;
}

/* Must beat any display value set below, otherwise `hidden` does nothing. */
.idx-cc[hidden],
.idx-cc .idx-cc__view[hidden] {
	display: none !important;
}

/* ── Card ────────────────────────────────────────────────────────────── */
.idx-cc__card {
	position: relative;
	background: var(--cc-bg);
	border: 1px solid var(--cc-line);
	border-radius: var(--cc-r);
	box-shadow: var(--cc-sh);
	padding: 22px 24px 18px;
	overflow: hidden;
}

/* Entrance is a CSS animation, not a class toggled by JS.
   Rationale: visibility must never depend on requestAnimationFrame firing —
   if the frame loop stalls, a `transition` starting from opacity:0 leaves the
   banner permanently invisible. An animation with `both` fill settles on the
   final state by itself. */
.idx-cc:not([hidden]) .idx-cc__card {
	animation: idx-cc-in .42s var(--cc-ease) both;
}

@keyframes idx-cc-in {
	from {
		transform: translateY(14px) scale(.985);
		opacity: 0;
	}
	to {
		transform: none;
		opacity: 1;
	}
}

/* Brand hairline across the top — the only nod to decoration. */
.idx-cc__card::before {
	content: "";
	position: absolute;
	inset: 0 0 auto 0;
	height: 3px;
	background: linear-gradient(90deg, var(--cc-brand) 0%, #f5915c 46%, transparent 88%);
}

.idx-cc__card:focus {
	outline: none;
}

/* ── Badge ───────────────────────────────────────────────────────────── */
.idx-cc__badge {
	display: inline-grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border-radius: 10px;
	margin-bottom: 10px;
	color: var(--cc-brand-dk);
	background: linear-gradient(160deg, #fff1ea, #ffe6da);
	border: 1px solid rgba(232, 98, 44, .18);
}

/* ── Type ────────────────────────────────────────────────────────────── */
.idx-cc__title {
	margin: 0 0 8px;
	font-size: 16.5px;
	font-weight: 700;
	letter-spacing: -.15px;
	line-height: 1.3;
	color: var(--cc-ink);
}

.idx-cc__desc {
	margin: 0 0 16px;
	font-size: 13.4px;
	line-height: 1.65;
	color: var(--cc-ink-2);
}

/* ── Buttons ─────────────────────────────────────────────────────────── */
.idx-cc__actions {
	display: flex;
	gap: 9px;
	margin: 0 0 12px;
}

.idx-cc__btn {
	-webkit-appearance: none;
	appearance: none;
	flex: 1 1 auto;
	border: 0;
	border-radius: 10px;
	padding: 11px 14px;
	font-size: 13.4px;
	font-weight: 650;
	font-family: inherit;
	line-height: 1.2;
	cursor: pointer;
	transition: transform .18s var(--cc-ease), box-shadow .18s ease, background .18s ease, border-color .18s ease;
	white-space: nowrap;
}

.idx-cc__btn--primary {
	color: #fff;
	background: linear-gradient(180deg, #ef6f38, var(--cc-brand));
	box-shadow: 0 2px 0 var(--cc-brand-dk), 0 6px 16px -6px rgba(232, 98, 44, .55);
}

.idx-cc__btn--primary:hover {
	background: linear-gradient(180deg, #f37b48, #e05a24);
	transform: translateY(-1px);
	box-shadow: 0 3px 0 var(--cc-brand-dk), 0 10px 22px -8px rgba(232, 98, 44, .6);
}

.idx-cc__btn--primary:active {
	transform: translateY(1px);
	box-shadow: 0 1px 0 var(--cc-brand-dk);
}

.idx-cc__btn--ghost {
	color: var(--cc-ink);
	background: #eef2f6;
	border: 1px solid #dde4ec;
	box-shadow: 0 2px 0 rgba(16, 24, 40, .04);
}

.idx-cc__btn--ghost:hover {
	background: #e5ebf2;
	border-color: #cfd8e3;
	transform: translateY(-1px);
}

.idx-cc__btn:focus-visible,
.idx-cc__link:focus-visible,
.idx-cc__close:focus-visible {
	outline: 2px solid var(--cc-brand);
	outline-offset: 2px;
}

/* ── Footnote links ──────────────────────────────────────────────────── */
.idx-cc__foot {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	font-size: 12.6px;
}

.idx-cc__link {
	-webkit-appearance: none;
	appearance: none;
	background: none;
	border: 0;
	padding: 0;
	font: inherit;
	color: var(--cc-ink-2);
	text-decoration: underline;
	text-decoration-color: #c3ccd6;
	text-underline-offset: 2px;
	cursor: pointer;
	transition: color .15s ease, text-decoration-color .15s ease;
}

.idx-cc__link:hover {
	color: var(--cc-brand-dk);
	text-decoration-color: var(--cc-brand);
}

.idx-cc__sep {
	color: #c3ccd6;
}

/* ── GPC notice (shown only when the browser sends the signal) ───────── */
.idx-cc__gpc {
	margin: -8px 0 14px;
	padding: 9px 12px;
	font-size: 12.2px;
	line-height: 1.55;
	color: #7a4900;
	background: #fff6e5;
	border: 1px solid rgba(178, 106, 0, .2);
	border-radius: 8px;
}

.idx-cc__gpc[hidden] {
	display: none !important;
}

/* ── Preferences view ────────────────────────────────────────────────── */
.idx-cc__prefs-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 6px;
}

.idx-cc__prefs-head .idx-cc__title {
	margin: 0;
}

.idx-cc__close {
	flex: none;
	-webkit-appearance: none;
	appearance: none;
	display: grid;
	place-items: center;
	width: 28px;
	height: 28px;
	margin: -4px -6px 0 0;
	border: 1px solid var(--cc-line);
	border-radius: 8px;
	background: #fff;
	color: var(--cc-ink-2);
	cursor: pointer;
	transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.idx-cc__close:hover {
	background: #f4f7fa;
	color: var(--cc-ink);
	border-color: #c9d3dd;
}

.idx-cc__list {
	list-style: none;
	margin: 0 0 16px;
	padding: 0;
}

.idx-cc__row {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	padding: 12px 0;
	border-top: 1px solid #eef2f6;
}

.idx-cc__row:first-child {
	border-top: 0;
	padding-top: 2px;
}

.idx-cc__row-main {
	flex: 1 1 auto;
	min-width: 0;
}

.idx-cc__row-name {
	display: block;
	font-size: 13.4px;
	font-weight: 650;
	color: var(--cc-ink);
	margin-bottom: 2px;
}

label.idx-cc__row-name {
	cursor: pointer;
}

.idx-cc__row-desc {
	display: block;
	font-size: 12.4px;
	line-height: 1.55;
	color: var(--cc-ink-2);
}

.idx-cc__locked {
	flex: none;
	margin-top: 1px;
	font-size: 11px;
	font-weight: 650;
	letter-spacing: .02em;
	color: #0f8a4d;
	background: #e9f8f0;
	border: 1px solid rgba(15, 138, 77, .18);
	border-radius: 6px;
	padding: 3px 8px;
	white-space: nowrap;
}

/* ── Switch ──────────────────────────────────────────────────────────── */
.idx-cc__switch {
	position: relative;
	flex: none;
	width: 42px;
	height: 24px;
	margin-top: 2px;
}

.idx-cc__switch input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
	z-index: 1;
}

.idx-cc__switch-ui {
	position: absolute;
	inset: 0;
	border-radius: 99px;
	background: #d8e0e8;
	border: 1px solid #c9d3dd;
	transition: background .22s ease, border-color .22s ease;
	pointer-events: none;
}

.idx-cc__switch-ui::after {
	content: "";
	position: absolute;
	top: 2px;
	left: 2px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(16, 24, 40, .22);
	transition: transform .26s var(--cc-ease);
}

.idx-cc__switch input:checked + .idx-cc__switch-ui {
	background: linear-gradient(180deg, #ef6f38, var(--cc-brand));
	border-color: var(--cc-brand-dk);
}

.idx-cc__switch input:checked + .idx-cc__switch-ui::after {
	transform: translateX(18px);
}

.idx-cc__switch input:focus-visible + .idx-cc__switch-ui {
	outline: 2px solid var(--cc-brand);
	outline-offset: 2px;
}

/* ── Toast (save confirmation) ───────────────────────────────────────── */
.idx-cc__toast {
	position: absolute;
	left: 50%;
	bottom: 10px;
	transform: translate(-50%, 8px);
	background: #151b22;
	color: #fff;
	font-size: 12.2px;
	font-weight: 600;
	padding: 7px 14px;
	border-radius: 99px;
	opacity: 0;
	pointer-events: none;
	transition: opacity .22s ease, transform .22s var(--cc-ease);
	white-space: nowrap;
}

.idx-cc__toast.is-on {
	opacity: 1;
	transform: translate(-50%, 0);
}

/* ── Footer trigger (injected by JS next to Privacy Policy) ──────────── */
.idx-cc-trigger {
	cursor: pointer;
}

/* ── Mobile: full-width sheet at the bottom ──────────────────────────── */
@media (max-width: 640px) {
	.idx-cc {
		right: 0;
		left: 0;
		bottom: 0;
		width: 100%;
	}

	.idx-cc__card {
		border-radius: var(--cc-r) var(--cc-r) 0 0;
		border-left: 0;
		border-right: 0;
		border-bottom: 0;
		padding: 18px 18px calc(16px + env(safe-area-inset-bottom, 0px));
		max-height: 88vh;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
	}

	.idx-cc__actions {
		flex-direction: column-reverse; /* primary ends up on top, thumb-friendly */
	}

	.idx-cc__btn {
		width: 100%;
		padding: 13px 14px;
	}

	.idx-cc__row {
		gap: 10px;
	}

	.idx-cc__desc {
		font-size: 13.2px;
	}
}

/* ── Reduced motion ──────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
	.idx-cc:not([hidden]) .idx-cc__card {
		animation: none !important;
	}

	.idx-cc__card,
	.idx-cc__card::before,
	.idx-cc__btn,
	.idx-cc__switch-ui,
	.idx-cc__switch-ui::after,
	.idx-cc__toast {
		transition-duration: .01ms !important;
		transition-delay: 0ms !important;
	}
}

/* ── Print: never show the banner ────────────────────────────────────── */
@media print {
	.idx-cc {
		display: none !important;
	}
}

/* ── Dark mode (site-wide dark sections / OS preference) ─────────────── */
@media (prefers-color-scheme: dark) {
	.idx-cc {
		--cc-ink: #eef2f6;
		--cc-ink-2: #a4b0bd;
		--cc-line: #2b3542;
		--cc-bg: #171e26;
		--cc-sh: 0 2px 6px rgba(0, 0, 0, .4), 0 18px 48px -12px rgba(0, 0, 0, .6);
	}

	.idx-cc__btn--ghost {
		background: #26303c;
		border-color: #3c4857;
		color: #eef2f6;
	}

	.idx-cc__btn--ghost:hover {
		background: #2f3a47;
		border-color: #4a5768;
	}

	.idx-cc__close {
		background: #1f2833;
		border-color: #313c49;
		color: #a4b0bd;
	}

	.idx-cc__close:hover {
		background: #26303c;
		color: #eef2f6;
	}

	.idx-cc__row {
		border-top-color: #232d38;
	}

	.idx-cc__switch-ui {
		background: #2b3542;
		border-color: #3c4857;
	}

	.idx-cc__locked {
		color: #6ee7a8;
		background: rgba(15, 138, 77, .16);
		border-color: rgba(110, 231, 168, .22);
	}

	.idx-cc__toast {
		background: #eef2f6;
		color: #151b22;
	}
}
