/* ═══════════════════════════════════════════════════════════════════
   ResultsAiX Consent - the visitor side.

   Everything is driven by the custom properties written into the page by
   the plugin (--rxcf-*), so the admin colour pickers are the single source
   for how this looks. Nothing here inherits from the theme except the font,
   and every rule is scoped under .rxc-root so a theme cannot drag the
   banner around and the banner cannot drag the theme around either.
   ═══════════════════════════════════════════════════════════════════ */

.rxc-root {
	--rxcf-bg: #ffffff;
	--rxcf-text: #1f2430;
	--rxcf-accent: #f59e0b;
	--rxcf-accent-tx: #111111;
	--rxcf-sec: #f1f3f7;
	--rxcf-sec-tx: #1f2430;
	--rxcf-radius: 14px;
	--rxcf-size: 14px;
	--rxcf-line: rgba(0, 0, 0, .12);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.rxc-root.rxc-dark {
	--rxcf-line: rgba(255, 255, 255, .16);
}

.rxc-root [hidden] { display: none !important; }
.rxc-root *, .rxc-root *::before, .rxc-root *::after { box-sizing: border-box; }

.rxc-sr {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Overlay ------------------------------------------------------------ */
.rxc-overlay {
	position: fixed; inset: 0; background: rgba(9, 12, 20, .55);
	z-index: 2147483000; animation: rxc-fade .18s ease-out;
}

/* Banner ------------------------------------------------------------- */
.rxc-banner {
	position: fixed; z-index: 2147483001;
	background: var(--rxcf-bg); color: var(--rxcf-text);
	border-radius: var(--rxcf-radius);
	box-shadow: 0 18px 48px -12px rgba(10, 14, 25, .38), 0 2px 8px rgba(10, 14, 25, .12);
	font-size: var(--rxcf-size); line-height: 1.6;
	max-width: 440px; width: calc(100% - 32px);
	animation: rxc-rise .22s ease-out;
}
.rxc-banner-in { padding: 22px 24px; }
.rxc-banner-title {
	margin: 0 0 8px; font-size: calc(var(--rxcf-size) + 3px); font-weight: 800;
	color: var(--rxcf-text); line-height: 1.3;
}
.rxc-banner-text { margin: 0; color: var(--rxcf-text); opacity: .88; }
.rxc-banner-links { margin: 12px 0 0; display: flex; gap: 16px; flex-wrap: wrap; }
.rxc-banner-links a {
	color: var(--rxcf-text); opacity: .75; font-size: calc(var(--rxcf-size) - 1px);
	text-decoration: underline;
}
.rxc-banner-links a:hover { opacity: 1; }

/* Positions ---------------------------------------------------------- */
.rxc-pos-bottom-left  .rxc-banner { left: 16px; bottom: 16px; }
.rxc-pos-bottom-right .rxc-banner { right: 16px; bottom: 16px; }
.rxc-pos-bottom       .rxc-banner { left: 50%; bottom: 16px; transform: translateX(-50%); }
.rxc-pos-top          .rxc-banner { left: 50%; top: 16px; transform: translateX(-50%); }

/* A bar spans the window. A centred box sits in the middle of it. */
.rxc-layout-bar .rxc-banner {
	left: 0; right: 0; width: 100%; max-width: none; border-radius: 0; transform: none;
}
.rxc-layout-bar.rxc-pos-top .rxc-banner { top: 0; bottom: auto; }
.rxc-layout-bar:not(.rxc-pos-top) .rxc-banner { bottom: 0; top: auto; }
.rxc-layout-bar .rxc-banner-in {
	display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
	max-width: 1240px; margin: 0 auto; padding: 16px 24px;
}
.rxc-layout-bar .rxc-banner-title { width: 100%; margin-bottom: 2px; }
.rxc-layout-bar .rxc-banner-text { flex: 1 1 320px; margin: 0; }
.rxc-layout-bar .rxc-banner-links { margin: 0; }
.rxc-layout-bar .rxc-banner-btns { margin-top: 0; }

.rxc-layout-center .rxc-banner {
	left: 50%; top: 50%; bottom: auto; transform: translate(-50%, -50%);
	max-width: 520px;
}

/* Buttons ------------------------------------------------------------ */
.rxc-banner-btns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* Scoped under .rxc-root on purpose. The admin screens load this stylesheet
   too, for the live preview, and they have a .rxc-btn of their own - without
   the scope, this would restyle every button in wp-admin. */
.rxc-root .rxc-btn {
	appearance: none; border: 1px solid transparent; cursor: pointer;
	font: inherit; font-weight: 700; font-size: calc(var(--rxcf-size) - 0.5px);
	padding: 11px 20px; border-radius: calc(var(--rxcf-radius) - 5px);
	line-height: 1.2; transition: filter .15s, transform .1s;
	display: inline-block; text-align: center; text-decoration: none;
}
.rxc-root .rxc-btn:hover { filter: brightness(1.06); }
.rxc-root .rxc-btn:active { transform: translateY(1px); }
.rxc-root .rxc-btn:focus-visible { outline: 3px solid var(--rxcf-accent); outline-offset: 2px; }

/* Accept and reject share ONE class. They are the same size, the same
   weight and the same colour, because a reject button dressed down to a
   whisper is the dark pattern this plugin exists to avoid. */
.rxc-root .rxc-btn-main { background: var(--rxcf-accent); color: var(--rxcf-accent-tx); flex: 1 1 auto; min-width: 132px; }
.rxc-root .rxc-btn-quiet {
	background: var(--rxcf-sec); color: var(--rxcf-sec-tx);
	border-color: var(--rxcf-line);
}

.rxc-x {
	position: absolute; top: 8px; right: 10px; background: none; border: 0;
	font-size: 24px; line-height: 1; cursor: pointer; color: var(--rxcf-text);
	opacity: .45; padding: 4px 8px;
}
.rxc-x:hover { opacity: 1; }
.rxc-x:focus-visible { outline: 3px solid var(--rxcf-accent); outline-offset: 2px; }
/* The close X is absolutely placed inside each of these two. The banner is
   already fixed, which is a containing block; the panel's inner box is not,
   so it is given one. */
.rxc-panel-in { position: relative; }

/* Preferences panel --------------------------------------------------- */
.rxc-panel {
	position: fixed; inset: 0; z-index: 2147483002;
	display: flex; align-items: center; justify-content: center; padding: 20px;
}
.rxc-panel-in {
	background: var(--rxcf-bg); color: var(--rxcf-text);
	border-radius: var(--rxcf-radius); width: 100%; max-width: 620px;
	max-height: min(86vh, 760px); display: flex; flex-direction: column;
	box-shadow: 0 30px 70px -20px rgba(10, 14, 25, .55);
	font-size: var(--rxcf-size); line-height: 1.6;
	animation: rxc-rise .22s ease-out;
}
.rxc-panel-head {
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	padding: 20px 24px 14px; border-bottom: 1px solid var(--rxcf-line);
}
.rxc-panel-head h2 { margin: 0; font-size: calc(var(--rxcf-size) + 4px); font-weight: 800; }
.rxc-panel-head .rxc-x { position: static; }
.rxc-panel-body { padding: 6px 24px 10px; overflow-y: auto; flex: 1; }
.rxc-panel-foot {
	display: flex; gap: 10px; flex-wrap: wrap; padding: 16px 24px 20px;
	border-top: 1px solid var(--rxcf-line);
}

/* Category rows -------------------------------------------------------- */
.rxc-cat { padding: 18px 0; border-bottom: 1px solid var(--rxcf-line); }
.rxc-cat:last-child { border-bottom: 0; }
.rxc-cat-head { display: flex; align-items: center; gap: 14px; }
.rxc-cat-name { font-weight: 700; font-size: calc(var(--rxcf-size) + 1px); flex: 1; }
.rxc-cat-desc { margin: 6px 0 0; opacity: .82; }
.rxc-always {
	font-size: calc(var(--rxcf-size) - 2px); font-weight: 700; text-transform: uppercase;
	letter-spacing: .04em; opacity: .6;
}
.rxc-cat-cookies { margin-top: 12px; }
.rxc-cat-cookies > summary {
	cursor: pointer; font-size: calc(var(--rxcf-size) - 1px); font-weight: 600;
	opacity: .72; padding: 4px 0;
}
.rxc-cat-cookies > summary:hover { opacity: 1; }

/* Switch --------------------------------------------------------------- */
.rxc-switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; flex: none; }
.rxc-switch input { position: absolute; opacity: 0; width: 46px; height: 26px; margin: 0; cursor: pointer; }
.rxc-slider {
	width: 46px; height: 26px; border-radius: 99px; background: var(--rxcf-sec);
	border: 1px solid var(--rxcf-line); position: relative; transition: background .18s;
}
.rxc-slider::after {
	content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px;
	border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
	transition: transform .18s;
}
.rxc-switch input:checked + .rxc-slider { background: var(--rxcf-accent); }
.rxc-switch input:checked + .rxc-slider::after { transform: translateX(20px); }
.rxc-switch input:focus-visible + .rxc-slider { outline: 3px solid var(--rxcf-accent); outline-offset: 2px; }

/* Cookie tables -------------------------------------------------------- */
.rxc-tbl-wrap { overflow-x: auto; margin: 10px 0 4px; }
.rxc-tbl { width: 100%; border-collapse: collapse; font-size: calc(var(--rxcf-size) - 1px); }
.rxc-tbl th {
	text-align: left; padding: 8px 10px; border-bottom: 2px solid var(--rxcf-line);
	font-size: calc(var(--rxcf-size) - 2px); text-transform: uppercase;
	letter-spacing: .04em; opacity: .6; white-space: nowrap;
}
.rxc-tbl td { padding: 9px 10px; border-bottom: 1px solid var(--rxcf-line); vertical-align: top; }
.rxc-tbl code { font-size: calc(var(--rxcf-size) - 2px); word-break: break-all; }
.rxc-tbl-h { margin: 26px 0 4px; font-size: calc(var(--rxcf-size) + 2px); }
.rxc-tbl-d { margin: 0 0 6px; opacity: .8; }
.rxc-tbl-empty { opacity: .7; font-style: italic; }
.rxc-tbl-updated { margin-top: 14px; font-size: calc(var(--rxcf-size) - 1px); opacity: .7; }

/* Reopen button -------------------------------------------------------- */
.rxc-reopen {
	position: fixed; z-index: 2147482999; width: 46px; height: 46px; border-radius: 50%;
	border: 1px solid var(--rxcf-line); background: var(--rxcf-bg); color: var(--rxcf-text);
	font-size: 21px; line-height: 1; cursor: pointer; padding: 0;
	box-shadow: 0 6px 20px -6px rgba(10, 14, 25, .45);
	transition: transform .15s, box-shadow .15s;
}
.rxc-reopen:hover { transform: translateY(-2px); box-shadow: 0 10px 26px -8px rgba(10, 14, 25, .55); }
.rxc-reopen:focus-visible { outline: 3px solid var(--rxcf-accent); outline-offset: 2px; }
.rxc-reopen-bottom-left { left: 16px; bottom: 16px; }
.rxc-reopen-bottom-right { right: 16px; bottom: 16px; }
/* While the banner is open the little button would sit underneath it. */
.rxc-open .rxc-reopen { display: none; }

/* Inline triggers from the shortcode ------------------------------------ */
.rxc-inline-link {
	background: none; border: 0; padding: 0; font: inherit; cursor: pointer;
	color: inherit; text-decoration: underline;
}
.rxc-inline-btn {
	background: var(--rxcf-accent, #f59e0b); color: var(--rxcf-accent-tx, #111);
	border: 0; border-radius: 8px; padding: 10px 18px; font: inherit;
	font-weight: 700; cursor: pointer;
}

/* Blocked embed placeholder --------------------------------------------- */
.rxc-embed-block {
	display: flex; align-items: center; justify-content: center;
	background: #f1f3f7; color: #1f2430; border: 1px dashed rgba(0, 0, 0, .22);
	border-radius: 12px; min-height: 180px; padding: 24px; text-align: center;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.rxc-embed-inner { max-width: 420px; }
.rxc-embed-ico { font-size: 26px; line-height: 1; display: block; margin-bottom: 8px; opacity: .6; }
.rxc-embed-text { margin: 0 0 14px; font-size: 14px; line-height: 1.6; }
.rxc-embed-btn {
	background: var(--rxcf-accent, #f59e0b); color: var(--rxcf-accent-tx, #111);
	border: 0; border-radius: 9px; padding: 10px 20px; font-weight: 700;
	font-size: 13.5px; cursor: pointer;
}
.rxc-embed-btn:hover { filter: brightness(1.06); }

/* Small screens ---------------------------------------------------------- */
@media (max-width: 600px) {
	.rxc-banner {
		left: 8px !important; right: 8px !important; bottom: 8px !important;
		top: auto !important; transform: none !important;
		width: auto; max-width: none;
	}
	.rxc-layout-center .rxc-banner { top: auto !important; }
	.rxc-layout-bar .rxc-banner { left: 0 !important; right: 0 !important; bottom: 0 !important; }
	.rxc-banner-btns .rxc-btn { flex: 1 1 100%; }
	.rxc-panel { padding: 0; align-items: flex-end; }
	.rxc-panel-in { max-height: 92vh; border-radius: var(--rxcf-radius) var(--rxcf-radius) 0 0; }
}

/* While the panel is open the page behind it must not scroll under it. */
html.rxc-locked, html.rxc-locked body { overflow: hidden; }

@keyframes rxc-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rxc-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; } }

/* A centred or bottom-centred banner is positioned with a transform, and
   an animation that also sets transform would fight it. Those two keep
   their own entrance. */
.rxc-pos-bottom .rxc-banner, .rxc-pos-top .rxc-banner, .rxc-layout-center .rxc-banner {
	animation-name: rxc-fade;
}

@media (prefers-reduced-motion: reduce) {
	.rxc-banner, .rxc-panel-in, .rxc-overlay { animation: none; }
	.rxc-btn, .rxc-reopen, .rxc-slider, .rxc-slider::after { transition: none; }
}

/* The consent receipt line in the choices panel. */
.rxc-receipt {
	margin: 0; padding: 10px 24px 0; font-size: calc(var(--rxcf-size) - 2.5px);
	opacity: .62; font-variant-numeric: tabular-nums; word-break: break-all;
}
