/**
 * OTR privacy choices modal — parity with optimataxrelief.com.
 */

body.otr-privacy-modal-open {
	overflow: hidden;
}

.otr-privacy-modal[hidden],
.otr-privacy-modal [hidden] {
	display: none !important;
}

.otr-privacy-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	padding: 0.75rem;
	font-family: var(--otr-font);
}

.otr-privacy-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(28, 58, 107, 0.4);
	-webkit-backdrop-filter: blur(2px);
	backdrop-filter: blur(2px);
}

.otr-privacy-modal__panel {
	position: relative;
	display: flex;
	width: 100%;
	max-width: 42rem;
	max-height: min(82dvh, calc(100dvh - 1.5rem));
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--otr-border);
	border-radius: 1rem;
	outline: none;
	background: #fff;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
	color: var(--otr-text);
	text-align: left;
}

.otr-privacy-modal__header {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1.5rem 1.5rem 1rem;
	border-bottom: 1px solid var(--otr-border);
}

.otr-privacy-modal__header h2 {
	margin: 0;
	padding-right: 0.5rem;
	color: var(--otr-navy);
	font-family: var(--otr-font);
	font-size: 1.125rem;
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: -0.025em;
}

.otr-privacy-modal__close {
	display: flex;
	width: 2.25rem;
	height: 2.25rem;
	flex: 0 0 2.25rem;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	border-radius: 9999px;
	background: transparent;
	color: var(--otr-text-muted);
	cursor: pointer;
	transition: color 0.15s ease, background-color 0.15s ease;
}

.otr-privacy-modal__close:hover {
	background: var(--otr-bg-soft);
	color: var(--otr-navy);
}

.otr-privacy-modal__close:focus-visible,
.otr-privacy-toggle:focus-visible,
.otr-privacy-modal__submit:focus-visible,
.otr-privacy-modal__body a:focus-visible {
	outline: 2px solid var(--otr-blue);
	outline-offset: 2px;
}

.otr-privacy-modal__body {
	min-height: 0;
	flex: 1;
	overflow-y: auto;
	padding: 1.25rem 1.5rem;
	color: var(--otr-text-muted);
	font-size: 0.875rem;
	line-height: 1.625;
}

.otr-privacy-modal__body p {
	margin: 0 0 1rem;
	padding: 0;
}

.otr-privacy-modal__body p:last-child {
	margin-bottom: 0;
}

.otr-privacy-modal__body a {
	border-radius: 0.125rem;
	color: var(--otr-blue);
	text-decoration: none;
}

.otr-privacy-modal__toggle-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin: 0 0 1rem;
	padding: 0.5rem 0;
	border-top: 1px solid var(--otr-border);
	border-bottom: 1px solid var(--otr-border);
}

.otr-privacy-modal__toggle-row > span {
	color: var(--otr-navy);
	font-size: 1rem;
	font-weight: 500;
	line-height: 1.5;
}

.otr-privacy-toggle {
	position: relative;
	display: inline-flex;
	width: 3rem;
	height: 1.75rem;
	flex: 0 0 3rem;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 9999px;
	background: #d1d5db;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.otr-privacy-toggle > span {
	display: inline-block;
	width: 1.5rem;
	height: 1.5rem;
	border-radius: 9999px;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
	transform: translateX(0);
	transition: transform 0.15s ease;
}

.otr-privacy-toggle[aria-checked="true"] {
	background: var(--otr-blue);
}

.otr-privacy-toggle[aria-checked="true"] > span {
	transform: translateX(1.25rem);
}

.otr-privacy-modal__error {
	margin-top: 1rem !important;
	color: #b91c1c;
	font-weight: 500;
}

.otr-privacy-modal__footer {
	flex-shrink: 0;
	padding: 1rem 1.5rem max(1rem, env(safe-area-inset-bottom));
	border-top: 1px solid var(--otr-border);
	background: #fff;
}

.otr-privacy-modal__submit {
	display: inline-flex;
	width: 100%;
	align-items: center;
	justify-content: center;
	padding: 0.75rem 2rem;
	border: 0;
	border-radius: 0.5rem;
	background: var(--otr-blue);
	color: #fff;
	font-family: var(--otr-font);
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.5;
	cursor: pointer;
	transition: background-color 0.15s ease, opacity 0.15s ease;
}

.otr-privacy-modal__submit:hover {
	background: var(--otr-blue-deep);
}

.otr-privacy-modal__submit:disabled {
	cursor: not-allowed;
	opacity: 0.6;
}

.otr-footer__privacy-trigger {
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.otr-footer__privacy-trigger:hover,
.otr-footer__privacy-trigger:focus-visible {
	color: #fff;
}

@media (min-width: 640px) {
	.otr-privacy-modal {
		padding: 1rem;
	}

	.otr-privacy-modal__panel {
		max-height: min(85dvh, calc(100dvh - 2rem));
	}

	.otr-privacy-modal__submit {
		width: auto;
	}
}
