/*
 * The /start/ page: the meeting-request form (its markup comes from the ayh-site plugin; the look is here).
 * Page shell, hero and sections live in inner.css.
 */

:root {
	/* Form errors: the palette has no red; this one keeps 4.5:1 on ivory and white. */
	--ayh-error: #9b2c2c;
}

.ayh-start-existing .ayh-split__body p {
	max-inline-size: 36rem;
	color: var(--wp--preset--color--stone);
}

/* ---------------------------------------------------------------- Form (markup from the ayh-site plugin) */

.ayh-intake {
	max-inline-size: 44rem;
}

.ayh-intake__form {
	display: grid;
	gap: 1.5rem 1.25rem;
}

@media (min-width: 48rem) {
	.ayh-intake__form {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.ayh-intake__form .ayh-field--group,
	.ayh-intake__form [data-field="site"],
	.ayh-intake__form [data-field="message"],
	.ayh-intake__alert,
	.ayh-intake__actions {
		grid-column: 1 / -1;
	}
}

.ayh-field {
	min-inline-size: 0;
}

.ayh-field label,
.ayh-field legend {
	display: block;
	margin-block-end: 0.4rem;
	padding: 0;
	font-weight: 700;
}

.ayh-field__opt {
	font-weight: 400;
	color: var(--wp--preset--color--stone);
}

.ayh-field fieldset {
	margin: 0;
	padding: 0;
	border: 0;
	min-inline-size: 0;
}

/* Controls: white, soft corners, a border that holds 3:1 against the ivory page */
.ayh-field input:not([type="checkbox"]),
.ayh-field textarea {
	box-sizing: border-box;
	inline-size: 100%;
	min-block-size: 3rem;
	padding: 0.6rem 1rem;
	font: inherit;
	font-size: 1rem;
	color: var(--wp--preset--color--ink);
	background: var(--wp--preset--color--white);
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--stone) 60%, var(--wp--preset--color--ivory));
	border-radius: 0.75rem;
}

.ayh-field input[dir="ltr"] {
	text-align: start;
}

.ayh-field textarea {
	min-block-size: 8rem;
	resize: vertical;
}

.ayh-field input:not([type="checkbox"]):focus-visible,
.ayh-field textarea:focus-visible {
	outline: 2px solid var(--wp--preset--color--ink);
	outline-offset: 2px;
	border-color: var(--wp--preset--color--ink);
}

.ayh-field__hint,
.ayh-field__error {
	margin: 0.35rem 0 0;
	font-size: var(--wp--preset--font-size--small);
}

.ayh-field__hint {
	color: var(--wp--preset--color--stone);
}

.ayh-field__error {
	font-weight: 700;
	color: var(--ayh-error);
}

.ayh-field__error:empty {
	display: none;
}

.ayh-field.has-error input:not([type="checkbox"]),
.ayh-field.has-error textarea {
	border-color: var(--ayh-error);
	border-width: 2px;
}

/* Checkbox choices: tiles that fill with ink when chosen */
.ayh-checks {
	display: grid;
	gap: 0.6rem;
	grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}

.ayh-field .ayh-check {
	display: flex;
	align-items: center;
	gap: 0.7rem;
	min-block-size: 2.75rem;
	margin: 0 !important;
	padding: 0.5rem 1rem;
	font-weight: 400 !important;
	background: var(--wp--preset--color--white);
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--stone) 60%, var(--wp--preset--color--ivory));
	border-radius: 0.75rem;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.ayh-check input {
	flex: none;
	inline-size: 1.15rem;
	block-size: 1.15rem;
	margin: 0;
	accent-color: var(--wp--preset--color--brass);
}

.ayh-field .ayh-check:has(input:checked) {
	background: var(--wp--preset--color--ink);
	border-color: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--ivory);
}

.ayh-field .ayh-check:has(input:focus-visible) {
	outline: 2px solid var(--wp--preset--color--ink);
	outline-offset: 2px;
}

.ayh-field--group.has-error .ayh-check {
	border-color: var(--ayh-error);
}

/* Live regions: empty ones take no room */
.ayh-intake__alert:empty,
.ayh-intake__status:empty {
	display: none;
}

.ayh-intake__alert {
	padding: 0.9rem 1.1rem;
	font-weight: 700;
	color: var(--ayh-error);
	background: color-mix(in srgb, var(--ayh-error) 8%, var(--wp--preset--color--white));
	border: 1px solid var(--ayh-error);
	border-radius: 0.75rem;
}

.ayh-intake__status {
	padding: 1.75rem 2rem;
	font-size: var(--wp--preset--font-size--large);
	color: var(--wp--preset--color--ivory);
	background: var(--wp--preset--color--ink);
	border-inline-start: 4px solid var(--wp--preset--color--brass-light);
	border-radius: 0.75rem;
}

.ayh-intake__status:focus-visible {
	outline: 2px solid var(--wp--preset--color--ink);
	outline-offset: 3px;
}

.ayh-intake__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1rem 1.5rem;
}

.ayh-intake__actions .ayh-btn-slant {
	--ayh-cta-bg: var(--wp--preset--color--ink);
	--ayh-cta-fg: var(--wp--preset--color--ivory);
	--ayh-cta-bg-hover: var(--wp--preset--color--brass-dark);
}

.ayh-intake__actions .ayh-btn-slant button {
	border: 0;
	min-block-size: 3.5rem;
	padding-inline: 2.5rem;
	font-family: inherit;
	cursor: pointer;
}

.ayh-intake__actions .ayh-btn-slant button:focus-visible {
	outline: 2px solid var(--wp--preset--color--ink);
	outline-offset: 4px;
	border-radius: 0.65rem;
}

.ayh-intake__actions .ayh-btn-slant button:disabled {
	opacity: 0.7;
	cursor: progress;
}

.ayh-intake__privacy {
	margin: 0;
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--stone);
}

@media (prefers-reduced-motion: reduce) {
	.ayh-field .ayh-check {
		transition: none;
	}
}

/* display:grid above would win over the hidden attribute the script sets after a successful send */
.ayh-intake__form[hidden] {
	display: none;
}

/* Breathing room between the confirmation and the form that stays under it */
.ayh-intake__status:not(:empty) {
	margin-block-end: 2.5rem;
}

/* Five choices fill two full rows: three on the first, two (wider) on the second */
@media (min-width: 40rem) {
	.ayh-checks {
		grid-template-columns: repeat(6, minmax(0, 1fr));
	}

	.ayh-checks > .ayh-check {
		grid-column: span 2;
	}

	.ayh-checks > .ayh-check:nth-child(n + 4) {
		grid-column: span 3;
	}
}
