/* =========================================================================
   Eco Africa Digital — Contact Form 7 styling for the multi-step
   "Start the Conversation" enquiry form.  v1.1.0

   Re-creates the look of the site's hand-built .ead-form, but targets CF7's
   actual output (wpcf7-checkbox / wpcf7-text / wpcf7-submit …) so it works on
   a real CF7 form. Brand tokens fall back to literals, so this is correct even
   if the EAD Site Styling plugin is not active.
   ========================================================================= */

/* ---------- Wrapper (was .ead-form) ------------------------------------- */
.ead-cf7{
	background:#ffffff;
	padding:48px;
	font-family:var(--ead-sans,'Manrope',Helvetica,Arial,sans-serif);
	color:var(--ead-ink,#053f31);
}
.ead-cf7 *{box-sizing:border-box;}

/* CF7 wraps controls in .wpcf7-form-control-wrap — make it a plain block */
.ead-cf7 .wpcf7-form-control-wrap{display:block;width:100%;}

/* ---------- Progress bar (01 … 04) -------------------------------------- */
.ead-cf7 .ead-prog{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin:28px 0 44px;}
.ead-cf7 .ead-prog .p i{display:block;height:3px;background:rgba(5,63,49,.15);}
.ead-cf7 .ead-prog .p.is-on i{background:var(--ead-green,#15aa69);}
.ead-cf7 .ead-prog .p span{display:block;margin-top:9px;font-size:10.5px;font-weight:500;letter-spacing:.12em;line-height:15px;text-transform:uppercase;color:rgba(5,63,49,.5);white-space:pre;}
.ead-cf7 .ead-prog .p.is-on span{color:var(--ead-ink,#053f31);}

/* ---------- Steps (one visible at a time) ------------------------------- */
.ead-cf7 .ead-step{display:none;}
.ead-cf7 .ead-step.is-on{display:block;animation:eadCf7Fade .35s ease;}
@keyframes eadCf7Fade{from{opacity:0;transform:translateY(6px);}to{opacity:1;transform:none;}}

/* ---------- Questions --------------------------------------------------- */
.ead-cf7 .ead-q{font-family:var(--ead-serif,'Noto Serif Display',Georgia,serif);font-weight:300;margin:40px 0 17px;font-size:19px;line-height:1.22;color:var(--ead-ink,#053f31);}
.ead-cf7 .ead-q.big{max-width:600px;}
.ead-cf7 .ead-step .ead-q:first-child{margin-top:0;}

/* ---------- Chips (CF7 checkbox / radio rendered as EAD chips) -----------
   CF7 nests the control four spans deep:
     .wpcf7-form-control-wrap > .wpcf7-checkbox > .wpcf7-list-item
       > (input + .wpcf7-list-item-label)
   and CF7 adds NO <label> wrapper by default, so the native input can't be
   clicked once it's hidden. On top of that, the site-styling plugin's generic
   ".ead-chips span { border; padding }" + "span::before { square }" rules land
   on EVERY one of those spans, producing nested boxes and multiple tick marks.

   So we (1) strip border/padding/background and the ::before marker off the
   three wrapper spans, keeping the chip only on .wpcf7-list-item-label, and
   (2) stretch the real input over the whole chip as a transparent, clickable
   overlay — which restores clicking without needing a <label> in the markup.
   Everything is scoped under .ead-cf7 and more specific than the leaking
   ".ead-chips span" rules, so no re-paste of the form is needed. --------- */

/* row of chips */
.ead-cf7 .ead-chips .wpcf7-checkbox,
.ead-cf7 .ead-chips .wpcf7-radio{display:flex !important;flex-wrap:wrap;gap:10px;border:0 !important;padding:0 !important;background:none !important;}

/* neutralise the stray boxes/markers on the wrapper spans */
.ead-cf7 .ead-chips .wpcf7-form-control-wrap,
.ead-cf7 .ead-chips .wpcf7-checkbox,
.ead-cf7 .ead-chips .wpcf7-list-item{border:0 !important;padding:0 !important;background:none !important;}
.ead-cf7 .ead-chips .wpcf7-form-control-wrap::before,
.ead-cf7 .ead-chips .wpcf7-checkbox::before,
.ead-cf7 .ead-chips .wpcf7-list-item::before{content:none !important;display:none !important;}

/* each option is a positioned chip so the input can fill it */
.ead-cf7 .ead-chips .wpcf7-list-item{position:relative !important;display:inline-flex !important;margin:0 !important;}
.ead-cf7 .ead-chips .wpcf7-list-item > label{display:inline-flex;margin:0;padding:0;border:0;}

/* the native checkbox/radio becomes a transparent overlay over the whole chip */
.ead-cf7 .ead-chips .wpcf7-list-item input[type="checkbox"],
.ead-cf7 .ead-chips .wpcf7-list-item input[type="radio"]{
	position:absolute !important;top:0;left:0;width:100% !important;height:100% !important;
	margin:0 !important;opacity:0 !important;cursor:pointer !important;pointer-events:auto !important;z-index:2;
	-webkit-appearance:none;appearance:none;
}

/* the visible chip */
.ead-cf7 .ead-chips .wpcf7-list-item-label{
	display:inline-flex;align-items:center;gap:11px;
	border:1px solid rgba(5,63,49,.22);padding:10px 15px;background:#ffffff;
	font-size:13px;line-height:18px;color:var(--ead-ink,#053f31);
	transition:border-color .15s,background-color .15s;
}
.ead-cf7 .ead-chips .wpcf7-list-item-label::before{
	content:"" !important;display:inline-block !important;flex:0 0 auto;width:12px;height:12px;
	border:1px solid rgba(5,63,49,.45);background:#ffffff;
}
/* hover */
.ead-cf7 .ead-chips .wpcf7-list-item input:hover + .wpcf7-list-item-label{border-color:rgba(5,63,49,.45);}
/* checked: input sits right before the label span in CF7's markup.
   !important so the green state always beats the base chip + the site-styling
   plugin's own .ead-chips rules, whatever the load order. */
.ead-cf7 .ead-chips input:checked + .wpcf7-list-item-label{
	border-color:var(--ead-green,#15aa69) !important;background:rgba(21,170,105,.08) !important;
}
.ead-cf7 .ead-chips input:checked + .wpcf7-list-item-label::before{
	background:var(--ead-green,#15aa69) !important;border-color:var(--ead-green,#15aa69) !important;
	box-shadow:#ffffff 0 0 0 2px inset !important;
}
/* keyboard focus */
.ead-cf7 .ead-chips input:focus-visible + .wpcf7-list-item-label{outline:2px solid var(--ead-green,#15aa69);outline-offset:2px;}

/* ---------- Text / email / tel / url / textarea fields ------------------ */
.ead-cf7 .ead-field{display:block;margin:0 0 24px;}
.ead-cf7 .ead-field > span{display:block;margin-bottom:7px;font-size:11px;font-weight:500;letter-spacing:.12em;line-height:15px;text-transform:uppercase;color:rgba(5,63,49,.7);}
.ead-cf7 .ead-field input,
.ead-cf7 .ead-field textarea{
	width:100%;border:1px solid rgba(5,63,49,.25);background:#ffffff;
	padding:14px 16px;font-family:var(--ead-sans,'Manrope',Arial,sans-serif);
	font-size:15px;color:var(--ead-ink,#053f31);
	transition:border-color .2s,box-shadow .2s;-webkit-appearance:none;appearance:none;
}
.ead-cf7 .ead-field input{height:52px;}
.ead-cf7 .ead-field textarea{height:120px;resize:vertical;}
.ead-cf7 .ead-field input::placeholder,
.ead-cf7 .ead-field textarea::placeholder{color:rgba(5,63,49,.4);}
.ead-cf7 .ead-field input:focus,
.ead-cf7 .ead-field textarea:focus{outline:none;border-color:var(--ead-green,#15aa69);box-shadow:0 0 0 3px rgba(21,170,105,.12);}

/* Two-up grid (step 4 contact details) */
.ead-cf7 .ead-fgrid{display:grid;grid-template-columns:1fr 1fr;gap:0 20px;}
.ead-cf7 .ead-fgrid .ead-field{margin-bottom:20px;}

/* ---------- Nav (Back / Continue / Submit) ------------------------------ */
.ead-cf7 .ead-fnav{display:flex;align-items:center;justify-content:space-between;margin-top:48px;gap:16px;}
.ead-cf7 .ead-fnav.is-first{display:block;}
.ead-cf7 .ead-fnav button,
.ead-cf7 .ead-fnav input.wpcf7-submit{font-family:var(--ead-sans,'Manrope',Arial,sans-serif);cursor:pointer;}

/* Primary (Continue + Submit) */
.ead-cf7 .ead-fnav .ead-next,
.ead-cf7 .ead-fnav input.ead-submit{
	height:55px;width:400px;max-width:100%;
	background:var(--ead-ink,#053f31);color:#ffffff;border:0;border-radius:0;
	font-size:14px;font-weight:500;letter-spacing:.03em;white-space:pre;
	-webkit-appearance:none;appearance:none;transition:background-color .2s;
}
.ead-cf7 .ead-fnav.is-first .ead-next{width:100%;}
.ead-cf7 .ead-fnav .ead-next:hover,
.ead-cf7 .ead-fnav input.ead-submit:hover{background:var(--ead-green,#15aa69);}

/* Back (text link style) */
.ead-cf7 .ead-fnav .ead-back{
	background:none;border:0;border-bottom:1px solid var(--ead-ink,#053f31);
	padding:0 0 3px;font-size:15px;font-weight:500;color:var(--ead-ink,#053f31);
}
.ead-cf7 .ead-fnav .ead-back:hover{opacity:.7;}

/* CF7 adds a spinner after the submit input — keep it on the same line */
.ead-cf7 .wpcf7-spinner{margin:0 0 0 12px;vertical-align:middle;}

/* ---------- CF7 validation + response ----------------------------------- */
.ead-cf7 .wpcf7-not-valid{border-color:#c0392b !important;box-shadow:0 0 0 3px rgba(192,57,43,.1) !important;}
.ead-cf7 .wpcf7-not-valid-tip{display:block;margin-top:6px;font-size:12px;font-weight:600;color:#c0392b;}
.ead-cf7 .wpcf7-response-output{
	margin:22px 0 0 !important;padding:13px 18px !important;
	font-size:14px;line-height:1.5;border-width:1px;border-style:solid;border-radius:2px;
}
.ead-cf7 form.sent .wpcf7-response-output,
.ead-cf7 .wpcf7-mail-sent-ok{border-color:var(--ead-green,#15aa69) !important;background:rgba(21,170,105,.06);color:var(--ead-ink,#053f31);}
.ead-cf7 .wpcf7-validation-errors,
.ead-cf7 .wpcf7-mail-sent-ng{border-color:#c0392b !important;background:rgba(192,57,43,.05);color:#7a2016;}

/* ---------- Mobile ------------------------------------------------------ */
@media (max-width:980px){
	.ead-cf7{padding:32px 22px;}
	.ead-cf7 .ead-prog .p span{font-size:9px;white-space:normal;}
	.ead-cf7 .ead-fgrid{grid-template-columns:1fr;}
	.ead-cf7 .ead-fnav .ead-next,
	.ead-cf7 .ead-fnav input.ead-submit{width:60%;}
	.ead-cf7 .ead-fnav.is-first .ead-next{width:100%;}
}
@media (max-width:600px){
	.ead-cf7 .ead-fnav{flex-direction:column-reverse;align-items:stretch;}
	.ead-cf7 .ead-fnav .ead-next,
	.ead-cf7 .ead-fnav input.ead-submit{width:100%;}
	.ead-cf7 .ead-fnav .ead-back{align-self:center;}
}

@media (prefers-reduced-motion:reduce){
	.ead-cf7 .ead-step.is-on{animation:none;}
}
