/* --- The form ----------------------------------------------------------
   Formidable renders this markup, not us. The rules below restyle its
   generated output rather than replacing it, so form 1 keeps its field IDs,
   validation, actions and 762 historical entries.

   Formidable's own stylesheet is deliberately left enabled. It carries
   functional rules we must not lose, above all the one that hides the
   honeypot field (.frm_verify). If that stylesheet were dropped, the honeypot
   would become visible, real people would fill it in, and their submissions
   would be silently rejected as spam. We override appearance only, and hide
   the honeypot again below as a second line of defence. */

.sd-form-card {
	background: var(--sd-surface-raised);
	border: 1px solid var(--sd-border-card);
	border-radius: 16px;
	padding: 40px 40px 36px;
}
.sd-form-card__title { font-size: 21px; margin-bottom: 6px; }
.sd-form-card__note { font-size: var(--sd-text-small); color: var(--sd-text-secondary); margin-bottom: 28px; }

/* Reset the plugin's own frame */
.sd-form .frm_forms,
.sd-form .frm_form_fields,
.sd-form fieldset,
.sd-form .frm_fields_container { margin: 0; padding: 0; border: 0; background: none; max-width: none; }
.sd-form .frm_form_title, .sd-form .frm_description { display: none; }

/* Field rows. Formidable emits .frm_half / .frm_full width classes. */
.sd-form .frm_form_field { margin: 0 0 22px; padding: 0; }
.sd-form .frm_form_field:last-child { margin-bottom: 0; }

.sd-form .frm_primary_label {
	display: block;
	margin-bottom: 9px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	color: var(--sd-text-primary);
}
.sd-form .frm_required { color: var(--sd-coral-text); font-weight: 700; margin-left: 2px; }

