/*
 * CREATING V2 — request dialog (F12.2d). Loaded only on pages with a designated request button.
 * Theme tokens only (--cr-*); the form inside is the page form with its own classes (.cr-form, .cr-form__grid,
 * .cr-form__field, .cr-button, .cr-request-about) from theme.css — nothing of the form is restyled here.
 */

.cr-request {
	background: var(--cr-base);
	border: 1px solid var(--cr-line);
	border-top: 2px solid var(--cr-gold);
	border-radius: 0 var(--cr-notch) 0 0;
	box-sizing: border-box;
	color: var(--cr-text);
	max-height: calc(100dvh - 2rem);
	max-width: min(48rem, calc(100vw - 2rem));
	overflow: auto;
	overscroll-behavior: contain;
	padding: 0;
	width: 100%;
}

.cr-request::backdrop {
	background: rgba(15, 15, 18, 0.82);
}

html.cr-request-open {
	overflow: hidden;
}

.cr-request__head {
	align-items: start;
	border-bottom: 1px solid var(--cr-line);
	display: grid;
	gap: 0.25rem 1rem;
	grid-template-columns: minmax(0, 1fr) auto;
	padding: 1.25rem clamp(1rem, 4vw, 2rem) 1rem;
}

.cr-request__title {
	font-family: var(--cr-font-display);
	font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
	font-weight: 400;
	line-height: 1.15;
	margin: 0;
	overflow-wrap: anywhere;
}

.cr-request__title:focus {
	outline: none;
}

.cr-request__title:focus-visible {
	outline: var(--cr-focus);
	outline-offset: 4px;
}

.cr-request__lead {
	color: var(--cr-muted);
	grid-column: 1 / -1;
	margin: 0;
}

.cr-request__close {
	align-items: center;
	background: transparent;
	border: 1px solid var(--cr-line);
	color: var(--cr-text);
	cursor: pointer;
	display: inline-flex;
	font: inherit;
	gap: 0.4rem;
	min-height: 44px;
	padding: 0.4rem 0.75rem;
}

.cr-request__close:hover {
	border-color: var(--cr-gold);
}

.cr-request__close:focus-visible {
	outline: var(--cr-focus);
	outline-offset: 2px;
}

.cr-request__close:disabled {
	cursor: default;
	opacity: 0.6;
}

.cr-request__body {
	padding: 1.25rem clamp(1rem, 4vw, 2rem) 1.5rem;
}

.cr-request .cr-form {
	max-width: none;
}

.cr-request .cr-button[aria-busy="true"] {
	opacity: 0.7;
}

.cr-request__loading {
	color: var(--cr-muted);
	margin: 0;
	min-height: 12rem;
}

/* Narrow screens and large text (the breakpoint is in em, so it also applies at 200 % text):
   a full-screen sheet; everything scrolls inside the dialog. */
@media (max-width: 37.49875em) {
	.cr-request {
		border-radius: 0;
		height: 100dvh;
		margin: 0;
		max-height: 100dvh;
		max-width: 100vw;
	}
}

@media (prefers-reduced-motion: no-preference) {
	.cr-request[open] {
		animation: cr-request-in var(--cr-dur, 320ms) var(--cr-ease, ease-out);
	}

	@keyframes cr-request-in {
		from {
			opacity: 0;
			transform: translateY(12px);
		}
	}
}
