/*
 * DD Forms.
 * Colours come from the site's brand settings through CSS variables on the wrapper:
 * --ddf-accent (focus ring and headings), --ddf-button, --ddf-button-text, --ddf-panel.
 * Field colours are set here on purpose, so a theme can never leave text invisible.
 */
.ddf-wrap {
	max-width: 720px;
	margin: 0 auto;
	box-sizing: border-box;
}

/* Optional panel behind the form, used on sites with a busy or dark page background. */
.ddf-wrap.ddf-panel {
	background: var(--ddf-panel, rgba(0, 0, 0, 0.45));
	color: #ffffff;
	padding: 30px 34px 34px;
	border-radius: 12px;
	box-shadow: 0 10px 34px rgba(0, 0, 0, 0.28);
}

.ddf-form {
	position: relative;
}

.ddf-intro {
	margin-bottom: 1.4em;
	font-size: 1.05em;
}

.ddf-intro p:last-child {
	margin-bottom: 0;
}

.ddf-field {
	margin: 0 0 1.25em;
}

.ddf-field fieldset {
	border: 0;
	margin: 0;
	padding: 0;
	min-width: 0;
}

.ddf-field > label,
.ddf-field legend {
	display: block;
	font-weight: 600;
	margin-bottom: 0.4em;
	padding: 0;
}

.ddf-req {
	color: #ff4d4d;
	font-size: 1.15em;
	font-weight: 700;
	line-height: 1;
}

