/* SAM form page: a centred card with the form, styled to match the rest of SAM.
   Covers Fluent Forms and Contact Form 7, plus plain inputs. */

.sam-formpage { width: 100%; max-width: 1100px; margin: 0 auto; padding: 40px 24px 64px; }
.sam-formpage-back { margin: 0 0 12px; font-size: 14px; }
.sam-formpage-back a { color: var(--sam-accent, #0B6E6E); font-weight: 500; text-decoration: none; }
.sam-formpage-back a:hover { text-decoration: underline; }
.sam-formpage-title { margin: 0 0 20px; }
.sam-formpage-foot { margin: 24px 0 0; text-align: center; font-size: 13px; color: var(--sam-muted, #5A6474); }
@media (max-width: 600px) { .sam-formpage { padding: 24px 16px 48px; } }

.sam-formcard {
	background: var(--sam-surface, #FFFFFF); border: 1px solid var(--sam-line, #E3E6EB); border-radius: var(--sam-radius-lg, 16px);
	padding: 32px; color: var(--sam-ink, #0F1B2D); font-size: 15px; line-height: 1.5;
}
@media (max-width: 600px) { .sam-formcard { padding: 20px 16px; border-radius: var(--sam-radius, 14px); } }
.sam-formcard > p:first-child { margin-top: 0; }
.sam-formcard > p { color: #3E4858; }
.sam-formcard h2, .sam-formcard h3 { color: var(--sam-ink, #0F1B2D); letter-spacing: -0.2px; }

/* ---------- Plain inputs and both form plugins ---------- */
.sam-formcard input[type=text], .sam-formcard input[type=email], .sam-formcard input[type=tel], .sam-formcard input[type=number],
.sam-formcard input[type=date], .sam-formcard input[type=time], .sam-formcard input[type=url], .sam-formcard input[type=password],
.sam-formcard select, .sam-formcard textarea,
.sam-formcard .ff-el-form-control, .sam-formcard .wpcf7-form-control:not(.wpcf7-submit):not(.wpcf7-checkbox):not(.wpcf7-radio):not(.wpcf7-acceptance) {
	width: 100%; min-height: 48px; padding: 10px 14px; margin: 0;
	border: 1px solid #C9CFD8; border-radius: 10px; background: #FFFFFF; box-shadow: none;
	font: inherit; font-size: 16px; line-height: 1.4; color: var(--sam-ink, #0F1B2D);
	-webkit-appearance: none; appearance: none;
}
.sam-formcard select, .sam-formcard select.ff-el-form-control {
	padding-right: 40px; cursor: pointer;
	background: #FFFFFF url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235A6474' stroke-width='1.8'/%3E%3C/svg%3E") no-repeat right 14px center;
}
.sam-formcard textarea, .sam-formcard textarea.ff-el-form-control { min-height: 120px; resize: vertical; }
.sam-formcard input:focus, .sam-formcard select:focus, .sam-formcard textarea:focus, .sam-formcard .ff-el-form-control:focus {
	outline: none; border-color: var(--sam-accent, #0B6E6E); box-shadow: 0 0 0 3px var(--sam-accent-ring, rgba(11, 110, 110, 0.2));
}
.sam-formcard ::placeholder { color: #8C98AA; opacity: 1; }

/* Labels */
.sam-formcard label, .sam-formcard .ff-el-input--label label {
	display: inline-block; margin: 0 0 6px; font-size: 14px; font-weight: 600; color: var(--sam-ink, #0F1B2D); line-height: 1.4;
}
.sam-formcard .ff-el-input--label { margin-bottom: 0; padding: 0; }
.sam-formcard .ff-el-is-required.asterisk-right label::after, .sam-formcard .ff-el-is-required.asterisk-left label::before { color: #B42318; }
.sam-formcard .ff-el-help-message, .sam-formcard .ff-el-help-message p { margin-top: 6px; font-size: 13px; color: var(--sam-muted, #5A6474); font-style: normal; }

/* Spacing between fields */
.sam-formcard .ff-el-group { margin-bottom: 20px; }
.sam-formcard .wpcf7-form > p, .sam-formcard .wpcf7 form p { margin: 0 0 20px; }
.sam-formcard .ff-t-container { gap: 16px; }
.sam-formcard .ff-t-cell { padding-left: 0 !important; padding-right: 0 !important; }
@media (max-width: 640px) { .sam-formcard .ff-t-container { display: block; } .sam-formcard .ff-t-cell { margin-bottom: 20px; } }

/* Section headings inside the form */
.sam-formcard .ff-el-section-break { margin: 28px 0 16px; }
.sam-formcard .ff-el-section-title { margin: 0 0 4px; font-size: 18px; font-weight: 600; }
.sam-formcard .ff-el-section-break hr { border: 0; border-top: 1px solid var(--sam-line, #E3E6EB); margin: 10px 0 0; }

/* Ticks and choices */
.sam-formcard .ff-el-form-check, .sam-formcard .wpcf7-list-item { display: block; margin: 0 0 10px; }
.sam-formcard .ff-el-form-check-label, .sam-formcard .wpcf7-list-item label { display: flex; align-items: flex-start; gap: 10px; margin: 0; font-weight: 400; font-size: 15px; cursor: pointer; }
.sam-formcard input[type=checkbox], .sam-formcard input[type=radio] {
	flex: 0 0 auto; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--sam-accent, #0B6E6E); cursor: pointer;
}
.sam-formcard .wpcf7-list-item { margin-left: 0; }

/* Buttons */
.sam-formcard .ff-btn-submit, .sam-formcard button.ff-btn, .sam-formcard .wpcf7-submit, .sam-formcard input[type=submit], .sam-formcard button[type=submit] {
	display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 28px;
	border: 0; border-radius: 10px; background: var(--sam-accent, #0B6E6E) !important; color: #FFFFFF !important;
	font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; box-shadow: none; text-shadow: none;
}
.sam-formcard .ff-btn-submit:hover, .sam-formcard .wpcf7-submit:hover, .sam-formcard input[type=submit]:hover, .sam-formcard button[type=submit]:hover {
	background: var(--sam-accent-dark, #085454) !important; opacity: 1;
}
.sam-formcard .ff-btn-submit:focus-visible, .sam-formcard .wpcf7-submit:focus-visible { outline: 2px solid var(--sam-accent, #0B6E6E); outline-offset: 3px; }
.sam-formcard .ff_submit_btn_wrapper { margin-top: 8px; }
@media (max-width: 600px) { .sam-formcard .ff-btn-submit, .sam-formcard .wpcf7-submit { width: 100%; } }
.sam-formcard .ff_upload_btn, .sam-formcard .ff-btn-secondary {
	background: #FFFFFF !important; color: var(--sam-ink, #0F1B2D) !important; border: 1px solid #D5DAE1 !important; border-radius: 10px; font-weight: 600;
}

/* Signature pads and uploads */
.sam-formcard canvas { max-width: 100%; border: 1px solid #C9CFD8; border-radius: 10px; background: #FFFFFF; }
.sam-formcard .ff-el-repeat-buttons-list, .sam-formcard .ff-el-progress { margin-top: 8px; }

/* Errors and messages */
.sam-formcard .ff-el-is-error .ff-el-form-control, .sam-formcard .wpcf7-not-valid { border-color: #B42318 !important; }
.sam-formcard .error.text-danger, .sam-formcard .ff-el-is-error .text-danger, .sam-formcard .wpcf7-not-valid-tip {
	display: block; margin-top: 6px; font-size: 13px; font-weight: 500; color: #B42318;
}
.sam-formcard .ff-message-success, .sam-formcard .wpcf7 form.sent .wpcf7-response-output {
	margin: 0; padding: 16px 18px; border: 0; border-radius: 10px; background: var(--sam-accent-soft, #DDF1EF); color: var(--sam-accent-ink, #0A5C5C); font-weight: 600; box-shadow: none;
}
.sam-formcard .ff-errors-in-stack, .sam-formcard .wpcf7 form.invalid .wpcf7-response-output, .sam-formcard .wpcf7 form.failed .wpcf7-response-output {
	margin: 16px 0 0; padding: 14px 16px; border: 0; border-radius: 10px; background: #FDECEC; color: #8A1C1C; font-weight: 500;
}
.sam-formcard .wpcf7-response-output:empty { display: none; }
.sam-formcard .wpcf7-spinner { margin: 0 12px; }

/* ---------- Multi-step forms (Fluent Forms) ---------- */
/* Progress bar */
.sam-formcard .ff-el-progress-status { margin: 0 0 8px; font-size: 14px; font-weight: 600; color: var(--sam-ink, #0F1B2D); }
.sam-formcard .ff-el-progress { height: 10px; margin: 0 0 24px; border-radius: 999px; background: #EEF0F3; overflow: hidden; }
.sam-formcard .ff-el-progress-bar { height: 100%; border-radius: 999px; background: var(--sam-accent, #0B6E6E) !important; }
.sam-formcard .ff-el-progress-bar span { display: none; }
/* Step titles along the top */
.sam-formcard .ff-step-titles { display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 0 0 24px; padding: 0; list-style: none; counter-reset: samstep; }
.sam-formcard .ff-step-titles li {
	position: relative; display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 6px 12px 6px 6px;
	border-radius: 999px; background: #F5F6F8; color: var(--sam-muted, #5A6474); font-size: 14px; font-weight: 500;
	counter-increment: samstep; border: 0; width: auto; text-align: left;
}
.sam-formcard .ff-step-titles li::before {
	content: counter(samstep); position: static; display: inline-flex; align-items: center; justify-content: center;
	width: 24px; height: 24px; margin: 0; border: 0; border-radius: 50%; background: #FFFFFF; color: var(--sam-muted, #5A6474);
	font-size: 13px; font-weight: 700; box-shadow: inset 0 0 0 1px #C9CFD8;
}
.sam-formcard .ff-step-titles li::after { display: none; }
.sam-formcard .ff-step-titles li.ff_active { background: var(--sam-accent-soft, #DDF1EF); color: var(--sam-accent-ink, #0A5C5C); font-weight: 600; }
.sam-formcard .ff-step-titles li.ff_active::before { background: var(--sam-accent, #0B6E6E); color: #FFFFFF; box-shadow: none; }
.sam-formcard .ff-step-titles li.ff_completed { color: var(--sam-ink, #0F1B2D); }
.sam-formcard .ff-step-titles li.ff_completed::before { content: "✓"; background: var(--sam-accent, #0B6E6E); color: #FFFFFF; box-shadow: none; }
/* Next / Previous */
.sam-formcard .step-nav { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; margin-top: 8px; }
.sam-formcard .step-nav::after { display: none; }
.sam-formcard .ff-btn-next, .sam-formcard .step-nav .ff-btn-next.ff-btn-secondary {
	order: 2; margin-left: auto; float: none !important; min-height: 48px; padding: 0 28px; border: 0 !important; border-radius: 10px;
	background: var(--sam-accent, #0B6E6E) !important; color: #FFFFFF !important; font: inherit; font-size: 16px; font-weight: 600; cursor: pointer;
}
.sam-formcard .ff-btn-next:hover { background: var(--sam-accent-dark, #085454) !important; }
.sam-formcard .ff-btn-prev, .sam-formcard .step-nav .ff-btn-prev.ff-btn-secondary {
	order: 1; float: none !important; min-height: 48px; padding: 0 22px; border-radius: 10px;
	background: #FFFFFF !important; color: var(--sam-ink, #0F1B2D) !important; border: 1px solid #D5DAE1 !important;
	font: inherit; font-size: 16px; font-weight: 600; cursor: pointer;
}
.sam-formcard .ff-btn-prev:hover { background: #F5F6F8 !important; }
.sam-formcard .ff-btn-next:focus-visible, .sam-formcard .ff-btn-prev:focus-visible { outline: 2px solid var(--sam-accent, #0B6E6E); outline-offset: 3px; }
/* On the last step the submit button sits beside Previous */
.sam-formcard .fluentform-step .ff_submit_btn_wrapper, .sam-formcard .ff-step-body .ff_submit_btn_wrapper { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
@media (max-width: 600px) {
	.sam-formcard .ff-step-titles li span, .sam-formcard .ff-step-titles li { font-size: 13px; }
	.sam-formcard .step-nav { flex-direction: column-reverse; align-items: stretch; }
	.sam-formcard .ff-btn-next, .sam-formcard .ff-btn-prev { width: 100%; margin-left: 0; }
}

/* ---------- Contact Form 7 Multi Step (NinjaTeam, free and Pro) ---------- */
/* Each step is a fieldset: no box of its own inside the SAM card. */
.sam-formcard .fieldset-cf7mls-wrapper { margin: 0; }
.sam-formcard .fieldset-cf7mls { margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none; min-width: 0; }
.sam-formcard .fieldset-cf7mls > legend, .sam-formcard .fieldset-cf7mls h3 { margin: 0 0 16px; font-size: 18px; font-weight: 600; color: var(--sam-ink, #0F1B2D); }
/* Next / Back, and Submit on the last step */
.sam-formcard .cf7mls-btns, .sam-formcard .wpcf7-form .fieldset-cf7mls .cf7mls-btns {
	display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 8px 0 0; padding: 0; float: none; width: 100%;
}
.sam-formcard .cf7mls_next, .sam-formcard .cf7mls_next.action-button, .sam-formcard button.cf7mls_btn.cf7mls_next {
	order: 2; margin: 0 0 0 auto !important; float: none !important; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 48px; width: auto; padding: 0 28px; border: 0 !important; border-radius: 10px !important;
	background: var(--sam-accent, #0B6E6E) !important; color: #FFFFFF !important; box-shadow: none !important;
	font: inherit; font-size: 16px; font-weight: 600; line-height: 1; cursor: pointer;
}
.sam-formcard .cf7mls_next:hover { background: var(--sam-accent-dark, #085454) !important; }
.sam-formcard .cf7mls_back, .sam-formcard .cf7mls_back.action-button, .sam-formcard button.cf7mls_btn.cf7mls_back {
	order: 1; margin: 0 !important; float: none !important; display: inline-flex; align-items: center; justify-content: center;
	min-height: 48px; width: auto; padding: 0 22px; border-radius: 10px !important;
	background: #FFFFFF !important; color: var(--sam-ink, #0F1B2D) !important; border: 1px solid #D5DAE1 !important; box-shadow: none !important;
	font: inherit; font-size: 16px; font-weight: 600; line-height: 1; cursor: pointer;
}
.sam-formcard .cf7mls_back:hover { background: #F5F6F8 !important; }
.sam-formcard .cf7mls_next:focus-visible, .sam-formcard .cf7mls_back:focus-visible { outline: 2px solid var(--sam-accent, #0B6E6E); outline-offset: 3px; }
.sam-formcard .cf7mls_next img { width: 16px; height: 16px; }
.sam-formcard form.cf7mls input.wpcf7-form-control.wpcf7-submit, .sam-formcard .cf7mls-btns .wpcf7-submit { order: 2; margin-left: auto; }
.sam-formcard .wpcf7-cf7mls_preview_step { min-height: 48px; padding: 0 22px; border-radius: 10px; background: #FFFFFF !important; color: var(--sam-ink, #0F1B2D) !important; border: 1px solid #D5DAE1 !important; font: inherit; font-weight: 600; }
/* Progress bar: give it room; its colour is set in the plugin (see SAM's notes) */
.sam-formcard .cf7mls_progress_bar, .sam-formcard [class*="cf7mls_progress"] { margin-bottom: 24px; font-family: inherit; }
/* Errors on a step */
.sam-formcard .fieldset-cf7mls-wrapper .wpcf7-not-valid-tip { position: static; margin-top: 6px; font-size: 13px; color: #B42318; }
.sam-formcard .fieldset-cf7mls-wrapper div.wpcf7-validation-errors { margin: 16px 0 0; padding: 14px 16px; border: 0; border-radius: 10px; background: #FDECEC; color: #8A1C1C; }
@media (max-width: 600px) {
	.sam-formcard .cf7mls-btns { flex-direction: column-reverse; align-items: stretch; }
	.sam-formcard .cf7mls_next, .sam-formcard .cf7mls_back, .sam-formcard .cf7mls-btns .wpcf7-submit { width: 100% !important; margin-left: 0 !important; }
}
/* Contact Form 7 puts fields inside their labels: let them use the full width */
.sam-formcard .wpcf7-form p > label, .sam-formcard .wpcf7-form .fieldset-cf7mls > p > label { display: block; width: 100%; }
.sam-formcard .wpcf7-form-control-wrap { display: block; margin-top: 6px; }
.sam-formcard .wpcf7-list-item .wpcf7-list-item-label { font-weight: 400; }

/* CF7 Multi Step Pro, as it actually renders: its own stylesheet forces the button row to
   "display: block !important" and puts the progress bar inside that row, after the buttons.
   Make the row a flex row again, lift the progress bar above the buttons, and recolour it. */
.sam-formcard .cf7mls-btns { display: flex !important; overflow: visible !important; flex-wrap: wrap; align-items: center; gap: 12px; }
.sam-formcard .cf7mls_progress_bar_percent_wrap { order: -1; flex: 1 1 100%; display: flex !important; align-items: center; gap: 12px; width: 100%; margin: 4px 0 12px !important; padding: 0 !important; }
.sam-formcard .cf7mls_progress_percent { flex: 1 1 auto; width: auto !important; margin: 0 !important; padding: 0 !important; }
.sam-formcard .cf7mls_progress_bar_percent { height: 8px !important; margin: 0 !important; border: 0 !important; border-radius: 999px !important; background: #EEF0F3 !important; box-shadow: none !important; overflow: hidden; }
.sam-formcard .cf7mls_progress_barinner { height: 100% !important; border-radius: 999px !important; background: var(--sam-accent, #0B6E6E) !important; transition: width .3s; }
.sam-formcard .cf7mls_progress_bar_percent_wrap > div:last-child { flex: 0 0 auto; }
.sam-formcard .cf7mls_progress_bar_percent_wrap p { margin: 0 !important; min-width: 36px; text-align: right; font-size: 13px !important; font-weight: 600; line-height: 1; color: var(--sam-muted, #5A6474) !important; }
/* Hidden steps are stacked out of sight; stop them stretching the page below the form. */
.sam-formcard .fieldset-cf7mls-wrapper { overflow: hidden; }

/* Site logo and group logo under the form */
.sam-formpage-logos { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 24px 40px; margin: 32px 0 8px; }
.sam-formpage-logos img { display: block; height: 64px; width: auto; max-width: 220px; object-fit: contain; }
@media (max-width: 600px) { .sam-formpage-logos { gap: 16px 28px; } .sam-formpage-logos img { height: 48px; max-width: 160px; } }
/* Site logo at the top, left-aligned above the title */
.sam-formpage-sitelogo { display: block; height: 72px; width: auto; max-width: 260px; object-fit: contain; object-position: left center; margin: 0 0 20px; }
@media (max-width: 600px) { .sam-formpage-sitelogo { height: 56px; max-width: 200px; margin-bottom: 14px; } }
