/* Connected Forms: front end. Colours, fonts and radius come from the plugin settings (CSS variables). */
.cnf{
	--cnf-tint: rgba(27,77,46,.08);
	--cnf-tint: color-mix(in srgb, var(--cnf-primary) 9%, var(--cnf-field));
	--cnf-ring: rgba(27,77,46,.18);
	--cnf-ring: color-mix(in srgb, var(--cnf-primary) 20%, transparent);
	--cnf-line: var(--cnf-border);
	font-family: var(--cnf-font-b);
	font-size: var(--cnf-fs);
	line-height: 1.5;
	color: var(--cnf-text);
	text-align: left;
	-webkit-font-smoothing: antialiased;
}
.cnf *, .cnf *::before, .cnf *::after, .cnf-modal, .cnf-modal *, .cnf-modal *::before, .cnf-modal *::after{ box-sizing: border-box; }
.cnf [hidden]{ display: none !important; }
.cnf--inline, .cnf--preview{
	background: var(--cnf-bg);
	border: 1px solid var(--cnf-line);
	border-radius: calc(var(--cnf-radius) + 8px);
	padding: clamp(20px, 3.6vw, 36px);
}

/* Head */
.cnf__head{ margin: 0 0 24px; }
.cnf__eyebrow{ font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--cnf-primary); margin: 0 0 10px; }
.cnf__title{ font-family: var(--cnf-font-h); font-size: clamp(24px, 3.2vw, 32px); font-weight: 800; letter-spacing: -.025em; line-height: 1.1; margin: 0; color: var(--cnf-text); text-wrap: balance; }
.cnf--popup .cnf__title{ padding-right: 36px; }
.cnf__intro{ margin: 10px 0 0; color: var(--cnf-muted); font-size: .95em; max-width: 56ch; }

/* Grid */
.cnf__form{ margin: 0; }
.cnf__grid{ display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; }
.cnf__w-full{ grid-column: 1 / -1; }
@media (max-width: 560px){ .cnf__grid{ grid-template-columns: 1fr; } }
.cnf__field{ display: flex; flex-direction: column; gap: 7px; min-width: 0; margin: 0; padding: 0; border: 0; }
.cnf__field.is-off, .cnf__section.is-off{ display: none; }
.cnf__label{ display: block; font-size: 13.5px; font-weight: 600; color: var(--cnf-text); padding: 0; margin: 0; line-height: 1.35; float: none; width: auto; }
.cnf__req{ color: var(--cnf-primary); }
.cnf__hint{ font-weight: 400; color: var(--cnf-muted); font-size: 12.5px; margin-left: 4px; }
.cnf__help{ font-size: 13px; color: var(--cnf-muted); margin-top: -3px; }
.cnf__section{ grid-column: 1 / -1; font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--cnf-primary); padding-top: 10px; }
.cnf__section:first-child{ padding-top: 0; }

/* Inputs */
.cnf input[type=text], .cnf input[type=email], .cnf input[type=tel], .cnf input[type=number], .cnf input[type=url],
.cnf input[type=date], .cnf input[type=month], .cnf select, .cnf textarea{
	width: 100%; min-height: 50px; margin: 0;
	padding: 12px 15px;
	font: inherit; font-size: max(16px, 1em); line-height: 1.4; color: var(--cnf-text);
	background: var(--cnf-field);
	border: 1px solid var(--cnf-line);
	border-radius: var(--cnf-radius);
	box-shadow: none; outline: none;
	transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
	-webkit-appearance: none; appearance: none;
}
.cnf textarea{ min-height: 112px; resize: vertical; }
.cnf input:hover, .cnf select:hover, .cnf textarea:hover{ border-color: var(--cnf-muted); }
.cnf input:focus, .cnf select:focus, .cnf textarea:focus{ border-color: var(--cnf-primary); box-shadow: 0 0 0 4px var(--cnf-ring); }
.cnf ::placeholder{ color: var(--cnf-muted); opacity: .7; }
.cnf__select{ position: relative; }
.cnf__select::after{ content: ""; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; margin-top: -6px; border-right: 2px solid var(--cnf-muted); border-bottom: 2px solid var(--cnf-muted); transform: rotate(45deg); pointer-events: none; }
.cnf select{ padding-right: 42px; cursor: pointer; }
.cnf .is-autofilled input, .cnf .is-autofilled select, .cnf .is-autofilled textarea{ background: var(--cnf-tint); }

