/**
 * Problem picker.
 *
 * Contact Form 7 checkboxes styled as pills. The real <input> stays in the DOM
 * and keeps focus, it is just visually hidden, so keyboard and screen reader
 * behaviour is untouched.
 */

.snof-triage {
	--snof-t-ink: #20211f;
	--snof-t-muted: #575a56;
	--snof-t-line: #e0dbd1;
	--snof-t-brand: #47727a;
	--snof-t-brand-tint: #e3edee;
	--snof-t-paper: #ffffff;
}

/* ---------- pills ---------- */

.snof-triage .wpcf7-checkbox {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.snof-triage .wpcf7-list-item {
	margin: 0;
}

.snof-triage .wpcf7-list-item label {
	display: block;
	margin: 0;
	cursor: pointer;
}

/* Visually hidden, still focusable and still announced. */
.snof-triage .wpcf7-checkbox input[type="checkbox"] {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.snof-triage .wpcf7-list-item-label {
	display: inline-block;
	padding: 11px 20px;
	border: 1.5px solid var(--snof-t-line);
	border-radius: 100px;
	background: var(--snof-t-paper);
	color: var(--snof-t-ink);
	font-size: 15.5px;
	font-weight: 500;
	line-height: 1.3;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.snof-triage .wpcf7-list-item label:hover .wpcf7-list-item-label {
	border-color: var(--snof-t-brand);
}

.snof-triage .wpcf7-checkbox input[type="checkbox"]:checked + .wpcf7-list-item-label {
	background: var(--snof-t-brand);
	border-color: var(--snof-t-brand);
	color: #ffffff;
}

.snof-triage .wpcf7-checkbox input[type="checkbox"]:focus-visible + .wpcf7-list-item-label {
	outline: 2px solid var(--snof-t-brand);
	outline-offset: 3px;
}

/* ---------- reveal ---------- */

/* Collapsed only once JS has taken over, so no-JS users get the full form. */
.snof-triage--js .snof-triage__reveal {
	display: grid;
	grid-template-rows: 0fr;
	visibility: hidden;
	opacity: 0;
	margin-top: 0;
	transition: grid-template-rows 0.28s ease, opacity 0.2s ease, visibility 0.28s, margin-top 0.28s ease;
}

.snof-triage--js .snof-triage__reveal > * {
	/* overflow: hidden; */
	min-height: 0;
}

.snof-triage--js.is-active .snof-triage__reveal {
	grid-template-rows: 1fr;
	visibility: visible;
	opacity: 1;
	margin-top: 26px;
}

.snof-triage__reveal-inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
}

.snof-triage__status {
	flex-basis: 100%;
	margin: 0 0 2px;
	font-size: 14px;
	color: var(--snof-t-muted);
}

.snof-triage__status:empty {
	display: none;
}

/* ---------- fields ---------- */

.snof-triage input[type="email"],
.snof-triage input[type="text"] {
	flex: 1 1 240px;
	min-width: 0;
	padding: 14px 18px;
	border: 1.5px solid var(--snof-t-line);
	border-radius: 100px;
	background: var(--snof-t-paper);
	font: inherit;
	font-size: 16px; /* 16px stops iOS zooming on focus. */
	color: var(--snof-t-ink);
}

/* One ring, not two.
   An outline with a positive offset draws a second concentric ring outside the
   border, which on a pill-shaped field reads as a double border. Offset 0 puts
   the outline flush against the border so the two merge into a single thicker
   ring, and the focus indicator is kept rather than removed. */
.snof-triage input[type="email"]:focus,
.snof-triage input[type="text"]:focus,
.snof-triage input[type="email"]:focus-visible,
.snof-triage input[type="text"]:focus-visible {
	outline: 2px solid var(--snof-t-brand);
	outline-offset: 0;
	border-color: var(--snof-t-brand);
}

.snof-triage .wpcf7-form-control-wrap {
	flex: 1 1 240px;
	display: block;
	/* The input carries the only border. Themes sometimes decorate this
	   wrapper as well, which would show up as a second outline around it. */
	border: 0;
	padding: 0;
	background: none;
	box-shadow: none;
}

/* Same reason: a theme box-shadow on the field itself also reads as a
   second border. Cleared when idle, our own ring takes over on focus. */
.snof-triage input[type="email"],
.snof-triage input[type="text"] {
	box-shadow: none;
	background-clip: padding-box;
}

.snof-triage input[type="submit"] {
	flex: none;
	padding: 15px 28px;
	border: 0;
	border-radius: 100px;
	background: var(--snof-t-brand);
	color: #ffffff;
	font: inherit;
	font-weight: 700;
	font-size: 16px;
	cursor: pointer;
}

.snof-triage input[type="submit"]:hover {
	background: var(--snof-t-ink);
}

.snof-triage input[type="submit"]:focus-visible {
	outline: 2px solid var(--snof-t-ink);
	outline-offset: 3px;
}

/* ---------- consent ---------- */

.snof-triage .wpcf7-acceptance {
	flex-basis: 100%;
}

.snof-triage .wpcf7-acceptance .wpcf7-list-item-label {
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	font-size: 13.5px;
	font-weight: 400;
	color: var(--snof-t-muted);
}

.snof-triage .wpcf7-acceptance input[type="checkbox"] {
	position: static;
	width: auto;
	height: auto;
	margin: 0 8px 0 0;
	clip: auto;
	clip-path: none;
}

.snof-triage .wpcf7-acceptance label {
	display: flex;
	align-items: flex-start;
	gap: 2px;
	cursor: pointer;
}

/* ---------- CF7 messages ---------- */

.snof-triage .wpcf7-response-output {
	flex-basis: 100%;
	margin: 14px 0 0;
	padding: 12px 18px;
	border-radius: 14px;
	font-size: 15px;
}

.snof-triage .wpcf7-not-valid-tip {
	display: block;
	margin-top: 6px;
	padding-left: 18px;
	font-size: 13.5px;
}

@media (max-width: 600px) {
	.snof-triage .wpcf7-list-item-label {
		padding: 10px 17px;
		font-size: 14.5px;
	}

	.snof-triage input[type="submit"] {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.snof-triage--js .snof-triage__reveal,
	.snof-triage .wpcf7-list-item-label {
		transition: none;
	}
}
