/**
 * Commino Tracking Admin — consent banner.
 *
 * Deliberately low-specificity and variable-driven so a theme can restyle it
 * without !important. The accent colour is injected as --commino-accent from the
 * plugin settings.
 */

.commino-consent {
	--commino-bg: #ffffff;
	--commino-fg: #1f2430;
	--commino-muted: #5b6472;
	--commino-border: #dfe3ea;
	--commino-radius: 10px;
	--commino-accent: #1d4ed8;
	--commino-accent-fg: #ffffff;

	position: fixed;
	z-index: 999999;
	inset-inline: 0;
	display: none;
	font-family: inherit;
	font-size: 15px;
	line-height: 1.55;
	color: var(--commino-fg);
}

.commino-consent.is-visible {
	display: block;
}

.commino-consent[hidden] {
	display: none;
}

.commino-consent--bottom {
	bottom: 0;
}

.commino-consent--top {
	top: 0;
}

.commino-consent--dark {
	--commino-bg: #171a21;
	--commino-fg: #f2f4f8;
	--commino-muted: #a7b0bf;
	--commino-border: #2c313c;
}

@media (prefers-color-scheme: dark) {
	.commino-consent--auto {
		--commino-bg: #171a21;
		--commino-fg: #f2f4f8;
		--commino-muted: #a7b0bf;
		--commino-border: #2c313c;
	}
}

.commino-consent__overlay {
	position: fixed;
	inset: 0;
	background: rgba(10, 12, 16, 0.55);
}

.commino-consent__panel {
	position: relative;
	box-sizing: border-box;
	max-width: 1100px;
	margin: 0 auto;
	padding: 20px clamp(16px, 4vw, 28px);
	background: var(--commino-bg);
	border-top: 1px solid var(--commino-border);
	box-shadow: 0 -8px 30px rgba(15, 20, 30, 0.12);
}

.commino-consent--top .commino-consent__panel {
	border-top: 0;
	border-bottom: 1px solid var(--commino-border);
	box-shadow: 0 8px 30px rgba(15, 20, 30, 0.12);
}

.commino-consent--box .commino-consent__panel,
.commino-consent--modal .commino-consent__panel {
	max-width: 460px;
	margin: 0 auto 24px;
	border: 1px solid var(--commino-border);
	border-radius: var(--commino-radius);
}

.commino-consent--box .commino-consent__panel {
	margin-inline-start: 24px;
	margin-inline-end: auto;
}

.commino-consent--modal {
	display: none;
	inset: 0;
}

.commino-consent--modal.is-visible {
	display: grid;
	place-items: center;
}

.commino-consent__title {
	margin: 0 0 6px;
	font-size: 1.05rem;
	font-weight: 650;
	line-height: 1.3;
	color: var(--commino-fg);
}

.commino-consent__message {
	margin: 0;
	color: var(--commino-muted);
	font-size: 0.94rem;
}

.commino-consent__policy {
	color: var(--commino-accent);
	text-decoration: underline;
	white-space: nowrap;
}

.commino-consent__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
	margin-top: 16px;
}

.commino-consent--bar .commino-consent__panel {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	align-items: center;
	justify-content: space-between;
}

.commino-consent--bar .commino-consent__intro {
	flex: 1 1 420px;
}

.commino-consent--bar .commino-consent__actions {
	margin-top: 0;
}

.commino-consent--bar .commino-consent__prefs {
	flex: 1 1 100%;
	order: 3;
}

/*
 * Accept and reject are the same size and weight on purpose. Making reject
 * quieter than accept is the exact dark pattern that draws enforcement.
 */
.commino-consent__button {
	appearance: none;
	box-sizing: border-box;
	min-height: 42px;
	padding: 9px 18px;
	border: 1px solid var(--commino-border);
	border-radius: 7px;
	background: transparent;
	color: var(--commino-fg);
	font: inherit;
	font-size: 0.92rem;
	font-weight: 560;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color 0.14s ease, border-color 0.14s ease, opacity 0.14s ease;
}

.commino-consent__button:hover {
	border-color: var(--commino-accent);
}

.commino-consent__button:focus-visible {
	outline: 2px solid var(--commino-accent);
	outline-offset: 2px;
}

.commino-consent__button--primary {
	background: var(--commino-accent);
	border-color: var(--commino-accent);
	color: var(--commino-accent-fg);
}

.commino-consent__button--primary:hover {
	opacity: 0.9;
}

.commino-consent__button--secondary {
	background: transparent;
}

.commino-consent__button--ghost {
	border-color: transparent;
	color: var(--commino-muted);
	text-decoration: underline;
	padding-inline: 6px;
}

.commino-consent__prefs {
	margin-top: 18px;
	padding-top: 16px;
	border-top: 1px solid var(--commino-border);
}

.commino-consent__fieldset {
	margin: 0;
	padding: 0;
	border: 0;
	display: grid;
	gap: 14px;
}

@media (min-width: 720px) {
	.commino-consent__fieldset {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.commino-consent__toggle {
	display: flex;
	gap: 9px;
	align-items: center;
	font-weight: 580;
	cursor: pointer;
}

.commino-consent__toggle input[disabled] {
	cursor: not-allowed;
}

.commino-consent__always {
	margin-inline-start: 6px;
	padding: 1px 7px;
	border-radius: 999px;
	background: var(--commino-border);
	color: var(--commino-muted);
	font-size: 0.72rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.commino-consent__category-description {
	margin: 4px 0 0 26px;
	color: var(--commino-muted);
	font-size: 0.86rem;
}

.commino-consent-reopen {
	appearance: none;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	text-decoration: underline;
	cursor: pointer;
}

/* Cookie declaration table, rendered by [commino_cookie_table]. */

.commino-cookie-declaration__table {
	width: 100%;
	margin: 0 0 28px;
	border-collapse: collapse;
	font-size: 0.92rem;
}

.commino-cookie-declaration__table th,
.commino-cookie-declaration__table td {
	padding: 9px 12px;
	border-bottom: 1px solid #e3e6ec;
	text-align: start;
	vertical-align: top;
}

.commino-cookie-declaration__table th {
	font-weight: 640;
	white-space: nowrap;
}

.commino-cookie-declaration__table code {
	font-size: 0.86em;
	word-break: break-word;
}

.commino-cookie-declaration__intro {
	margin: 0 0 10px;
	color: #5b6472;
}

@media (prefers-reduced-motion: reduce) {
	.commino-consent__button {
		transition: none;
	}
}
