/**
 * DRB Marketing — modal shell (v1).
 *
 * Styles the chrome only: backdrop, dialog frame, close button, page
 * visibility. Everything inside .drbm-modal-body is the unit's own HTML and
 * brings its own <style>. No theme tokens are assumed — this must look
 * correct under any theme, so it uses neutral values.
 */

/* Root: hidden by default (no flash before JS); .is-open shows it. */
.drbm-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 16px;
	box-sizing: border-box;
}
.drbm-modal.is-open {
	display: flex;
}
/* Keep this after .is-open: same specificity, later wins. */
.drbm-modal[hidden] {
	display: none;
}

.drbm-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(16, 20, 17, 0.72);
}

.drbm-modal-dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 560px;
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	background: #fff;
	color: #1c1c1c;
	border-radius: 12px;
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
	overflow: hidden;
	outline: none;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	line-height: 1.5;
	box-sizing: border-box;
}

.drbm-modal-body {
	flex: 1 1 auto;
	min-height: 0;
	overflow: auto;
	-webkit-overflow-scrolling: touch;
}

/* Close (×): sits above the scrolling body so it stays put. */
.drbm-modal-close {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	color: #1c1c1c;
	cursor: pointer;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
	line-height: 1;
}
.drbm-modal-close:hover {
	background: #fff;
}
.drbm-modal-close:focus-visible {
	outline: 3px solid #1c5c4f;
	outline-offset: 2px;
}
.drbm-modal-close svg {
	display: block;
	width: 16px;
	height: 16px;
}

/* Pages: the runtime toggles the hidden attribute; !important so unit CSS
   (e.g. display:flex on a page) cannot defeat it. */
.drbm-modal [data-drbm-panel][hidden] {
	display: none !important;
}
.drbm-modal [data-drbm-panel]:focus {
	outline: none;
}

/* Small screens: bottom sheet, with a 44px close target (easy to dismiss —
   also what Google's interstitial guidance asks for). */
@media (max-width: 600px) {
	.drbm-modal {
		padding: 0;
		align-items: flex-end;
	}
	.drbm-modal-dialog {
		max-width: 100%;
		max-height: calc(100vh - 40px);
		max-height: calc(100dvh - 40px);
		border-radius: 16px 16px 0 0;
	}
	.drbm-modal-close {
		width: 44px;
		height: 44px;
		top: 6px;
		right: 6px;
	}
}

/* Motion: short fade/scale, off for users who ask for less motion. */
@media (prefers-reduced-motion: no-preference) {
	.drbm-modal.is-open .drbm-modal-dialog {
		animation: drbm-modal-in 180ms ease-out;
	}
	.drbm-modal.is-open .drbm-modal-backdrop {
		animation: drbm-fade-in 180ms ease-out;
	}
}
@keyframes drbm-modal-in {
	from {
		opacity: 0;
		transform: translateY(8px) scale(0.98);
	}
	to {
		opacity: 1;
		transform: none;
	}
}
@keyframes drbm-fade-in {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}
