/* Carlo Tours — Fluent Forms skin.
   Fluent Forms ships its own blue-and-grey look; this dresses it in the
   site's tokens instead. Scoped to the plugin's own classes rather than a
   carlo- prefix, deliberately: any form the owner later drops on any page
   should already look like the rest of the site. Every value is a token. */

/* --- 1. Box-sizing. The shared reset only reaches [class*="carlo-"], and
       none of the plugin's elements carry our prefix. --- */
.frm-fluent-form,
.frm-fluent-form *,
.frm-fluent-form *::before,
.frm-fluent-form *::after {
	box-sizing: border-box;
}

/* --- 2. The page that holds the form --- */
.carlo-formpage {
	padding-block: var(--wp--custom--section-y);
	padding-inline: var(--wp--custom--gutter);
}

.carlo-formpage > * {
	max-width: var(--wp--custom--max-measure);
	margin-inline: auto;
}

/* --- 3. Field groups --- */
.frm-fluent-form .ff-el-group {
	margin-block-end: 1.75rem;
}

.frm-fluent-form .ff-el-group:last-of-type {
	margin-block-end: 0;
}

/* --- 4. Labels --- */
.frm-fluent-form .ff-el-input--label label {
	display: inline-block;
	margin-block-end: 0.5rem;
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--sm);
	font-weight: 600;
	line-height: var(--wp--custom--line-snug);
	color: var(--wp--preset--color--contrast);
}

.frm-fluent-form .ff-el-input--label.ff-el-is-required label::after,
.frm-fluent-form .ff-el-input--label.asterisk-right label::after {
	margin-inline-start: 0.25rem;
	color: var(--wp--preset--color--accent);
}

/* The help line sits under its input (the plugin offers only tooltip or
   under-field, and a tooltip hides the text on touch screens). */
.frm-fluent-form .ff-el-help-message {
	margin-block: 0.4rem 0;
	font-size: var(--wp--preset--font-size--xs);
	line-height: var(--wp--custom--line-body);
	color: var(--wp--preset--color--muted);
}

/* --- 5. Inputs --- */
.frm-fluent-form .ff-el-form-control {
	width: 100%;
	padding: 0.875rem 1rem;
	border: var(--wp--custom--rule) solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius);
	background-color: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--base);
	line-height: var(--wp--custom--line-body);
	transition:
		border-color 0.3s var(--wp--custom--ease),
		background-color 0.3s var(--wp--custom--ease);
}

.frm-fluent-form .ff-el-form-control::placeholder {
	color: var(--wp--preset--color--muted);
	opacity: 1;
}

.frm-fluent-form .ff-el-form-control:hover {
	border-color: var(--wp--preset--color--muted);
}

.frm-fluent-form .ff-el-form-control:focus {
	border-color: var(--wp--preset--color--accent);
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}

.frm-fluent-form textarea.ff-el-form-control {
	min-height: 9rem;
	resize: vertical;
}

/* A select needs its own arrow once the browser default is overridden. */
.frm-fluent-form select.ff-el-form-control {
	appearance: none;
	padding-inline-end: 2.75rem;
	background-image: url( "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23595f58' d='M8 11.2 2.8 6l1.1-1.1L8 9l4.1-4.1L13.2 6z'/%3E%3C/svg%3E" );
	background-repeat: no-repeat;
	background-position: right 1rem center;
	background-size: 1rem;
}

/* --- 6. Name row. Fluent Forms lays sub-fields out in its own grid, which
       carries no gap of its own. --- */
.frm-fluent-form .ff-t-container {
	display: flex;
	flex-wrap: wrap;
	gap: 0 1.25rem;
}

.frm-fluent-form .ff-t-cell {
	flex: 1 1 12rem;
	min-width: 0;
}

/* --- 7. Checkboxes. The clickable area is the whole row, not the 16px box. --- */
.frm-fluent-form .ff-el-form-check {
	margin-block-end: 0.625rem;
}

.frm-fluent-form .ff-el-form-check-label {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	font-size: var(--wp--preset--font-size--base);
	line-height: var(--wp--custom--line-body);
	color: var(--wp--preset--color--contrast);
	cursor: pointer;
}

.frm-fluent-form .ff-el-form-check-input {
	flex: none;
	width: 1.125rem;
	height: 1.125rem;
	margin: 0.2rem 0 0;
	accent-color: var(--wp--preset--color--accent);
	cursor: pointer;
}

/* --- 8. Submit button. Matches .carlo-cta rather than inventing a shape. --- */
.frm-fluent-form .ff-btn-submit,
.frm-fluent-form .ff_submit_btn_wrapper .ff-btn-submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.625rem;
	padding: 1rem 1.75rem;
	border: var(--wp--custom--rule) solid var(--wp--preset--color--accent);
	border-radius: var(--wp--custom--radius);
	background-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--base);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--sm);
	font-weight: 500;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition:
		background-color 0.3s var(--wp--custom--ease),
		border-color 0.3s var(--wp--custom--ease);
}

.frm-fluent-form .ff-btn-submit:hover,
.frm-fluent-form .ff-btn-submit:focus {
	background-color: var(--wp--preset--color--contrast);
	border-color: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}

.frm-fluent-form .ff-btn-submit:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

/* --- 9. Errors --- */
.frm-fluent-form .ff-el-is-error .ff-el-form-control {
	border-color: #b3261e;
}

.frm-fluent-form .error-text,
.frm-fluent-form .text-danger {
	margin-block-start: 0.4rem;
	font-size: var(--wp--preset--font-size--xs);
	line-height: var(--wp--custom--line-body);
	color: #b3261e;
}

/* --- 10. The thank-you message, which replaces the form in place --- */
.ff-message-success {
	padding: 2rem;
	border: var(--wp--custom--rule) solid var(--wp--preset--color--line);
	border-left: 3px solid var(--wp--preset--color--accent);
	border-radius: var(--wp--custom--radius);
	background-color: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--contrast);
	font-size: var(--wp--preset--font-size--base);
	line-height: var(--wp--custom--line-body);
}

.ff-message-success p {
	margin-block: 0 0.75rem;
}

.ff-message-success p:last-child {
	margin-block-end: 0;
}
