/**
 * Contact Form 7 → Tender Care theme form chrome.
 * Matches tendercarelc/pages.css enroll form (.form, .field, .chip, .chips).
 */

/* ---------- layout wrappers ---------- */
.enroll-page > .wpcf7 {
	min-width: 0;
	width: 100%;
}

.narrow > .wpcf7 {
	margin-top: 8px;
	max-width: 720px;
}

.wpcf7-form.form {
	width: 100%;
	box-sizing: border-box;
}

.wpcf7-form .form__grid {
	margin: 0;
	width: 100%;
}

/* CF7 may still inject <p>/<br> — keep them out of the grid/flex flow */
.wpcf7-form .form__grid > p,
.wpcf7-form .field > p,
.wpcf7-form .group > p,
.wpcf7-form .chips > p,
.wpcf7-form p:has(> .wpcf7-form-control-wrap),
.wpcf7-form p:has(> .wpcf7-submit) {
	display: contents;
}

.wpcf7-form .field label br,
.wpcf7-form .group legend + br,
.wpcf7-form br {
	display: none;
}

/* Labels stay inline (Name *) like HTML; input sits below via wrap margin */
.wpcf7-form .field label {
	display: block;
	font-size: 17px;
	font-weight: 700;
	color: var(--ink);
}

.wpcf7-form .group legend {
	display: block;
	width: 100%;
	padding: 0;
	margin-bottom: 12px;
	font-size: 17px;
	font-weight: 700;
	color: var(--ink);
}

.wpcf7-form .field .wpcf7-form-control-wrap {
	display: block;
	width: 100%;
	margin-top: 10px;
}

.wpcf7-form .wpcf7-form-control-wrap {
	display: block;
	width: 100%;
}

.wpcf7-form .field input[type="text"],
.wpcf7-form .field input[type="email"],
.wpcf7-form .field input[type="tel"],
.wpcf7-form .field input[type="url"],
.wpcf7-form .field input[type="number"],
.wpcf7-form .field input[type="date"],
.wpcf7-form .field textarea,
.wpcf7-form .field select {
	display: block;
	width: 100%;
	max-width: 100%;
	height: 58px;
	padding: 0 18px;
	border: 1px solid #d9cfc5;
	border-radius: 6px;
	background: #fff;
	font: inherit;
	font-size: 17px;
	color: var(--ink);
	box-sizing: border-box;
	text-overflow: ellipsis;
	transition: border-color .2s var(--ease, ease), box-shadow .2s var(--ease, ease);
}

.wpcf7-form .field textarea {
	height: auto;
	min-height: 140px;
	padding: 14px 16px;
	resize: vertical;
	line-height: 1.5;
}

.wpcf7-form .field input::placeholder,
.wpcf7-form .field textarea::placeholder {
	color: #9b8f93;
}

.wpcf7-form .field input:focus,
.wpcf7-form .field textarea:focus,
.wpcf7-form .field select:focus {
	outline: none;
	border-color: var(--rose-dark);
	box-shadow: 0 0 0 3px rgba(190, 49, 83, .15);
}

/* ---------- chips (CF7 list items → HTML .chip look) ---------- */
.wpcf7-form .chips {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	width: 100%;
}

.wpcf7-form .chips.chips--grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.wpcf7-form .chips .wpcf7-form-control-wrap,
.wpcf7-form .chips .wpcf7-form-control {
	display: contents;
}

.wpcf7-form .chips .wpcf7-list-item {
	position: relative;
	display: block;
	margin: 0 !important;
	padding: 0;
	cursor: pointer;
	min-width: 0;
}

.wpcf7-form .chips:not(.chips--grid) .wpcf7-list-item {
	flex: 0 1 auto;
}

.wpcf7-form .chips .wpcf7-list-item label {
	display: block;
	cursor: pointer;
	gap: 0;
	margin: 0;
}

.wpcf7-form .chips .wpcf7-list-item input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
	z-index: 1;
}

.wpcf7-form .chips .wpcf7-list-item-label {
	display: flex;
	align-items: center;
	gap: 10px;
	height: 100%;
	min-height: 52px;
	padding: 13px 16px;
	border: 1px solid #d9cfc5;
	border-radius: 6px;
	background: #fff;
	font-size: 16px;
	font-weight: 500;
	line-height: 1.3;
	color: var(--ink);
	box-sizing: border-box;
	transition: background-color .2s var(--ease, ease), border-color .2s var(--ease, ease);
}

.wpcf7-form .chips .wpcf7-list-item-label::before {
	content: "";
	flex: none;
	width: 18px;
	height: 18px;
	border: 1.5px solid #b9aca7;
	border-radius: 5px;
	background: #fff center / 12px no-repeat;
	transition: inherit;
}

.wpcf7-form .chips .wpcf7-list-item:hover .wpcf7-list-item-label {
	border-color: #b9aca7;
}

.wpcf7-form .chips .wpcf7-list-item input:checked + .wpcf7-list-item-label {
	border-color: var(--rose-dark);
	background: #f8e4e8;
}

.wpcf7-form .chips .wpcf7-list-item input:checked + .wpcf7-list-item-label::before {
	border-color: var(--rose-dark);
	background-color: var(--rose-dark);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.3 2.3 4.7-5' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.wpcf7-form .chips .wpcf7-list-item input:focus-visible + .wpcf7-list-item-label {
	outline: 3px solid rgba(190, 49, 83, .35);
	outline-offset: 2px;
}

/* radio chips — round indicator */
.wpcf7-form .chips .wpcf7-radio .wpcf7-list-item-label::before {
	border-radius: 50%;
}

.wpcf7-form .chips .wpcf7-radio .wpcf7-list-item input:checked + .wpcf7-list-item-label::before {
	background-image: none;
	box-shadow: inset 0 0 0 3px #fff;
}

/* ---------- submit ---------- */
.wpcf7-form input.wpcf7-submit.form__submit,
.wpcf7-form button.wpcf7-submit.form__submit {
	appearance: none;
	cursor: pointer;
	border: 0;
	margin-top: 36px;
}

.wpcf7-form p:has(> .wpcf7-submit),
.wpcf7-form .wpcf7-form-control.wpcf7-submit {
	margin-top: 0;
}

/* ---------- validation / response ---------- */
.wpcf7-form .wpcf7-not-valid-tip {
	display: block;
	margin-top: 6px;
	font-size: 14px;
	font-weight: 500;
	color: var(--rose-dark);
}

.wpcf7-form .wpcf7-response-output {
	margin: 24px 0 0;
	padding: 14px 18px;
	border-radius: 10px;
	border: 1px solid #d9cfc5;
	font-size: 15px;
	line-height: 1.5;
}

.wpcf7-form.sent .wpcf7-response-output {
	border-color: #6a9a6a;
	background: #eef6ee;
	color: var(--ink);
}

.wpcf7-form.invalid .wpcf7-response-output,
.wpcf7-form.failed .wpcf7-response-output,
.wpcf7-form.aborted .wpcf7-response-output {
	border-color: var(--rose-dark);
	background: #f8e4e8;
	color: var(--ink);
}

.wpcf7-spinner {
	margin-left: 10px;
}

@media (max-width: 820px) {
	.wpcf7-form .chips.chips--grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.wpcf7-form .field input[type="text"],
	.wpcf7-form .field input[type="email"],
	.wpcf7-form .field input[type="tel"],
	.wpcf7-form .field input[type="number"],
	.wpcf7-form .field textarea {
		font-size: 16px;
	}
}

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