/* ── RESET (scoped) ── */
.crm-form-card *,
.crm-form-card *::before,
.crm-form-card *::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

/* ── CARD ── */
.crm-form-card {
	font-family: 'Rubik';
	background: #ffffff;
	border-radius: 12px;
	box-shadow: 0 2px 12px rgba(0, 0, 0, .08), 0 0 0 1px rgba(0, 0, 0, .04);
	width: 100%;
	max-width: 480px;
	overflow: hidden;
	margin: 0 auto;
}

/* ── HEADER ── */
.crm-form-card .crm-form-header {
	background: linear-gradient(135deg, #fe8b39 0, #ffe9a2 100%);
	padding: 24px 28px 20px;
	display: flex;
	align-items: center;
	gap: 12px;
}

.crm-form-card .crm-form-header-icon {
	width: 36px;
	height: 36px;
	background: rgba(255, 255, 255, .25);
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.crm-form-card .crm-form-header-icon svg {
	width: 20px;
	height: 20px;
	fill: #fff;
}

.crm-form-card .crm-form-title {
	font-size: 17px;
	font-weight: 600;
	color: #ffffff;
	letter-spacing: -.2px;
}

.crm-form-card .crm-form-subtitle {
	font-size: 12px;
	color: rgba(255, 255, 255, .8);
	margin-top: 2px;
	font-weight: 400;
}

/* ── GLOBAL ERRORS ── */
.crm-form-errors-block {
	padding: 12px 28px;
	background: #fff8f7;
	border-bottom: 1px solid #fcd0cc;
	font-size: 13px;
	color: #e34234;
	line-height: 1.5;
}

/* ── BODY ── */
.crm-form-body {
	padding: 24px 28px 20px;
}

/* ── FIELD GROUP ── */
.crm-field-group {
	margin-bottom: 16px;
	position: relative;
}

.crm-field-label {
	display: block;
	font-size: 12px;
	font-weight: 500;
	color: #828d9a;
	margin-bottom: 5px;
	letter-spacing: .1px;
}

.crm-field-label .req {
	color: #e34234;
	margin-left: 2px;
}

/* ── INPUTS — переопределяем Bitrix-генерируемые стили ── */
.crm-form-card .crm-field-group input[type="text"],
.crm-form-card .crm-field-group input[type="tel"],
.crm-form-card .crm-field-group input[type="email"],
.crm-form-card .crm-field-group input[type="number"],
.crm-form-card .crm-field-group input[type="url"],
.crm-form-card .crm-field-group input[type="date"],
.crm-form-card .crm-field-group input.inputtext,
.crm-form-card .crm-field-group select,
.crm-form-card .crm-field-group .crm-input {
	display: block;
	width: 100%;
	font-family: 'Rubik';
	font-size: 14px;
	color: #1b2433;
	background: #f8fafc;
	border: 1.5px solid #dde2ea;
	border-radius: 8px;
	padding: 0 14px;
	height: 40px;
	outline: none;
	transition: border-color .15s, box-shadow .15s, background .15s;
	-webkit-appearance: none;
	appearance: none;
	box-shadow: none;
}

.crm-form-card .crm-field-group textarea,
.crm-form-card .crm-field-group textarea.inputtext {
	display: block;
	width: 100%;
	font-family: 'Rubik';
	font-size: 14px;
	color: #1b2433;
	background: #f8fafc;
	border: 1.5px solid #dde2ea;
	border-radius: 8px;
	padding: 10px 14px;
	min-height: 88px;
	outline: none;
	transition: border-color .15s, box-shadow .15s, background .15s;
	resize: vertical;
	line-height: 1.5;
	box-shadow: none;
}

.crm-form-card .crm-field-group input::placeholder,
.crm-form-card .crm-field-group textarea::placeholder {
	color: #b0bac6;
}

.crm-form-card .crm-field-group input:focus,
.crm-form-card .crm-field-group textarea:focus,
.crm-form-card .crm-field-group select:focus {
	border-color: #ffe199;
	background: #ffffff;
	box-shadow: 0 0 0 3px rgb(255 236 222);
	outline: none;
}

/* ── ERROR STATE ── */
.crm-field-group.has-error input,
.crm-field-group.has-error textarea,
.crm-field-group.has-error select {
	border-color: #e34234 !important;
	background: #fff8f7 !important;
}

.crm-field-group.has-error input:focus,
.crm-field-group.has-error textarea:focus,
.crm-field-group.has-error select:focus {
	box-shadow: 0 0 0 3px rgba(227, 66, 52, .12) !important;
}

.crm-field-error {
	font-size: 12px;
	color: #e34234;
	margin-top: 6px;
	line-height: 1.35;
	display: none;
}

.crm-field-group.has-error .crm-field-error {
	display: block !important;
}

/* ── CAPTCHA ── */
.crm-captcha-img {
	display: block;
	border-radius: 6px;
	margin-bottom: 8px;
	border: 1.5px solid #dde2ea;
}

/* ── REQUIRED SIGN NOTE ── */
.crm-required-note {
	font-size: 12px;
	color: #828d9a;
	padding: 8px 28px 0;
}

.crm-required-note span {
	color: #e34234;
}

/* ── DIVIDER ── */
.crm-divider {
	height: 1px;
	background: #edf0f4;
	margin: 4px 0 20px;
}

/* ── FOOTER ── */
.crm-form-footer {
	padding: 0 28px 24px;
}

/* ── SUBMIT BUTTON ── */
.crm-btn-submit {
	width: 100%;
	height: 44px;
	background: linear-gradient(89deg, #fe8b39 35%, #e5cd7e 100%);
	color: #ffffff;
	font-family: 'Rubik';
	font-size: 14px;
	font-weight: 600;
	letter-spacing: .1px;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	transition: opacity .15s, transform .1s, box-shadow .15s;
}

.crm-btn-submit:hover:not([disabled]) {
	opacity: .92;
	box-shadow: 0 4px 16px rgba(246, 176, 47, .45);
}

.crm-btn-submit:active:not([disabled]) {
	transform: scale(.985);
}

.crm-btn-submit[disabled] {
	opacity: .5;
	cursor: wait;
	pointer-events: none;
}

.crm-btn-submit .btn-icon {
	width: 16px;
	height: 16px;
	fill: #fff;
	flex-shrink: 0;
}

/* ── SUCCESS STATE ── */
/* Специфичность выше reset `.crm-form-card * { padding:0 }` */
.crm-form-card .crm-success {
	display: none;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 40px 28px;
	gap: 14px;
}

.crm-form-card .crm-success.visible {
	display: flex;
}

.crm-form-card .crm-success-icon {
	width: 56px;
	height: 56px;
	background: linear-gradient(135deg, #4cd964 0%, #35c14f 100%);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 16px rgba(76, 217, 100, .35);
	animation: crmPopIn .35s cubic-bezier(.175, .885, .32, 1.275);
}

.crm-form-card .crm-success-icon svg {
	width: 28px;
	height: 28px;
	stroke: #fff;
	stroke-width: 2.5;
	fill: none;
}

@keyframes crmPopIn {
	from {
		transform: scale(0);
		opacity: 0;
	}
	to {
		transform: scale(1);
		opacity: 1;
	}
}

.crm-form-card .crm-success h3 {
	font-size: 17px;
	font-weight: 600;
	color: #1b2433;
}

.crm-form-card .crm-success p {
	font-size: 13.5px;
	color: #828d9a;
	line-height: 1.6;
	max-width: 300px;
}

.crm-form-card .crm-success .crm-btn-again {
	margin-top: 10px;
	min-width: 180px;
}

/* Fancybox success: высота по карточке, slide не трогаем (иначе уезжает в угол) */
.fancybox-container .fancybox-content.en-fb-lead-success,
.fancybox-container .fancybox-content:has(.crm-success.visible),
.fancybox-container .fancybox-content:has(.crm-form-card .crm-success.visible),
.fancybox-container #callback_form.en-fb-lead-success,
.fancybox-container #callback_form:has(.crm-success.visible) {
	height: auto !important;
	max-height: 90vh !important;
	width: auto !important;
	max-width: min(480px, 92vw) !important;
	min-width: min(320px, 92vw) !important;
	overflow: visible !important;
	margin: 44px auto !important;
	background: transparent !important;
	padding: 0 !important;
}

.fancybox-container.en-fb-lead-success .crm-form-card,
.fancybox-container .crm-form-card:has(.crm-success.visible) {
	overflow: hidden;
	max-width: 480px;
	width: 100%;
	height: auto;
}

.fancybox-container .crm-form-card .crm-success.visible {
	display: flex !important;
}

.main-user-consent-request{
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 12px;
	color: #828d9a;
	line-height: 1.55;
}

.main-user-consent-request a{
	color: #f0ae5d;
	text-decoration: none;
	border-bottom: 1px solid rgb(241 175 95);
	transition: color .15s, border-color .15s;
}

.main-user-consent-request.has-error {
	color: #e34234;
}

.main-user-consent-request.has-error input[type="checkbox"] {
	outline: 2px solid #e34234;
	outline-offset: 2px;
}

.consent-field-error {
	display: none;
	color: #e34234;
	font-size: 12px;
	margin-top: 6px;
	line-height: 1.35;
}

/* Honeypot: скрыт от пользователя */
.testing_humanity_wrap,
.testing_humanity {
	position: absolute !important;
	left: -9999px !important;
	width: 1px !important;
	height: 1px !important;
	opacity: 0 !important;
	overflow: hidden !important;
	pointer-events: none !important;
}