.sd-form input[type="text"],
.sd-form input[type="email"],
.sd-form input[type="tel"],
.sd-form input[type="url"],
.sd-form input[type="number"],
.sd-form select,
.sd-form textarea {
	width: 100%;
	padding: 13px 15px;
	font-family: inherit;
	font-size: 15px;
	line-height: 1.5;
	color: var(--sd-text-primary);
	background: var(--sd-bg);
	border: 1px solid #CFD1C4;
	border-radius: 10px;
	box-shadow: none;
	transition: border-color var(--sd-dur) var(--sd-ease), box-shadow var(--sd-dur) var(--sd-ease);
	-webkit-appearance: none;
	appearance: none;
}
.sd-form textarea { min-height: 132px; resize: vertical; }
.sd-form input::placeholder, .sd-form textarea::placeholder { color: #8A8F85; }

.sd-form input[type="text"]:hover,
.sd-form input[type="email"]:hover,
.sd-form textarea:hover { border-color: #B6B9AB; }

.sd-form input[type="text"]:focus,
.sd-form input[type="email"]:focus,
.sd-form input[type="tel"]:focus,
.sd-form select:focus,
.sd-form textarea:focus {
	outline: none;
	border-color: var(--sd-coral);
	box-shadow: 0 0 0 3px rgba(233, 104, 79, 0.22);
}

/* Checkbox group */
.sd-form .frm_opt_container { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 22px; }
.sd-form .frm_checkbox { margin: 0; }
.sd-form .frm_checkbox label,
.sd-form .frm_radio label {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0;
	font-size: 14.5px;
	line-height: 1.45;
	font-weight: 450;
	color: var(--sd-text-primary);
	cursor: pointer;
}
.sd-form .frm_checkbox input[type="checkbox"],
.sd-form .frm_radio input[type="radio"] {
	flex: none;
	width: 19px; height: 19px;
	margin: 1px 0 0;
	accent-color: var(--sd-coral);
	cursor: pointer;
}
.sd-form .frm_checkbox input[type="checkbox"]:focus-visible,
.sd-form .frm_radio input[type="radio"]:focus-visible {
	outline: 2px solid var(--sd-coral);
	outline-offset: 2px;
}

/* Turnstile sits on its own row with no visible label */
.sd-form .frm_none_container .frm_primary_label { display: none; }
.sd-form .frm-cf-turnstile { margin-top: 2px; }

/* Submit. The submit row is not :last-child (Formidable appends the honeypot
   and its state inputs after it), so the trailing margin has to be removed
   explicitly rather than with a last-child rule. */
.sd-form .frm_submit { margin: 26px 0 0; }
.sd-form .frm_form_field:has(.frm_submit) { margin-bottom: 0; }
.sd-form #frm_field_11_container { margin-bottom: 0; }
.sd-form .frm_button_submit,
.sd-form button[type="submit"] {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 15px 30px;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	color: var(--sd-on-coral);
	background: var(--sd-coral);
	border: 1px solid var(--sd-coral);
	border-radius: 999px;
	cursor: pointer;
	transition: background var(--sd-dur) var(--sd-ease), transform var(--sd-dur) var(--sd-ease);
	-webkit-appearance: none;
	appearance: none;
}
.sd-form .frm_button_submit:hover,
.sd-form button[type="submit"]:hover { background: var(--sd-coral-hover); transform: translateY(-2px); }
.sd-form .frm_button_submit:focus-visible,
.sd-form button[type="submit"]:focus-visible { outline: 3px solid var(--sd-text-primary); outline-offset: 3px; }
.sd-form .frm_button_submit[disabled], .sd-form .frm_button_submit.frm_loading_button { opacity: 0.62; cursor: progress; transform: none; }

/* Validation */
.sd-form .frm_blank_field input[type="text"],
.sd-form .frm_blank_field input[type="email"],
.sd-form .frm_blank_field textarea,
.sd-form .frm_blank_field select { border-color: #B8402B; background: #FDF3F0; }
.sd-form .frm_error {
	display: block;
	margin-top: 7px;
	font-size: 13.5px;
	line-height: 1.5;
	font-weight: 500;
	color: #9E3622;
}
.sd-form .frm_error_style,
.sd-form .frm_message {
	padding: 17px 19px;
	margin-bottom: 22px;
	border-radius: 11px;
	font-size: 14.5px;
	line-height: 1.6;
}
.sd-form .frm_error_style { background: #FBEDE9; border: 1px solid #E3B3A6; color: #8E3020; }
.sd-form .frm_message   { background: var(--sd-sage); border: 1px solid #C4CFAE; color: var(--sd-sage-deep); }
.sd-form .frm_message p:last-child { margin-bottom: 0; }

/* Honeypot: Formidable's stylesheet hides this. Repeat it here so a future
   change to the plugin's CSS cannot expose it and start rejecting real people. */
.sd-form .frm_verify,
.sd-form #frm_field_12_container { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }

.sd-form .frm_screen_reader {
	position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Shown in place of a live form on an archive page. */
.sd-archived-form {
	padding: 26px 28px;
	background: var(--sd-bg-alt);
	border: 1px dashed var(--sd-border);
	border-radius: 12px;
}
.sd-archived-form__title {
	margin-bottom: 7px;
	font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
	font-weight: 700; color: var(--sd-text-secondary);
}
.sd-archived-form__body { font-size: var(--sd-text-small); line-height: 1.6; color: var(--sd-text-secondary); margin: 0; }

.sd-form__privacy { margin-top: 18px; font-size: 13px; line-height: 1.6; color: var(--sd-text-secondary); }
.sd-form__privacy a {
	color: var(--sd-text-primary);
	text-decoration: underline;
	text-underline-offset: .16em;
}

@media (max-width: 600px) {
	.sd-form-card { padding: 28px 22px 26px; border-radius: 14px; }
	.sd-form .frm_opt_container { grid-template-columns: 1fr; }
	.sd-form .frm_button_submit, .sd-form button[type="submit"] { width: 100%; }
}

/* --- Winning against Formidable's own stylesheet -----------------------
   formidableforms.css is enqueued after site.css and ships selectors like
   .frm_style_formidable-style.with_frm_style .frm_error (0,3,0) and
   .frm_style_formidable-style.with_frm_style .form-field input:not([type="file"]):focus
   (0,5,1). A plain .sd-form .x rule (0,2,0) loses to those on specificity, and
   a same-specificity rule loses on source order.

   Everything below therefore hangs off .sd-form.sd-form .with_frm_style, which adds a
   class to the chain and takes these rules clear of the plugin's. Only the
   properties the plugin actually contests are repeated here, so this stays a
   short override list rather than a second copy of the component. */

.sd-form.sd-form .with_frm_style .frm_error { color: #9E3622; font-size: 13.5px; font-weight: 500; }
.sd-form.sd-form .with_frm_style .frm_error_style {
	background-color: #FBEDE9; border: 1px solid #E3B3A6; color: #8E3020;
	border-radius: 11px; padding: 17px 19px;
}
.sd-form.sd-form .with_frm_style .frm_message {
	background-color: var(--sd-sage); border: 1px solid #C4CFAE; color: var(--sd-sage-deep);
	border-radius: 11px; padding: 17px 19px;
}

.sd-form.sd-form .with_frm_style input[type="text"],
.sd-form.sd-form .with_frm_style input[type="email"],
.sd-form.sd-form .with_frm_style input[type="tel"],
.sd-form.sd-form .with_frm_style textarea {
	color: var(--sd-text-primary);
	background-color: var(--sd-bg);
	border: 1px solid #CFD1C4;
	border-radius: 10px;
}
.sd-form.sd-form .with_frm_style .form-field input:not([type="file"]):focus,
.sd-form.sd-form .with_frm_style input[type="text"]:focus,
.sd-form.sd-form .with_frm_style input[type="email"]:focus,
.sd-form.sd-form .with_frm_style input[type="tel"]:focus,
.sd-form.sd-form .with_frm_style textarea:focus {
	background-color: var(--sd-bg);
	border-color: var(--sd-coral);
	box-shadow: 0 0 0 3px rgba(233, 104, 79, 0.22);
	outline: none;
}
.sd-form.sd-form .with_frm_style .frm_blank_field input[type="text"],
.sd-form.sd-form .with_frm_style .frm_blank_field input[type="email"],
.sd-form.sd-form .with_frm_style .frm_blank_field input[type="tel"],
.sd-form.sd-form .with_frm_style .frm_blank_field textarea {
	color: var(--sd-text-primary);
	background-color: #FDF3F0;
	border-color: #B8402B;
}
.sd-form.sd-form .with_frm_style .frm_primary_label { font-size: 14px; font-weight: 600; color: var(--sd-text-primary); }
.sd-form.sd-form .with_frm_style .frm_required { color: var(--sd-coral-text); }
.sd-form.sd-form .with_frm_style .frm_button_submit {
	color: var(--sd-on-coral);
	background-color: var(--sd-coral);
	border: 1px solid var(--sd-coral);
	border-radius: 999px;
	padding: 15px 30px;
	font-size: 15px;
	font-weight: 600;
}
.sd-form.sd-form .with_frm_style .frm_button_submit:hover { background-color: var(--sd-coral-hover); }
.sd-form.sd-form .with_frm_style .frm_button_submit:focus-visible { outline: 3px solid var(--sd-text-primary); outline-offset: 3px; }

/* The focus and error states are the one place where raising specificity a
   step at a time does not work. Formidable ships them as

     .frm_style_formidable-style.with_frm_style .form-field
       input:not([type=file]):not([type=range]):not([readonly]):focus

   which is 0,7,1 with hard-coded #66afe9 and #ffffff, so there is no custom
   property to redirect and no shorter selector that beats it. The rules below
   mirror the plugin's own selectors and add .sd-form in front, which lands at
   0,8,1: a deliberate, documented win rather than an !important. If the plugin
   changes these selectors, these overrides stop applying and the fields go
   Formidable-blue on focus, which is visible immediately rather than silent. */

.sd-form .frm_style_formidable-style.with_frm_style .form-field input:not([type=file]):not([type=range]):not([readonly]):focus,
.sd-form .frm_style_formidable-style.with_frm_style select:focus,
.sd-form .frm_style_formidable-style.with_frm_style .form-field textarea:focus {
	background-color: var(--sd-bg);
	border-color: var(--sd-coral);
	color: var(--sd-text-primary);
	box-shadow: 0 0 0 3px rgba(233, 104, 79, 0.22);
}
.sd-form .frm_style_formidable-style.with_frm_style .frm_blank_field input[type=text],
.sd-form .frm_style_formidable-style.with_frm_style .frm_blank_field input[type=email],
.sd-form .frm_style_formidable-style.with_frm_style .frm_blank_field input[type=tel],
.sd-form .frm_style_formidable-style.with_frm_style .frm_blank_field textarea,
.sd-form .frm_style_formidable-style.with_frm_style .frm_form_field :invalid {
	color: var(--sd-text-primary);
	background-color: #FDF3F0;
	border-color: #B8402B;
	border-width: 1px;
	border-style: solid;
}
.sd-form .frm_style_formidable-style.with_frm_style .frm_blank_field input:focus,
.sd-form .frm_style_formidable-style.with_frm_style .frm_blank_field textarea:focus {
	border-color: #B8402B;
	box-shadow: 0 0 0 3px rgba(184, 64, 43, 0.20);
}

/* The service checkboxes carry Formidable's .frm_two_col, whose own rule
   (.frm_form_field.frm_two_col .frm_opt_container) sets a hard two-column
   grid at every width. Ours has to out-specify it rather than sit in a plain
   media query, or the choices stay two-up on a phone. */
.sd-form .frm_form_field.frm_two_col .frm_opt_container {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	grid-gap: 10px 22px;
}
@media (max-width: 600px) {
	.sd-form .frm_form_field.frm_two_col .frm_opt_container { grid-template-columns: 1fr; }
	.sd-form .frm_style_formidable-style.with_frm_style .frm_submit button,
	.sd-form.sd-form .with_frm_style .frm_button_submit { width: 100%; }
}
