/*
 * Canary Forms, front end.
 * Every selector starts with .crf.crf (two classes) so it outranks the Zox theme's
 * article styles for bare tags (.zox-post-body p, label, input, h2...), which load after us.
 * Colors: #111 black and #fedb0a Canary yellow. Yellow is only ever a background or a
 * decorative rule, never text on white. All text pairs pass WCAG AA.
 */

.crf.crf {
	--crf-ink: #111;
	--crf-yellow: #fedb0a;
	--crf-muted: #4a4a4a;   /* 8.9:1 on white */
	--crf-line: #767676;    /* 4.5:1 on white, so input borders pass the 3:1 UI rule */
	--crf-red: #b3261e;     /* 6.5:1 on white */
	box-sizing: border-box;
	width: 100%;
	max-width: 760px;
	margin: 24px 0;
	padding: 20px 20px 22px;
	background: #fff;
	border: 1px solid #d6d6d6;
	border-top: 6px solid var(--crf-yellow);
	color: var(--crf-ink);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 16px;
	line-height: 1.5;
	text-align: left;
}
.crf.crf *, .crf.crf *::before, .crf.crf *::after { box-sizing: border-box; }
.crf.crf p, .crf.crf ul, .crf.crf li, .crf.crf fieldset, .crf.crf legend, .crf.crf h2, .crf.crf h3, .crf.crf label {
	margin: 0; padding: 0; text-align: left; font-family: inherit; color: inherit; max-width: none; letter-spacing: normal; text-transform: none;
}

.crf.crf .crf-title { font-size: 24px; line-height: 1.2; font-weight: 800; margin: 0 0 8px; }
.crf.crf .crf-intro { font-size: 16px; margin: 0 0 14px; }
.crf.crf .crf-intro p { font-size: 16px; line-height: 1.5; margin: 0 0 10px; }
.crf.crf .crf-legend { font-size: 14px; color: var(--crf-muted); margin: 0 0 16px; }
.crf.crf .crf-req { color: var(--crf-red); font-weight: 700; }

.crf.crf .crf-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
@media (min-width: 600px) {
	.crf.crf .crf-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 18px; }
	.crf.crf .crf-field { grid-column: 1 / -1; }
	.crf.crf .crf-field.crf-half { grid-column: auto; }
}

.crf.crf .crf-label { display: block; font-size: 16px; line-height: 1.35; font-weight: 700; margin: 0 0 6px; }
.crf.crf .crf-help { font-size: 14px; line-height: 1.45; color: var(--crf-muted); margin: -2px 0 8px; }

