/* Состояние отправки CF7: лоадер и дизейбл на кнопке */

.wpcf7-spinner {
	display: none !important;
}

.g-form-submit {
	position: relative;
	display: inline-flex;
	align-items: stretch;
	max-width: 100%;
}

.form__submit .g-form-submit,
.popup-form__submit .g-form-submit,
.g-form-submit:has(.g2-btn--block) {
	display: flex;
	width: 100%;
}

.g-form-submit .wpcf7-submit {
	position: relative;
	z-index: 0;
}

.g-form-submit:has(.g2-btn--block) .wpcf7-submit,
.form__submit .g-form-submit .wpcf7-submit,
.popup-form__submit .g-form-submit .wpcf7-submit {
	width: 100%;
}

.g-form-submit__spinner {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 1;
	width: 1.25em;
	height: 1.25em;
	margin: 0;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	opacity: 0;
	pointer-events: none;
	transform: translate(-50%, -50%);
	color: #fff;
	transition: opacity 0.15s ease;
}

.g-form-submit:has(.g2-btn--light) .g-form-submit__spinner,
.g-form-submit:has(.g2-btn--outline) .g-form-submit__spinner {
	color: #1a1a1a;
}

.wpcf7 form.submitting .g-form-submit .wpcf7-submit,
.wpcf7-submit.is-loading {
	pointer-events: none;
	cursor: wait;
	color: transparent !important;
	-webkit-text-fill-color: transparent;
	opacity: 0.85;
}

.wpcf7 form.submitting .g-form-submit__spinner,
.g-form-submit:has(.wpcf7-submit.is-loading) .g-form-submit__spinner {
	opacity: 1;
	animation: g-form-spin 0.65s linear infinite;
}

.wpcf7 form.submitting .g-form-submit .wpcf7-submit:hover,
.wpcf7-submit.is-loading:hover {
	opacity: 0.85;
}

@keyframes g-form-spin {
	to {
		transform: translate(-50%, -50%) rotate(360deg);
	}
}

/* --------------------------------------------------------------------------
   Успешная отправка — явный экран вместо полей формы
   -------------------------------------------------------------------------- */

.wpcf7-form.sent.g-form--success > *:not(.wpcf7-response-output):not(.screen-reader-response) {
	display: none !important;
}

.wpcf7-form.sent.g-form--success .wpcf7-response-output {
	display: flex !important;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	box-sizing: border-box;
	width: 100%;
	min-height: 220px;
	margin: 0;
	padding: 32px 24px;
	border: 1px solid rgba(0, 255, 255, 0.45);
	border-radius: 16px;
	background: rgba(0, 255, 255, 0.08);
	color: #fff;
	font-size: 15px;
	line-height: 145%;
	text-align: center;
	animation: g-form-success-in 0.35s ease;
}

.wpcf7-form.sent.g-form--success .wpcf7-response-output::before {
	content: '';
	display: block;
	width: 52px;
	height: 52px;
	margin-bottom: 4px;
	border-radius: 50%;
	background:
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M5 13l4 4L19 7' stroke='%231a1a1a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
		center / 26px 26px no-repeat,
		#00ffff;
	flex: none;
}

.wpcf7-form.sent.g-form--success .g-form-success__title {
	display: block;
	font-size: 22px;
	font-weight: 700;
	line-height: 120%;
	letter-spacing: -0.02em;
	color: #00ffff;
}

.wpcf7-form.sent.g-form--success .g-form-success__note {
	display: block;
	max-width: 280px;
	color: rgba(255, 255, 255, 0.72);
	font-size: 14px;
	line-height: 140%;
}

/* Светлые формы (партнёры и т.п.) */
.form .wpcf7-form.sent.g-form--success .wpcf7-response-output {
	border-color: #1a1a1a;
	background: #f4f4f4;
	color: #1a1a1a;
}

.form .wpcf7-form.sent.g-form--success .wpcf7-response-output::before {
	background:
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M5 13l4 4L19 7' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
		center / 26px 26px no-repeat,
		#1a1a1a;
}

.form .wpcf7-form.sent.g-form--success .g-form-success__title {
	color: #1a1a1a;
}

.form .wpcf7-form.sent.g-form--success .g-form-success__note {
	color: rgba(26, 26, 26, 0.65);
}

@keyframes g-form-success-in {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}
