/*
 * Realist Site Tools — the demo form and the consent banner.
 * Colours come from the theme's palette, with plain fallbacks so both still
 * work under any theme.
 */

.gr-demo,
.gr-consent {
	--grt-ink: var(--wp--preset--color--contrast, #14111c);
	--grt-accent: var(--wp--preset--color--primary, #5500cc);
	--grt-accent-dark: var(--wp--preset--color--secondary, #3d0094);
	--grt-muted: var(--wp--preset--color--muted, #5c5869);
	--grt-line: var(--wp--preset--color--line, #e6e3ee);
	--grt-base: var(--wp--preset--color--base, #fff);
	--grt-neutral: var(--wp--preset--color--neutral, #f6f5f9);
	--grt-danger: #b42318;
}

/* Demo form
---------------------------------------- */

.gr-demo-form {
	margin: 0;
}

.gr-demo-hp {
	height: 1px;
	left: -9999px;
	overflow: hidden;
	position: absolute;
	width: 1px;
}

.gr-demo-grid {
	display: grid;
	gap: 18px 16px;
	grid-template-columns: repeat(6, minmax(0, 1fr));
}

.gr-demo-field {
	grid-column: span 6;
	margin: 0;
	min-width: 0;
}

.gr-demo-field.is-half {
	grid-column: span 3;
}

.gr-demo-field.is-third {
	grid-column: span 2;
}

@media (max-width: 640px) {
	.gr-demo-field.is-half,
	.gr-demo-field.is-third {
		grid-column: span 6;
	}
}

.gr-demo-field label {
	color: var(--grt-ink);
	display: block;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	margin-bottom: 7px;
}

.gr-demo-field .gr-req {
	color: var(--grt-accent);
}

.gr-demo-field .gr-opt {
	color: var(--grt-muted);
	font-weight: 400;
}

.gr-demo-field :is(input, select, textarea) {
	appearance: none;
	-webkit-appearance: none;
	background-color: var(--grt-base);
	border: 1px solid color-mix(in srgb, var(--grt-ink) 16%, transparent);
	border-radius: 10px;
	box-shadow: 0 1px 2px rgba(20, 17, 28, 0.04);
	color: var(--grt-ink);
	font: inherit;
	font-size: 16px;
	font-weight: 400;
	line-height: 1.4;
	padding: 12px 14px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	width: 100%;
}

.gr-demo-field select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 8l4 4 4-4' fill='none' stroke='%235c5869' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-position: right 12px center;
	background-repeat: no-repeat;
	background-size: 18px;
	padding-right: 38px;
}

.gr-demo-field textarea {
	min-height: 110px;
	resize: vertical;
}

.gr-demo-field ::placeholder {
	color: var(--grt-muted);
	font-size: 15px;
	opacity: 0.75;
}

.gr-demo-field :is(input, select, textarea):hover {
	border-color: color-mix(in srgb, var(--grt-ink) 28%, transparent);
}

.gr-demo-field :is(input, select, textarea):focus {
	background-color: var(--grt-base);
	border-color: var(--grt-accent);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--grt-accent) 14%, transparent);
	outline: none;
}

.gr-demo-field.is-invalid :is(input, select, textarea) {
	border-color: var(--grt-danger);
}

.gr-demo-hint {
	color: var(--grt-muted);
	font-size: 13px;
	line-height: 1.4;
	margin: 6px 0 0;
}

/* The errors carry the wrapper's class: the theme's card greys every
   paragraph inside it (.is-style-gr-card p), which outranked a lone class
   and turned every error the colour of the help text. */
.gr-demo .gr-demo-error {
	color: var(--grt-danger);
	font-size: 13px;
	font-weight: 500;
	line-height: 1.4;
	margin: 6px 0 0;
}

.gr-demo .gr-demo-error:empty {
	display: none;
}

.gr-demo .gr-demo-errors,
.gr-demo .gr-demo-status {
	background: #fef3f2;
	border: 1px solid #fecdca;
	border-radius: 10px;
	color: var(--grt-danger);
	font-size: 15px;
	line-height: 1.45;
	padding: 12px 16px;
}

.gr-demo .gr-demo-errors {
	margin-bottom: 18px;
}

.gr-demo .gr-demo-errors p,
.gr-demo .gr-demo-errors ul {
	color: inherit;
	font-size: inherit;
	line-height: inherit;
	margin: 0;
}

/* Turnstile runs in interaction-only mode, so for almost everyone it shows
   nothing; its box is taken out of the flow (it cannot be display: none, the
   invisible check runs inside it) until Cloudflare asks for a click. */
.gr-demo-turnstile {
	margin-top: 20px;
}

.gr-demo-turnstile:not(.is-visible) {
	clip-path: inset(50%);
	height: 1px;
	margin: 0;
	overflow: hidden;
	position: absolute;
	width: 1px;
}

.gr-demo-footer {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 14px 20px;
	margin-top: 24px;
}

.gr-demo-submit.wp-element-button {
	border: 0;
	cursor: pointer;
	font-size: 16px;
	padding: 14px 26px;
}

.gr-demo-submit[disabled] {
	cursor: progress;
	opacity: 0.7;
}

.gr-demo-privacy {
	color: var(--grt-muted);
	flex: 1 1 240px;
	font-size: 13px;
	line-height: 1.45;
	margin: 0;
}

.gr-demo-privacy a {
	color: inherit;
}

.gr-demo .gr-demo-status {
	margin: 20px 0 0;
	scroll-margin: 24px;
}

.gr-demo .gr-demo-status:empty {
	display: none;
}

.gr-demo-done {
	outline: none;
	padding: 8px 0;
}

.gr-demo-done__icon {
	background: color-mix(in srgb, var(--grt-accent) 10%, var(--grt-base));
	border-radius: 50%;
	height: 52px;
	margin: 0 0 18px;
	position: relative;
	width: 52px;
}

.gr-demo-done__icon::after {
	border-bottom: 3px solid var(--grt-accent);
	border-right: 3px solid var(--grt-accent);
	content: "";
	height: 20px;
	left: 19px;
	position: absolute;
	top: 12px;
	transform: rotate(45deg);
	width: 11px;
}

.gr-demo-done__title {
	font-size: 26px;
	margin: 0 0 10px;
}

.gr-demo-done p {
	color: var(--grt-muted);
}

/* Consent banner
---------------------------------------- */

.gr-consent {
	background: var(--grt-base);
	border: 1px solid var(--grt-line);
	border-radius: 16px;
	bottom: 16px;
	box-shadow: 0 2px 4px rgba(20, 17, 28, 0.06), 0 24px 60px -16px rgba(20, 17, 28, 0.35);
	color: var(--grt-ink);
	font-size: 14px;
	left: 16px;
	line-height: 1.5;
	max-width: 380px;
	opacity: 0;
	padding: 18px 18px 16px;
	position: fixed;
	transform: translateY(12px);
	transition: opacity 0.3s ease, transform 0.3s ease;
	z-index: 1000;
}

.gr-consent.is-open {
	opacity: 1;
	transform: none;
}

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

@media (max-width: 480px) {
	.gr-consent {
		bottom: 10px;
		left: 10px;
		max-width: none;
		right: 10px;
	}
}

.gr-consent__title {
	font-weight: 600;
	margin: 0 0 4px;
}

.gr-consent__text {
	color: var(--grt-muted);
	margin: 0;
}

.gr-consent__text a {
	color: var(--grt-ink);
}

.gr-consent__actions {
	display: grid;
	gap: 8px;
	grid-template-columns: 1fr 1fr;
	margin-top: 14px;
}

/* Identical on purpose: refusing must be exactly as easy as accepting. */
.gr-consent__button {
	background: var(--grt-ink);
	border: 1px solid var(--grt-ink);
	border-radius: 999px;
	color: var(--grt-base);
	cursor: pointer;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	padding: 10px 14px;
	transition: background-color 0.15s ease;
}

.gr-consent__button:hover,
.gr-consent__button:focus-visible {
	background: var(--grt-accent);
	border-color: var(--grt-accent);
}

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

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