/* Choice chips (single and multiple choice) */
.cnf__choices{ display: flex; flex-wrap: wrap; gap: 8px; }
.cnf__choice{ position: relative; display: inline-flex; margin: 0; cursor: pointer; }
.cnf__choice input{ position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.cnf__choice span{
	display: inline-flex; align-items: center; gap: 8px;
	padding: 10px 16px; min-height: 44px;
	font-size: 14.5px; line-height: 1.3; color: var(--cnf-text);
	background: var(--cnf-field); border: 1px solid var(--cnf-line); border-radius: 999px;
	transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.cnf__choice:hover span{ border-color: var(--cnf-muted); }
.cnf__choice input:checked + span{ border-color: var(--cnf-primary); background: var(--cnf-tint); box-shadow: inset 0 0 0 1px var(--cnf-primary); }
.cnf__choice input:focus-visible + span{ box-shadow: 0 0 0 4px var(--cnf-ring); border-color: var(--cnf-primary); }
.cnf__choice input:disabled + span{ opacity: .5; }

/* Tick boxes */
.cnf__check{ display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-size: 14px; line-height: 1.5; color: var(--cnf-muted); margin: 0; }
.cnf__check input{
	flex: 0 0 auto; width: 20px; height: 20px; margin: 1px 0 0; padding: 0;
	border: 1.5px solid var(--cnf-muted); border-radius: 6px; background: var(--cnf-field);
	-webkit-appearance: none; appearance: none; cursor: pointer;
	transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.cnf__check input:checked{
	background: var(--cnf-primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 14px no-repeat;
	border-color: var(--cnf-primary);
}
.cnf__check input:focus-visible{ box-shadow: 0 0 0 4px var(--cnf-ring); outline: none; }
.cnf__field--checkbox .cnf__check{ color: var(--cnf-text); font-size: 15px; }
.cnf__field--consent{ margin-top: 4px; }

/* Errors and messages */
.cnf__error{ font-size: 13px; color: var(--cnf-error); line-height: 1.4; }
.cnf .is-invalid input:not([type=checkbox]):not([type=radio]), .cnf .is-invalid select, .cnf .is-invalid textarea{ border-color: var(--cnf-error); }
.cnf .is-invalid .cnf__choice span, .cnf .is-invalid .cnf__check input{ border-color: var(--cnf-error); }
.cnf__msg{ margin: 18px 0 0; font-size: 14px; color: var(--cnf-error); }
.cnf__foot{ margin: 16px 0 0; font-size: 12.5px; color: var(--cnf-muted); }
.cnf__hp{ position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Welcome back note */
.cnf__known{ display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0 0 18px; padding: 11px 14px; font-size: 13.5px; color: var(--cnf-text); background: var(--cnf-tint); border-radius: var(--cnf-radius); }
.cnf__link{ padding: 0; margin: 0; border: 0; background: none; font: inherit; font-weight: 600; color: var(--cnf-primary); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* Buttons */
.cnf__actions{ margin-top: 24px; }
.cnf__submit, .cnf-button{
	display: inline-flex; align-items: center; justify-content: center; gap: 10px;
	min-height: 52px; padding: 14px 24px; margin: 0;
	font-family: var(--cnf-font-b); font-size: 15px; font-weight: 600; line-height: 1; letter-spacing: .005em;
	color: var(--cnf-btn-text); background: var(--cnf-primary);
	border: 0; border-radius: var(--cnf-radius); cursor: pointer; text-decoration: none;
	transition: transform .15s ease, box-shadow .2s ease, filter .15s ease, opacity .15s ease;
}
.cnf__submit:hover, .cnf-button:hover{ filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 8px 22px -10px var(--cnf-primary); color: var(--cnf-btn-text); }
.cnf__submit:active{ transform: translateY(0); }
.cnf__submit:focus-visible, .cnf-button:focus-visible{ outline: none; box-shadow: 0 0 0 4px var(--cnf-ring); }
.cnf__submit svg{ transition: transform .2s ease; }
.cnf__submit:hover svg{ transform: translateX(3px); }
.cnf__submit:disabled{ opacity: .65; cursor: progress; transform: none; }
.cnf__submit.is-loading svg{ display: none; }
.cnf__submit.is-loading::after{ content: ""; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: cnf-spin .7s linear infinite; }
@keyframes cnf-spin{ to{ transform: rotate(360deg); } }

/* Success */
.cnf__success{ outline: none; animation: cnf-rise .35s cubic-bezier(.2,.8,.2,1); }
.cnf__success-icon{ display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--cnf-tint); color: var(--cnf-primary); margin-bottom: 18px; }
.cnf__success-title{ font-family: var(--cnf-font-h); font-size: clamp(22px, 2.8vw, 28px); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; margin: 0 0 8px; color: var(--cnf-text); }
.cnf__success-text{ margin: 0; color: var(--cnf-muted); max-width: 52ch; }

/* ---------- One question at a time ---------- */
.cnf--steps .cnf__grid{ display: block; }
.cnf--steps .cnf__section{ display: none; }
.cnf--steps .cnf__field{ display: none; }
.cnf--steps .cnf__field.is-current{ display: flex; animation: cnf-step .3s cubic-bezier(.2,.8,.2,1); }
.cnf--steps .cnf__field.is-current + .cnf__field.is-current{ margin-top: 16px; }
.cnf__stephead{ display: flex; justify-content: space-between; gap: 12px; font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--cnf-muted); }
.cnf__stepsec{ color: var(--cnf-primary); }
.cnf__bar{ height: 4px; margin: 12px 0 26px; background: var(--cnf-line); border-radius: 4px; overflow: hidden; }
.cnf__bar i{ display: block; height: 100%; width: 0; background: var(--cnf-primary); border-radius: 4px; transition: width .35s ease; }
.cnf__stepq, .cnf--steps .cnf__field.is-single > .cnf__label, .cnf--steps .cnf__field.is-single > legend.cnf__label{
	font-family: var(--cnf-font-h); font-size: clamp(22px, 3vw, 30px); font-weight: 800; letter-spacing: -.025em; line-height: 1.15; color: var(--cnf-text); margin: 0 0 14px; text-wrap: balance;
}
.cnf--steps .cnf__field.is-single > legend.cnf__label{ margin-bottom: 14px; }
.cnf--steps .cnf__field.is-single .cnf__hint{ display: block; font-family: var(--cnf-font-b); font-size: 14px; letter-spacing: 0; margin: 8px 0 0; }
.cnf--steps .cnf__field.is-single .cnf__help{ margin: -6px 0 6px; font-size: 14.5px; }
.cnf--steps .cnf__choices{ flex-direction: column; gap: 10px; }
.cnf--steps .cnf__choice{ display: flex; }
.cnf--steps .cnf__choice span{ width: 100%; min-height: 54px; padding: 14px 16px 14px 48px; font-size: 16px; border-radius: var(--cnf-radius); position: relative; }
.cnf--steps .cnf__choice span::before{ content: ""; position: absolute; left: 16px; top: 50%; width: 18px; height: 18px; margin-top: -9px; border: 1.5px solid var(--cnf-muted); border-radius: 50%; transition: border .15s ease; }
.cnf--steps .cnf__field--checkboxes .cnf__choice span::before{ border-radius: 5px; }
.cnf--steps .cnf__choice input:checked + span::before{ border: 6px solid var(--cnf-primary); }
.cnf--steps .cnf__field--checkboxes .cnf__choice input:checked + span::before{ border: 0; background: var(--cnf-primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 13px no-repeat; }
.cnf--steps .is-tight .cnf__choices{ flex-direction: row; flex-wrap: wrap; }
.cnf--steps .is-tight .cnf__choice span{ width: auto; min-width: 50px; justify-content: center; padding: 12px 10px; }
.cnf--steps .is-tight .cnf__choice span::before{ display: none; }
.cnf--steps .cnf__known{ margin-bottom: 22px; }
.cnf__nav{ display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 30px; }
.cnf__back{
	min-height: 52px; padding: 14px 20px; margin: 0;
	font: inherit; font-size: 15px; font-weight: 600; color: var(--cnf-text);
	background: transparent; border: 1px solid var(--cnf-line); border-radius: var(--cnf-radius); cursor: pointer;
	transition: border-color .15s ease, opacity .15s ease;
}
.cnf__back:hover{ border-color: var(--cnf-text); }
.cnf__back:disabled{ opacity: 0; pointer-events: none; }
.cnf--steps .cnf__field--consent .cnf__check{ font-size: 15px; color: var(--cnf-text); }

/* ---------- Popup ---------- */
html.cnf-lock{ overflow: hidden; }
.cnf-modal{ position: fixed; inset: 0; z-index: 999999; display: flex; align-items: center; justify-content: center; padding: 24px; }
.cnf-modal[hidden]{ display: none; }
.cnf-modal__scrim{ position: absolute; inset: 0; background: rgba(11,11,10,.55); animation: cnf-fade .2s ease; }
.cnf-modal__dialog{
	position: relative; width: min(620px, 100%); max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); overflow: auto;
	background: var(--cnf-bg); color: var(--cnf-text);
	border-radius: calc(var(--cnf-radius) + 10px);
	box-shadow: 0 40px 100px -20px rgba(0,0,0,.35);
	padding: clamp(24px, 4.4vw, 44px);
	overscroll-behavior: contain; outline: none;
	animation: cnf-rise .32s cubic-bezier(.2,.8,.2,1);
}
.cnf-modal__close{
	position: absolute; top: 14px; right: 14px; z-index: 2;
	display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
	color: var(--cnf-text); background: var(--cnf-field); border: 1px solid var(--cnf-line); border-radius: 50%; cursor: pointer;
	transition: border-color .15s ease, transform .15s ease;
}
.cnf-modal__close:hover{ border-color: var(--cnf-text); transform: rotate(90deg); }
.cnf-modal__close:focus-visible{ outline: none; box-shadow: 0 0 0 4px var(--cnf-ring); }
.cnf-modal__loading{ display: grid; gap: 14px; padding: 8px 0; }
.cnf-modal__loading i{ display: block; height: 14px; border-radius: 8px; background: linear-gradient(90deg, var(--cnf-line) 25%, var(--cnf-tint, #eee) 50%, var(--cnf-line) 75%); background-size: 200% 100%; animation: cnf-shimmer 1.2s linear infinite; }
.cnf-modal__loading i:nth-child(1){ width: 30%; }
.cnf-modal__loading i:nth-child(2){ width: 75%; height: 28px; }
.cnf-modal__loading i:nth-child(3), .cnf-modal__loading i:nth-child(4){ height: 50px; }
@media (max-width: 600px){
	.cnf-modal{ align-items: flex-end; padding: 0; }
	.cnf-modal__dialog{ width: 100%; max-height: 92vh; max-height: 92dvh; border-radius: 22px 22px 0 0; padding: 30px 18px calc(24px + env(safe-area-inset-bottom, 0px)); animation-name: cnf-sheet; }
}

@keyframes cnf-fade{ from{ opacity: 0; } }
@keyframes cnf-rise{ from{ opacity: 0; transform: translateY(14px) scale(.985); } }
@keyframes cnf-sheet{ from{ transform: translateY(40px); opacity: 0; } }
@keyframes cnf-step{ from{ opacity: 0; transform: translateX(14px); } }
@keyframes cnf-shimmer{ to{ background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce){
	.cnf *, .cnf-modal *{ animation: none !important; transition: none !important; }
}