.ddf-form .ddf-field input[type="text"],
.ddf-form .ddf-field input[type="email"],
.ddf-form .ddf-field input[type="tel"],
.ddf-form .ddf-field input[type="url"],
.ddf-form .ddf-field input[type="number"],
.ddf-form .ddf-field input[type="date"],
.ddf-form .ddf-field input[type="time"],
.ddf-form .ddf-field select,
.ddf-form .ddf-field textarea {
	box-sizing: border-box;
	display: block;
	width: 100%;
	max-width: 100%;
	margin: 0;
	padding: 12px 14px;
	font-size: 16px;
	line-height: 1.4;
	color: #222222;
	-webkit-text-fill-color: #222222;
	caret-color: #222222;
	background-color: #ffffff;
	border: 1px solid rgba(0, 0, 0, 0.25);
	border-radius: 6px;
	box-shadow: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ddf-form .ddf-field input[type="text"]:focus,
.ddf-form .ddf-field input[type="email"]:focus,
.ddf-form .ddf-field input[type="tel"]:focus,
.ddf-form .ddf-field input[type="url"]:focus,
.ddf-form .ddf-field input[type="number"]:focus,
.ddf-form .ddf-field input[type="date"]:focus,
.ddf-form .ddf-field input[type="time"]:focus,
.ddf-form .ddf-field select:focus,
.ddf-form .ddf-field textarea:focus {
	color: #222222;
	-webkit-text-fill-color: #222222;
	background-color: #ffffff;
	border-color: var(--ddf-accent, #1e73be);
	outline: none;
	box-shadow: 0 0 0 3px var(--ddf-accent, #1e73be);
}

.ddf-form .ddf-field textarea {
	min-height: 9em;
	resize: vertical;
}

/* Fields that only appear for certain answers. */
.ddf-form .ddf-field[hidden],
.ddf-form .ddf-html[hidden] {
	display: none;
}

.ddf-form .ddf-html {
	margin: 0 0 1.25em;
}

.ddf-form .ddf-draft-note {
	margin: 0 0 1.2em;
	padding: 10px 14px;
	background: #ffffff;
	color: #222222;
	border-radius: 6px;
	font-size: 0.9375em;
}

.ddf-form .ddf-draft-note button {
	margin-left: 6px;
	padding: 3px 10px;
	font-size: 0.9375em;
	font-weight: 600;
	color: #222222;
	background: #ececec;
	border: 1px solid rgba(0, 0, 0, 0.25);
	border-radius: 4px;
	cursor: pointer;
}

/* Date and time: the date, then hour, minutes and AM or PM side by side. */
.ddf-form .ddf-dt {
	display: grid;
	grid-template-columns: minmax(150px, 1.7fr) 1fr 1fr 1.2fr;
	gap: 10px;
}

.ddf-form .ddf-sub {
	display: block;
	margin: 0;
	font-weight: 400;
}

.ddf-form .ddf-sub > span {
	display: block;
	font-size: 0.8125em;
	margin-bottom: 0.25em;
	opacity: 0.9;
}

.ddf-form .ddf-early {
	margin-top: 0.7em;
	padding: 10px 14px;
	background: #ffffff;
	color: #222222;
	border-radius: 6px;
	font-weight: 600;
}

.ddf-form .ddf-early input {
	width: 20px;
	height: 20px;
	margin: 0 8px 0 0;
	vertical-align: -4px;
	accent-color: var(--ddf-button, #1e73be);
}

.ddf-form .ddf-early[hidden] {
	display: none;
}

@media (max-width: 600px) {
	.ddf-form .ddf-dt {
		grid-template-columns: 1fr 1fr 1fr;
	}

	.ddf-form .ddf-dt .ddf-sub:first-child {
		grid-column: 1 / -1;
	}
}

/* File fields: a white drop area like the other fields, then the chosen files listed under it. */
.ddf-form .ddf-field input[type="file"] {
	box-sizing: border-box;
	display: block;
	width: 100%;
	max-width: 100%;
	margin: 0;
	padding: 12px 14px;
	font-size: 15px;
	line-height: 1.4;
	color: transparent; /* Hides the browser's "No file chosen" text. The chosen files are listed underneath. */
	background-color: #ffffff;
	border: 1px dashed rgba(0, 0, 0, 0.45);
	border-radius: 6px;
	cursor: pointer;
}

.ddf-form .ddf-field input[type="file"]:focus {
	outline: none;
	border-color: var(--ddf-accent, #1e73be);
	box-shadow: 0 0 0 3px var(--ddf-accent, #1e73be);
}

.ddf-form .ddf-field input[type="file"]::file-selector-button {
	margin-right: 12px;
	padding: 7px 14px;
	font: inherit;
	font-weight: 600;
	color: #222222;
	background: #ececec;
	border: 1px solid rgba(0, 0, 0, 0.25);
	border-radius: 4px;
	cursor: pointer;
}

.ddf-form .ddf-files {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ddf-form .ddf-files li {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 8px 0 0;
	padding: 8px 12px;
	background: #ffffff;
	color: #222222;
	border-radius: 6px;
	font-size: 0.9375em;
	word-break: break-word;
}

.ddf-form .ddf-file-remove {
	flex: 0 0 auto;
	padding: 4px 10px;
	font-size: 0.875em;
	font-weight: 600;
	line-height: 1.3;
	color: #b3261e;
	background: #ffffff;
	border: 1px solid #b3261e;
	border-radius: 4px;
	cursor: pointer;
}

.ddf-form .ddf-file-remove:hover,
.ddf-form .ddf-file-remove:focus {
	color: #ffffff;
	background: #b3261e;
}

.ddf-choice {
	display: block;
	font-weight: 400;
	margin: 0.3em 0;
}

.ddf-help {
	font-size: 0.875em;
	opacity: 0.85;
	margin-top: 0.35em;
}

/* Messages sit on their own white chip so they read on any page background. */
.ddf-error,
.ddf-status {
	display: inline-block;
	background: #ffffff;
	color: #b3261e;
	font-size: 0.875em;
	font-weight: 600;
	line-height: 1.4;
	padding: 0.3em 0.7em;
	border-radius: 4px;
	margin-top: 0.45em;
}

.ddf-status {
	margin: 0 0 1em;
}

.ddf-form .ddf-field.ddf-has-error input,
.ddf-form .ddf-field.ddf-has-error select,
.ddf-form .ddf-field.ddf-has-error textarea,
.ddf-form .ddf-field.ddf-has-error input:focus,
.ddf-form .ddf-field.ddf-has-error select:focus,
.ddf-form .ddf-field.ddf-has-error textarea:focus {
	border: 2px solid #b3261e;
	background-color: #fff3f2;
}

/* The visible human check. Space is held for it so the page does not jump when it appears. */
.ddf-human {
	margin: 0 0 1.25em;
}

.ddf-human-box .ddf-human-slot {
	min-height: 54px;
}

.ddf-human-v2 .ddf-human-slot {
	min-height: 78px;
}

.ddf-human-label {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	box-sizing: border-box;
	min-width: 230px;
	margin: 0;
	padding: 14px 18px;
	background: #ffffff;
	color: #222222;
	border: 1px solid rgba(0, 0, 0, 0.25);
	border-radius: 6px;
	font-weight: 600;
	line-height: 1.3;
	cursor: pointer;
	user-select: none;
}

.ddf-form .ddf-human-label input[type="checkbox"] {
	width: 24px;
	height: 24px;
	margin: 0;
	flex: 0 0 auto;
	cursor: pointer;
	accent-color: var(--ddf-button, #1e73be);
}

.ddf-human-label:focus-within {
	box-shadow: 0 0 0 3px var(--ddf-accent, #1e73be);
}

.ddf-human.ddf-has-error .ddf-human-label {
	border: 2px solid #b3261e;
	background: #fff3f2;
}

.ddf-actions {
	margin-top: 1.4em;
}

.ddf-form .ddf-submit,
.ddf-form .ddf-step-next {
	display: inline-block;
	background: var(--ddf-button, #1e73be);
	color: var(--ddf-button-text, #ffffff);
	border: 0;
	border-radius: 6px;
	padding: 13px 34px;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
	cursor: pointer;
	transition: filter 0.15s ease, transform 0.05s ease;
}

.ddf-form .ddf-submit:hover,
.ddf-form .ddf-submit:focus,
.ddf-form .ddf-step-next:hover,
.ddf-form .ddf-step-next:focus {
	background: var(--ddf-button, #1e73be);
	color: var(--ddf-button-text, #ffffff);
	filter: brightness(1.12);
}

.ddf-form .ddf-submit:focus-visible,
.ddf-form .ddf-step-next:focus-visible {
	outline: 3px solid var(--ddf-accent, #ffffff);
	outline-offset: 2px;
}

.ddf-form .ddf-submit:active,
.ddf-form .ddf-step-next:active {
	transform: translateY(1px);
}

.ddf-sending .ddf-submit {
	opacity: 0.7;
	cursor: progress;
}

.ddf-success {
	text-align: center;
	padding: 1.5em 0;
}

.ddf-success h2,
.ddf-success h3 {
	color: var(--ddf-accent, inherit);
}

.ddf-success:focus {
	outline: none;
}

[hidden].ddf-error,
[hidden].ddf-status {
	display: none;
}

@media (max-width: 600px) {
	.ddf-wrap.ddf-panel {
		padding: 22px 18px 24px;
		border-radius: 10px;
	}

	.ddf-form .ddf-submit,
	.ddf-form .ddf-step-next {
		width: 100%;
	}
}

/* A heading at the top of a form takes the site's heading colour. */
.ddf-wrap .ddf-intro h2,
.ddf-wrap .ddf-intro h3 {
	color: var(--ddf-accent, inherit);
	margin: 0 0 0.6em;
	line-height: 1.25;
}

/* Signature field: type it or draw it. */
.ddf-sign-tabs {
	display: flex;
	gap: 6px;
	margin: 0 0 8px;
}
.ddf-wrap .ddf-form .ddf-sign-tab,
.ddf-wrap .ddf-form .ddf-sign-clear {
	font: inherit;
	font-size: 0.85em;
	padding: 5px 12px;
	border: 1px solid rgba(255, 255, 255, 0.55);
	border-radius: 6px;
	background: transparent;
	color: inherit;
	cursor: pointer;
}
.ddf-wrap .ddf-form .ddf-sign-tab.ddf-sign-on {
	background: var(--ddf-button, #1e73be);
	border-color: var(--ddf-button, #1e73be);
	color: var(--ddf-button-text, #ffffff);
	font-weight: 600;
}
.ddf-sign-preview {
	min-height: 2.4em;
	margin-top: 8px;
	padding: 4px 12px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.6);
	font-family: "Segoe Script", "Brush Script MT", "Snell Roundhand", "Apple Chancery", cursive;
	font-size: 1.7em;
	line-height: 1.3;
}
.ddf-sign-pad {
	display: block;
	width: 100%;
	max-width: 600px;
	height: auto;
	background: #ffffff;
	border: 1px solid #cccccc;
	border-radius: 8px;
	touch-action: none;
	cursor: crosshair;
}
.ddf-wrap .ddf-form .ddf-sign-clear {
	margin-top: 8px;
}


/* Quizzes: one question at a time. */
.ddf-step-off {
	display: none !important;
}

.ddf-quiz .ddf-field legend,
.ddf-quiz .ddf-field[data-ddf-correct] > label {
	font-size: 1.2em;
	font-weight: 700;
	line-height: 1.35;
	margin-bottom: 0.7em;
}

.ddf-quiz-lead {
	color: var(--ddf-accent, inherit);
	font-style: italic;
	margin: 0 0 1em;
}

.ddf-quiz .ddf-choice {
	border: 1px solid rgba(128, 128, 128, 0.45);
	border-radius: 6px;
	cursor: pointer;
	margin: 0.5em 0;
	padding: 0.7em 0.9em;
}

.ddf-quiz .ddf-choice:hover,
.ddf-quiz .ddf-choice:focus-within {
	border-color: var(--ddf-accent, #1e73be);
}

.ddf-picture-choices {
	display: grid;
	gap: 12px;
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ddf-picture-choices legend {
	grid-column: 1 / -1;
}

.ddf-quiz .ddf-choice-picture {
	margin: 0;
}

.ddf-choice-picture img {
	aspect-ratio: 4 / 3;
	border-radius: 4px;
	display: block;
	height: auto;
	margin-bottom: 0.6em;
	object-fit: cover;
	width: 100%;
}

.ddf-quiz-explain {
	border-left: 4px solid var(--ddf-accent, #1e73be);
	padding: 0.2em 0 0.2em 1em;
}

.ddf-quiz-explain:focus {
	outline: none;
}

.ddf-quiz-asked {
	font-size: 0.95em;
	margin: 0 0 0.8em;
	opacity: 0.8;
}

.ddf-quiz-verdict {
	font-size: 1.4em;
	font-weight: 700;
	margin: 0 0 0.3em;
}

.ddf-quiz-right {
	color: #3fb96a;
}

.ddf-quiz-wrong {
	color: #ef6b5e;
}

.ddf-quiz-answer {
	font-weight: 700;
	margin: 0 0 0.8em;
}

.ddf-quiz-why {
	margin: 0;
}

.ddf-quiz-nav {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 1.4em;
}

.ddf-form .ddf-quiz-back {
	background: transparent;
	border: 1px solid currentColor;
	border-radius: 4px;
	color: inherit;
	cursor: pointer;
	font: inherit;
	padding: 0.7em 1.2em;
}

.ddf-quiz-progress {
	font-size: 0.9em;
	margin-left: auto;
	opacity: 0.8;
}

.ddf-quiz-end {
	margin-bottom: 1em;
}

.ddf-quiz-tier {
	font-size: 1.1em;
}

.ddf-quiz-outro {
	margin-top: 1.4em;
}

.ddf-quiz-again a {
	text-decoration: underline;
}

@media (max-width: 480px) {
	.ddf-picture-choices {
		grid-template-columns: 1fr;
	}
}

.ddf-form .ddf-quiz-next {
	background: var(--ddf-button, #1e73be);
	border: 0;
	border-radius: 6px;
	color: var(--ddf-button-text, #ffffff);
	cursor: pointer;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
	padding: 13px 34px;
}

.ddf-form .ddf-quiz-next:hover,
.ddf-form .ddf-quiz-next:focus {
	background: var(--ddf-button, #1e73be);
	color: var(--ddf-button-text, #ffffff);
	filter: brightness(1.12);
}

.ddf-form .ddf-quiz-next:focus-visible,
.ddf-form .ddf-quiz-back:focus-visible {
	outline: 3px solid var(--ddf-accent, #ffffff);
	outline-offset: 2px;
}

/* Until the script has set the quiz up, only the opening is on show. */
.ddf-quiz .ddf-form:not(.ddf-quiz-ready) .ddf-field,
.ddf-quiz .ddf-form:not(.ddf-quiz-ready) .ddf-quiz-end,
.ddf-quiz .ddf-form:not(.ddf-quiz-ready) .ddf-human,
.ddf-quiz .ddf-form:not(.ddf-quiz-ready) .ddf-actions {
	display: none;
}

.ddf-quiz-outro a,
.ddf-quiz-again a {
	color: var(--ddf-accent, inherit);
}


.ddf-quiz-links {
	margin: 1.4em 0 0.6em;
}

.ddf-quiz-links .ddf-quiz-link {
	border: 1px solid currentColor;
	border-radius: 6px;
	color: inherit;
	display: inline-block;
	font-weight: 700;
	margin: 0 8px 10px 0;
	padding: 11px 20px;
	text-decoration: none;
}

.ddf-quiz-links .ddf-quiz-link-main {
	background: var(--ddf-button, #1e73be);
	border-color: var(--ddf-button, #1e73be);
	color: var(--ddf-button-text, #ffffff);
}

.ddf-quiz-links .ddf-quiz-link:hover,
.ddf-quiz-links .ddf-quiz-link:focus {
	filter: brightness(1.12);
}

.ddf-quiz .ddf-choice input {
	margin-right: 0.5em;
}

.ddf-quiz-why p {
	margin: 0 0 0.8em;
}

.ddf-quiz-why img {
	border-radius: 4px;
	display: block;
	height: auto;
	margin: 0.4em 0 0.8em;
	max-height: 420px;
	max-width: 100%;
	width: auto;
}

.ddf-quiz-why blockquote {
	border-left: 3px solid rgba(128, 128, 128, 0.6);
	font-style: italic;
	margin: 0 0 0.8em;
	padding-left: 0.9em;
}

/* Ratings: a row of numbered choices with a caption at each end. */
.ddf-scale .ddf-scale-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4em;
	margin-top: 0.35em;
}

.ddf-scale .ddf-choice {
	position: relative;
	margin: 0;
}

.ddf-scale .ddf-choice input {
	position: absolute;
	opacity: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	cursor: pointer;
}

.ddf-scale .ddf-choice span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.75em;
	height: 2.75em;
	padding: 0 0.4em;
	border: 1px solid currentColor;
	border-radius: 6px;
	font-weight: 600;
	line-height: 1;
}

.ddf-scale-10 .ddf-choice span {
	min-width: 2.3em;
	height: 2.5em;
}

.ddf-scale .ddf-choice:hover span {
	border-color: var(--ddf-button, #1e73be);
}

.ddf-scale .ddf-choice input:checked + span {
	background: var(--ddf-button, #1e73be);
	border-color: var(--ddf-button, #1e73be);
	color: var(--ddf-button-text, #ffffff);
}

.ddf-scale .ddf-choice input:focus-visible + span {
	outline: 2px solid var(--ddf-accent, #1e73be);
	outline-offset: 2px;
}

.ddf-scale-wrap {
	display: inline-block;
	max-width: 100%;
}

.ddf-scale-ends {
	display: flex;
	justify-content: space-between;
	gap: 1em;
	font-size: 0.8em;
	opacity: 0.8;
	margin-top: 0.4em;
}

.ddf-scale-ends span {
	max-width: 48%;
}

.ddf-scale-ends span:last-child {
	text-align: right;
}

/* A question the link has already answered is not shown, but it is still sent. */
.ddf-field.ddf-from-link {
	display: none;
}

/* Opened without a valid link: only the opening words and the note are shown. */
.ddf-form.ddf-needs-link > *:not(.ddf-intro):not(.ddf-link-note) {
	display: none !important;
}

.ddf-link-note {
	margin: 1em 0;
	padding: 0.9em 1.1em;
	border: 1px solid currentColor;
	border-radius: 6px;
	font-weight: 600;
}

/* A long list of choices in columns. */
.ddf-cols {
	column-gap: 24px;
}
.ddf-cols .ddf-choice {
	break-inside: avoid;
	margin: 0;
	padding: 0.15em 0;
}
@media (min-width: 560px) {
	.ddf-cols-2,
	.ddf-cols-3,
	.ddf-cols-4 {
		column-count: 2;
	}
}
@media (min-width: 820px) {
	.ddf-cols-3 {
		column-count: 3;
	}
	.ddf-cols-4 {
		column-count: 4;
	}
}

/* The picture on a quiz's opening card. */
.ddf-quiz-cover {
	display: block;
	width: 100%;
	height: auto;
	max-height: 360px;
	object-fit: cover;
	border-radius: 8px;
	margin: 0 0 18px;
}

/* A form in steps. */
.ddf-steps-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 12px;
	margin: 0 0 18px;
	padding: 0 0 10px;
	border-bottom: 2px solid currentColor;
	font-size: 1.05em;
}
.ddf-steps-count {
	font-size: 0.82em;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	opacity: 0.8;
}
.ddf-step-nav {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 18px;
	margin: 18px 0 0;
}
.ddf-step-nav[hidden],
.ddf-form .ddf-step-next[hidden],
.ddf-form .ddf-step-back[hidden],
.ddf-steps-head[hidden],
.ddf-step[hidden],
.ddf-resume[hidden],
.ddf-has-steps .ddf-actions[hidden],
.ddf-has-steps .ddf-human[hidden] {
	display: none !important;
}
.ddf-step-back {
	background: none;
	border: 0;
	padding: 6px 2px;
	color: inherit;
	font: inherit;
	text-decoration: underline;
	cursor: pointer;
}
.ddf-resume {
	margin: 22px 0 0;
	padding: 14px 16px;
	border: 1px dashed currentColor;
	border-radius: 8px;
	font-size: 0.94em;
}
.ddf-resume-text {
	margin: 0 0 10px;
}
.ddf-resume-send {
	background: none;
	border: 1px solid currentColor;
	border-radius: 6px;
	padding: 8px 14px;
	color: inherit;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}
.ddf-resume-send[disabled] {
	opacity: 0.6;
	cursor: default;
}
.ddf-resume-note {
	margin: 10px 0 0;
	font-weight: 600;
}
@media (max-width: 559px) {
	.ddf-step-nav .ddf-step-next,
	.ddf-resume-send {
		width: 100%;
	}
}

/* Suggestions offered under a text box while typing. */
.ddf-form .ddf-field[data-ddf-suggest] {
	position: relative;
}

.ddf-form .ddf-suggest {
	position: absolute;
	left: 0;
	right: 0;
	z-index: 30;
	box-sizing: border-box;
	margin: 2px 0 0;
	padding: 4px 0;
	max-height: 320px;
	overflow-y: auto;
	list-style: none;
	background-color: #ffffff;
	border: 1px solid rgba(0, 0, 0, 0.25);
	border-radius: 6px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.ddf-form .ddf-suggest[hidden] {
	display: none !important;
}

.ddf-form .ddf-suggest li {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 2px 12px;
	min-height: 44px;
	box-sizing: border-box;
	margin: 0;
	padding: 10px 14px;
	font-size: 16px;
	line-height: 1.35;
	color: #222222;
	cursor: pointer;
	list-style: none;
}

.ddf-form .ddf-suggest li::before,
.ddf-form .ddf-suggest li::marker {
	content: none;
}

.ddf-form .ddf-suggest li:hover,
.ddf-form .ddf-suggest li.ddf-suggest-on {
	background-color: #eef4fb;
}

.ddf-form .ddf-suggest-name {
	font-weight: 600;
	color: #222222;
}

.ddf-form .ddf-suggest-note {
	font-size: 0.85em;
	color: #555555;
}