.crf.crf .crf-input {
	display: block; width: 100%; max-width: none; min-height: 48px; margin: 0;
	padding: 11px 12px; border: 1px solid var(--crf-line); border-radius: 4px;
	background: #fff; color: var(--crf-ink); box-shadow: none;
	font-family: inherit; font-size: 16px; line-height: 1.4;   /* 16px stops iPhones zooming in */
	-webkit-appearance: none; appearance: none;
}
.crf.crf .crf-textarea { min-height: 150px; resize: vertical; }
.crf.crf .crf-select {
	padding-right: 40px; cursor: pointer;
	background-image: linear-gradient(45deg, transparent 50%, #111 50%), linear-gradient(135deg, #111 50%, transparent 50%);
	background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
	background-size: 6px 6px; background-repeat: no-repeat;
}
.crf.crf .crf-input::placeholder { color: #6b6b6b; opacity: 1; }

.crf.crf .crf-input:focus,
.crf.crf .crf-choice input:focus-visible,
.crf.crf .crf-submit:focus-visible,
.crf.crf .crf-file-remove:focus-visible,
.crf.crf .crf-errors a:focus-visible,
.crf.crf .crf-success:focus,
.crf.crf .crf-errors:focus {
	outline: 3px solid var(--crf-ink); outline-offset: 2px; box-shadow: 0 0 0 7px var(--crf-yellow);
}
.crf.crf .crf-success:focus, .crf.crf .crf-errors:focus { box-shadow: none; }

.crf.crf .crf-words { font-size: 13px; color: var(--crf-muted); margin: 6px 0 0; text-align: right; }
.crf.crf .crf-words.is-over { color: var(--crf-red); font-weight: 700; }

/* Choices */
.crf.crf .crf-choices { border: 0; min-width: 0; }
.crf.crf .crf-choices legend.crf-label { float: none; width: 100%; }
.crf.crf .crf-choice { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; font-size: 16px; line-height: 1.4; cursor: pointer; font-weight: 400; }
.crf.crf .crf-choice input { flex: 0 0 auto; width: 22px; height: 22px; margin: 0; accent-color: var(--crf-ink); cursor: pointer; }
.crf.crf .crf-consent { padding: 4px 0; }
.crf.crf .crf-consent span { font-weight: 600; }

/* Section headings */
.crf.crf .crf-heading { font-size: 20px; line-height: 1.25; font-weight: 800; margin: 10px 0 0; padding: 0 0 6px; border-bottom: 3px solid var(--crf-yellow); }
.crf.crf .crf-heading-text { font-size: 15px; color: var(--crf-muted); margin: 8px 0 0; }

/* File uploads */
.crf.crf .crf-drop { position: relative; border: 2px dashed var(--crf-line); border-radius: 6px; padding: 16px; background: #fafaf7; text-align: center; }
.crf.crf .crf-drop.is-over { border-color: var(--crf-ink); background: #fffbe0; }
.crf.crf .crf-file { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; opacity: 0; }
.crf.crf .crf-drop:focus-within { outline: 3px solid var(--crf-ink); outline-offset: 2px; }
.crf.crf .crf-drop-btn {
	display: inline-block; min-height: 46px; padding: 11px 20px; border: 2px solid var(--crf-ink); border-radius: 4px;
	background: #fff; color: var(--crf-ink); font-size: 16px; font-weight: 700; line-height: 1.3; cursor: pointer;
}
.crf.crf .crf-drop-btn:hover { background: var(--crf-yellow); }
.crf.crf .crf-drop-hint { display: block; margin: 8px 0 0; font-size: 14px; color: var(--crf-muted); text-align: center; }
@media (hover: none) { .crf.crf .crf-drop-or { display: none; } }
.crf.crf .crf-files { list-style: none; margin: 0; padding: 0; text-align: left; }
.crf.crf .crf-files:not(:empty) { margin-top: 14px; border-top: 1px solid #e3e3e3; }
.crf.crf .crf-files li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid #e3e3e3; margin: 0; list-style: none; }
.crf.crf .crf-thumb { flex: 0 0 56px; width: 56px; height: 56px; border-radius: 4px; object-fit: cover; background: #e9e9e4; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--crf-muted); text-transform: uppercase; }
.crf.crf .crf-file-meta { flex: 1 1 auto; min-width: 0; font-size: 14px; line-height: 1.35; }
.crf.crf .crf-file-name { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crf.crf .crf-file-size { color: var(--crf-muted); font-size: 13px; }
.crf.crf .crf-file-remove { flex: 0 0 auto; min-height: 40px; padding: 6px 12px; background: #fff; border: 1px solid var(--crf-line); border-radius: 4px; color: var(--crf-ink); font: inherit; font-size: 14px; cursor: pointer; }
.crf.crf .crf-file-remove:hover { border-color: var(--crf-ink); }

/* Errors */
.crf.crf .crf-err { color: var(--crf-red); font-size: 14px; font-weight: 700; margin: 6px 0 0; }
.crf.crf .crf-err::before { content: "! "; display: inline-block; width: 18px; height: 18px; margin-right: 6px; border-radius: 50%; background: var(--crf-red); color: #fff; font-size: 12px; line-height: 18px; text-align: center; vertical-align: 1px; }
.crf.crf .is-invalid .crf-input,
.crf.crf .is-invalid .crf-drop { border-color: var(--crf-red); border-width: 2px; }
.crf.crf .is-invalid .crf-input { padding: 10px 11px; }
.crf.crf .crf-errors { margin: 0 0 18px; padding: 12px 14px; border-left: 6px solid var(--crf-red); background: #fdf1f0; }
.crf.crf .crf-errors p { font-weight: 700; margin: 0 0 6px; }
.crf.crf .crf-errors ul { margin: 0 0 0 18px; padding: 0; list-style: disc; }
.crf.crf .crf-errors li { margin: 2px 0; font-size: 15px; }
.crf.crf .crf-errors a { color: var(--crf-red); text-decoration: underline; }

/* Submit */
.crf.crf .crf-actions { margin: 24px 0 0; }
.crf.crf .crf-submit {
	display: block; width: 100%; min-height: 52px; margin: 0; padding: 14px 28px;
	border: 2px solid var(--crf-ink); border-radius: 4px; background: var(--crf-ink); color: var(--crf-yellow);
	font-family: inherit; font-size: 17px; font-weight: 800; line-height: 1.2; letter-spacing: .01em; cursor: pointer; text-transform: none;
	-webkit-appearance: none; appearance: none; box-shadow: none;
}
.crf.crf .crf-submit:hover { background: var(--crf-yellow); color: var(--crf-ink); }
.crf.crf .crf-submit[disabled] { opacity: .65; cursor: progress; background: var(--crf-ink); color: var(--crf-yellow); }
@media (min-width: 600px) { .crf.crf .crf-submit { display: inline-block; width: auto; } }
.crf.crf .crf-progress { height: 8px; margin: 14px 0 0; background: #e6e6e6; border-radius: 4px; overflow: hidden; }
.crf.crf .crf-progress-bar { height: 100%; width: 0; background: var(--crf-ink); transition: width .2s; }
.crf.crf .crf-status { font-size: 15px; margin: 10px 0 0; min-height: 1px; }
.crf.crf .crf-status.is-error { color: var(--crf-red); font-weight: 700; }
.crf.crf .crf-noscript { margin: 12px 0 0; font-weight: 700; }
.crf.crf .crf-turnstile { margin: 22px 0 0; }

/* Thank-you */
.crf.crf .crf-success { padding: 16px 18px; background: #fffbe0; border-left: 6px solid var(--crf-ink); font-size: 18px; line-height: 1.45; }
.crf.crf .crf-success p { font-size: 18px; line-height: 1.45; margin: 0 0 8px; }
.crf.crf .crf-success p:last-child { margin-bottom: 0; }

/* Spam trap: off-screen, never seen by people */
.crf.crf .crf-hp { position: absolute !important; left: -10000px !important; top: auto; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 480px) {
	.crf.crf { padding: 16px 14px 18px; margin: 18px 0; }
	.crf.crf .crf-title { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) { .crf.crf .crf-progress-bar { transition: none; } }
