/* ==========================================================================
   Contact Form 7 в стиле RHINO CARBON.
   Разметка полей — в docs/cf7-forms.md (классы l-fields, l-field, l-upload…).
   ========================================================================== */

.l-form .wpcf7 { margin: 0; }
.l-form .wpcf7-form { display: flex; flex-direction: column; gap: 18px; }
.l-form .wpcf7-form > p { margin: 0; }

.l-fields {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
	gap: 18px;
}
.l-fields--3 { grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); }

.l-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.l-field > label,
.l-label {
	font-family: var(--l-font-mono);
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: .02em;
	color: color-mix(in srgb, var(--l-ink) 80%, var(--l-bg));
}
.l-field .wpcf7-form-control-wrap { display: block; }

/* Выбор типа заявки: плитки-радиокнопки */
.l-choice { border: 0; margin: 0; padding: 0; min-width: 0; }
.l-choice legend { margin-bottom: 10px; padding: 0; }
.l-choice .wpcf7-radio { display: flex; flex-wrap: wrap; gap: 8px; }
.l-choice .wpcf7-list-item { margin: 0; }
.l-choice .wpcf7-list-item label {
	position: relative;
	min-height: 48px;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 0 16px;
	border: 1px solid color-mix(in srgb, var(--l-line) 75%, var(--l-ink));
	background: #fff;
	font-size: 15px;
	cursor: pointer;
	transition: border-color .15s, background-color .15s;
}
.l-choice input[type="radio"] { width: 18px; height: 18px; margin: 0; accent-color: var(--l-accent); }
.l-choice .wpcf7-list-item label:has(input:checked) { border-color: var(--l-accent); background: var(--l-accent-tint-2); color: var(--l-accent); font-weight: 600; }

/* Зона загрузки файлов */
.l-upload {
	position: relative;
	display: flex;
	align-items: center;
	gap: 18px;
	padding: 22px;
	border: 1.5px dashed var(--l-accent);
	background: var(--l-accent-tint-2);
	cursor: pointer;
	transition: background-color .15s, border-color .15s;
}
.l-upload:hover,
.l-upload.is-drag { background: var(--l-accent-tint); }
.l-upload.has-files { border-style: solid; }
.l-upload__icon {
	width: 48px;
	height: 48px;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--l-accent);
	color: var(--l-on-accent);
}
.l-upload__icon::before {
	content: "";
	width: 22px;
	height: 22px;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 16V4M7 9l5-5 5 5'/%3E%3Cpath d='M4 16v3a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-3'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 16V4M7 9l5-5 5 5'/%3E%3Cpath d='M4 16v3a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-3'/%3E%3C/svg%3E") center / contain no-repeat;
}
.l-upload__text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.l-upload__title { font-size: 16px; font-weight: 600; color: var(--l-ink); overflow-wrap: anywhere; }
.l-upload__hint { font-family: var(--l-font-mono); font-size: 12px; color: var(--l-muted); }
/* Поле файла растянуто на всю зону: клик и перетаскивание работают нативно. */
.l-upload .wpcf7-form-control-wrap { position: absolute; inset: 0; }
.l-upload input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.l-upload:focus-within { outline: 2px solid var(--l-accent); outline-offset: 2px; }

/* Нижняя строка: согласие + кнопка */
.l-form-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; }
.l-consent { max-width: 340px; font-size: 13px; line-height: 1.45; color: var(--l-muted); }
.l-consent .wpcf7-list-item { margin: 0; }
.l-consent label { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.l-consent input[type="checkbox"] { width: 18px; height: 18px; margin: 1px 0 0; flex-shrink: 0; accent-color: var(--l-accent); }
.l-consent a { color: var(--l-accent); }

.l-form .wpcf7-submit,
.l-form input[type="submit"] {
	min-height: 58px;
	padding: 0 52px 0 28px;
	border: 0;
	border-radius: var(--l-radius);
	background: var(--l-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") no-repeat right 24px center;
	color: var(--l-on-accent);
	font: inherit;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color .15s;
}
.l-form .wpcf7-submit:hover { background-color: var(--l-accent-hover); }
.l-form .wpcf7-submit:disabled { opacity: .55; cursor: not-allowed; }
.l-form .wpcf7-spinner { margin: 0 0 0 12px; background-color: var(--l-accent); }

/* Ошибки и ответы */
.l-form .wpcf7-not-valid { border-color: #B3261E !important; }
.l-form .wpcf7-not-valid-tip { margin-top: 6px; color: #B3261E; font-size: 13px; }
.l-form .wpcf7 form .wpcf7-response-output {
	margin: 0;
	padding: 14px 16px;
	border: 1px solid var(--l-line-strong);
	border-radius: var(--l-radius);
	font-size: 15px;
}
.l-form .wpcf7 form.sent .wpcf7-response-output { border-color: #2E7D4F; background: #EAF4EE; color: #1F5A38; }
.l-form .wpcf7 form.invalid .wpcf7-response-output,
.l-form .wpcf7 form.unaccepted .wpcf7-response-output,
.l-form .wpcf7 form.failed .wpcf7-response-output,
.l-form .wpcf7 form.spam .wpcf7-response-output { border-color: #B3261E; background: #FBEDEC; color: #8C1D18; }

.l-dark .l-form { color: var(--l-text); }
