/* Contact form. Reuses theme tokens (--ry-*) when present. */

.ry-contact {
	--ry-c-bg: var(--ry-surface, #fff);
	--ry-c-text: var(--ry-text, #14213D);
	--ry-c-muted: var(--ry-muted, #56627A);
	--ry-c-accent: var(--ry-accent, #1D6B5F);
	--ry-c-accent-hover: var(--ry-accent-hover, #155248);
	--ry-c-on-accent: var(--ry-on-accent, #fff);
	--ry-c-accent-soft: var(--ry-accent-soft, #E1EFEC);
	--ry-c-danger: var(--ry-danger, #9B2C3F);
	--ry-c-danger-soft: var(--ry-danger-soft, #F9ECEF);
	--ry-c-border: var(--ry-border-strong, #C3CEDA);
	--ry-c-radius: var(--ry-r-sm, 8px);
	--ry-c-space: var(--ry-s4, 16px);
	--ry-c-space-lg: var(--ry-s5, 24px);
	max-width: 40rem;
	margin: 0 0 var(--ry-s5, 24px);
}

.ry-contact__form {
	display: grid;
	gap: var(--ry-c-space-lg);
}

.ry-contact .field input[type="email"],
.ry-contact .field input[type="text"],
.ry-contact .field select,
.ry-contact .field textarea {
	width: 100%;
	min-height: 50px;
	padding: var(--ry-s2, 8px) var(--ry-s3, 12px);
	border: 1.5px solid var(--ry-c-border);
	border-radius: var(--ry-c-radius);
	background-color: var(--ry-c-bg);
	color: var(--ry-c-text);
	font: inherit;
	font-size: 1.0625rem;
}

.ry-contact .field select {
	-webkit-appearance: none;
	appearance: none;
	padding-right: 44px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2356627A' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	background-size: 16px 16px;
}

.ry-contact .field textarea {
	min-height: 160px;
	resize: vertical;
	line-height: 1.5;
}

.ry-contact .field input:hover,
.ry-contact .field select:hover,
.ry-contact .field textarea:hover {
	border-color: var(--ry-c-muted);
}

.ry-contact .field input:focus,
.ry-contact .field select:focus,
.ry-contact .field textarea:focus {
	outline: none;
	border-color: var(--ry-c-accent);
	box-shadow: 0 0 0 3px var(--ry-c-accent-soft);
}

.ry-contact .field input[aria-invalid="true"],
.ry-contact .field select[aria-invalid="true"],
.ry-contact .field textarea[aria-invalid="true"] {
	border-color: var(--ry-c-danger);
	box-shadow: 0 0 0 3px var(--ry-c-danger-soft);
}

.ry-contact .field .check {
	display: flex;
	gap: var(--ry-s2, 8px);
	align-items: flex-start;
	font-weight: 400;
	cursor: pointer;
}

.ry-contact .field .check input {
	width: 20px;
	height: 20px;
	margin-top: 3px;
	accent-color: var(--ry-c-accent);
	flex: none;
	min-height: 0;
	box-shadow: none;
}

.ry-contact .ry-contact__error:empty {
	display: none;
}

.ry-contact .ry-contact__error {
	color: var(--ry-c-danger);
	font-weight: 600;
}

.ry-contact__status:empty {
	display: none;
}

.ry-contact__status {
	margin: 0 0 var(--ry-c-space);
	padding: var(--ry-s3, 12px) var(--ry-s4, 16px);
	border-radius: var(--ry-c-radius);
}

.ry-contact__ok {
	background: var(--ry-c-accent-soft);
	color: var(--ry-c-text);
	border-left: 3px solid var(--ry-c-accent);
	font-weight: 600;
}

.ry-contact .ry-errors,
.ry-contact__status.ry-errors {
	background: var(--ry-c-danger-soft);
	color: var(--ry-c-danger);
	font-weight: 700;
	margin: 0 0 var(--ry-c-space);
}

.ry-contact__hp {
	position: absolute;
	left: -10000px;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.ry-contact .form-actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--ry-s3, 12px);
	align-items: center;
}

/* Fallback submit button if the theme .btn class is not present. */
.ry-contact .btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 0 var(--ry-s5, 24px);
	border-radius: 999px;
	border: 1px solid transparent;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
	text-align: center;
	background: var(--ry-c-accent);
	color: var(--ry-c-on-accent);
}

.ry-contact .btn:hover {
	background: var(--ry-c-accent-hover);
	color: var(--ry-c-on-accent);
	text-decoration: none;
}

.ry-contact .btn:focus-visible {
	outline: 3px solid var(--ry-marigold, #F0A202);
	outline-offset: 2px;
}

.ry-contact .btn:disabled {
	opacity: 0.7;
	cursor: wait;
}

.ry-contact__again {
	margin: 0 0 var(--ry-c-space);
}

@media (max-width: 600px) {
	.ry-contact .form-actions .btn {
		width: 100%;
	}
}
