/* ==========================================================================
   Bannerul de cookie-uri (primul nivel) și dialogul de setări.
   Cele trei butoane au intenționat ACELAȘI stil: refuzul trebuie să fie la fel
   de vizibil și de ușor ca acceptul (EDPB, Cookie Banner Taskforce).
   ========================================================================== */

.consent {
	position: fixed;
	left: 50%;
	bottom: 20px;
	z-index: 90;
	width: min(1080px, calc(100% - 40px));
	transform: translateX(-50%);
	background: var(--c-white);
	border: 1px solid var(--c-line);
	border-radius: 22px;
	box-shadow: 0 24px 60px -28px rgba(1, 28, 37, 0.45), 0 2px 6px rgba(1, 28, 37, 0.06);
	animation: consent-in 0.25s ease-out;
}

.consent[hidden] {
	display: none;
}

@keyframes consent-in {
	from {
		opacity: 0;
		transform: translate(-50%, 12px);
	}
}

.consent__inner {
	display: flex;
	align-items: center;
	gap: 28px;
	padding: 22px 26px;
}

.consent__body {
	flex: 1;
	min-width: 0;
}

.consent__title {
	font-size: 20px;
	color: var(--c-ink);
}

.consent__text {
	margin: 6px 0 0;
	font-size: 14px;
	line-height: 1.6;
	color: var(--c-text-2);
}

.consent__text a,
.consent-dialog__intro a {
	text-decoration: underline;
	text-underline-offset: 2px;
	white-space: nowrap;
}

.consent__actions {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
	flex: none;
	width: 470px;
}

/* Un singur stil pentru toate cele trei butoane. */
.consent-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 0 14px;
	border: 1.5px solid var(--c-ink);
	border-radius: 14px;
	background: var(--c-ink);
	color: var(--c-white);
	font-family: var(--f-head);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.consent-btn:hover {
	background: var(--c-ink-hover);
	border-color: var(--c-ink-hover);
}

/* Dialogul de setări ---------------------------------------------------- */
.consent-dialog {
	width: min(600px, calc(100% - 32px));
	max-height: calc(100% - 48px);
	padding: 0;
	border: 0;
	border-radius: 24px;
	background: var(--c-white);
	box-shadow: 0 30px 80px -30px rgba(1, 28, 37, 0.5);
	overflow-y: auto;
	overscroll-behavior: contain;
}

.consent-dialog::backdrop {
	background: rgba(1, 28, 37, 0.45);
}

.consent-dialog__form {
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding: 24px 26px 26px;
}

.consent-dialog__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.consent-dialog__title {
	font-size: 24px;
	color: var(--c-ink);
}

.consent-dialog__close {
	margin-right: -10px;
	cursor: pointer;
}

.consent-dialog__intro {
	margin: 0;
	font-size: 14px;
	line-height: 1.6;
	color: var(--c-text-2);
}

.consent-cats {
	list-style: none;
	margin: 0;
	padding: 0;
	border: 1px solid var(--c-line);
	border-radius: 18px;
}

.consent-cat {
	padding: 16px 18px;
}

.consent-cat + .consent-cat {
	border-top: 1px solid var(--c-line-soft);
}

.consent-cat__row {
	display: flex;
	align-items: center;
	gap: 12px;
}

.consent-cat__label {
	flex: 1;
	font-family: var(--f-head);
	font-size: 17px;
	font-weight: 700;
	color: var(--c-ink);
	cursor: pointer;
}

.consent-cat__always {
	font-size: 13px;
	font-weight: 700;
	color: var(--c-mint-ink);
}

.consent-cat__desc {
	margin: 6px 0 0;
	font-size: 14px;
	line-height: 1.55;
	color: var(--c-muted);
}

/* Comutator accesibil (checkbox nativ cu role="switch"). */
.consent-switch {
	appearance: none;
	-webkit-appearance: none;
	position: relative;
	flex: none;
	width: 48px;
	height: 28px;
	margin: 0;
	border-radius: 999px;
	border: 1.5px solid #8A9496;
	background: #D9DEDF;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.consent-switch::after {
	content: "";
	position: absolute;
	top: 2px;
	left: 2px;
	width: 21px;
	height: 21px;
	border-radius: 50%;
	background: var(--c-white);
	box-shadow: 0 1px 3px rgba(1, 28, 37, 0.3);
	transition: transform 0.15s ease;
}

.consent-switch:checked {
	background: var(--c-green);
	border-color: var(--c-green);
}

.consent-switch:checked::after {
	transform: translateX(20px);
}

.consent-switch:disabled {
	cursor: not-allowed;
	opacity: 0.6;
}

.consent-switch:focus-visible {
	outline: 3px solid var(--c-green);
	outline-offset: 3px;
}

.consent-dialog__id {
	margin: 0;
	font-size: 12px;
	color: var(--c-muted);
	word-break: break-all;
}

.consent__actions--dialog {
	width: auto;
}

.consent-dialog__status {
	margin: 0;
	min-height: 1.4em;
	font-size: 14px;
	font-weight: 700;
	color: var(--c-mint-ink);
}

@media (max-width: 960px) {
	.consent__inner {
		flex-direction: column;
		align-items: stretch;
		gap: 16px;
	}

	.consent__actions {
		width: auto;
	}
}

@media (max-width: 760px) {
	.consent {
		bottom: 12px;
		width: calc(100% - 24px);
		border-radius: 20px;
	}

	.consent__inner {
		gap: 14px;
		padding: 18px 16px 16px;
	}

	.consent__title {
		font-size: 18px;
	}

	.consent__text {
		font-size: 13px;
	}

	.consent__actions {
		gap: 8px;
	}

	.consent-btn {
		min-height: 46px;
		padding: 0 4px;
		font-size: 14px;
		white-space: nowrap;
	}

	/* Setările devin un panou de jos, pe toată lățimea. */
	.consent-dialog {
		width: 100%;
		max-width: none;
		max-height: 92%;
		margin: auto 0 0;
		border-radius: 24px 24px 0 0;
	}

	.consent-dialog__form {
		padding: 20px 16px 22px;
	}

	.consent-dialog__title {
		font-size: 22px;
	}

	.consent-cat {
		padding: 14px;
	}

	/* În setări sunt trei butoane cu texte mai lungi: unul sub altul, egale. */
	.consent__actions--dialog {
		grid-template-columns: minmax(0, 1fr);
	}

	.consent__actions--dialog .consent-btn {
		font-size: 16px;
	}
}

/* Ecrane foarte înguste: butoanele unul sub altul, tot la aceeași mărime. */
@media (max-width: 359px) {
	.consent__actions {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (prefers-reduced-motion: reduce) {
	.consent {
		animation: none;
	}
}
