/**
 * Floating underline fields — parity with SilverSite .sst-field.
 *
 * Idle: label on the line (14px / #6b6b6b).
 * Focus: label → 11px red heading; red 2px underline expands.
 * Filled: label stays 11px above (grey unless focused).
 */

.triumph-float {
	display: block;
	position: relative;
	padding: 20px 0 0;
	margin: 0 0 20px;
	pointer-events: none;
	/* Error text appears under the underline when .is-invalid */
}

.triumph-float__input,
.triumph-float input[type='text'],
.triumph-float input[type='email'],
.triumph-float input[type='tel'],
.triumph-float input[type='password'],
.triumph-float textarea {
	pointer-events: auto;
	display: block;
	width: 100%;
	max-width: 100%;
	min-width: 100%;
	box-sizing: border-box;
	margin: 0;
	padding: 5px 0 !important;
	min-height: 30px;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	outline: none !important;
	color: transparent;
	font-family: inherit;
	font-size: 14px;
	line-height: 20px;
	caret-color: #404040;
}

.triumph-float textarea {
	min-height: 60px;
	resize: vertical;
}

.triumph-float__input:focus,
.triumph-float__input.is-dirty,
.triumph-float input:focus,
.triumph-float input.is-dirty,
.triumph-float textarea:focus,
.triumph-float textarea.is-dirty,
.triumph-float__input:not(:placeholder-shown),
.triumph-float input:not(:placeholder-shown),
.triumph-float textarea:not(:placeholder-shown) {
	color: #404040;
}

.triumph-float__label {
	position: absolute;
	display: block;
	top: 20px;
	left: 0;
	right: 0;
	margin: 0;
	padding: 0;
	font-size: 14px;
	font-weight: 400;
	line-height: 30px;
	color: #6b6b6b;
	pointer-events: none;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: font 0.15s, top 0.15s, color 0.15s, line-height 0.15s;
	user-select: none;
}

.triumph-float__label .required,
.triumph-float__label .optional,
.triumph-float__label .triumph-float__req {
	font-weight: 400;
	color: inherit;
	border: 0 !important;
	text-decoration: none !important;
}

.triumph-float__hr {
	display: block;
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	height: 0;
	border: 0;
	border-top: 1px solid #6b6b6b;
	z-index: 0;
	pointer-events: none;
	transition: bottom 0.1s;
}

.triumph-float__hr::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 50%;
	width: 0;
	border-top: 2px solid #f23f3f;
	transition: left 0.15s, width 0.15s;
	z-index: 1;
}

/* Floated label: focus or has value */
.triumph-float:focus-within .triumph-float__label,
.triumph-float.is-dirty .triumph-float__label,
.triumph-float__input:focus ~ .triumph-float__label,
.triumph-float__input.is-dirty ~ .triumph-float__label,
.triumph-float__input:not(:placeholder-shown) ~ .triumph-float__label,
.triumph-float input:focus ~ .triumph-float__label,
.triumph-float input.is-dirty ~ .triumph-float__label,
.triumph-float input:not(:placeholder-shown) ~ .triumph-float__label,
.triumph-float textarea:focus ~ .triumph-float__label,
.triumph-float textarea.is-dirty ~ .triumph-float__label,
.triumph-float textarea:not(:placeholder-shown) ~ .triumph-float__label {
	top: 0;
	font-size: 11px;
	line-height: 20px;
}

.triumph-float:focus-within .triumph-float__label,
.triumph-float__input:focus ~ .triumph-float__label,
.triumph-float input:focus ~ .triumph-float__label,
.triumph-float textarea:focus ~ .triumph-float__label {
	color: #f23f3f;
}

.triumph-float:focus-within .triumph-float__hr::after,
.triumph-float__input:focus ~ .triumph-float__hr::after,
.triumph-float input:focus ~ .triumph-float__hr::after,
.triumph-float textarea:focus ~ .triumph-float__hr::after {
	left: 0;
	width: 100%;
}

/* Long-dash red link (Напомнить пароль / Я вспомнил пароль) */
.triumph-dash-link {
	display: inline-block;
	color: #f23f3f !important;
	font-size: 14px;
	line-height: 20px;
	text-decoration: none !important;
	border: 0 !important;
	background-image: linear-gradient(
		to right,
		currentColor 0,
		currentColor 8px,
		transparent 8px,
		transparent 18px
	);
	background-position: 0 100%;
	background-size: 18px 1px;
	background-repeat: repeat-x;
	padding-bottom: 2px;
	cursor: pointer;
}

.triumph-dash-link:hover,
.triumph-dash-link:focus {
	opacity: 0.9;
	color: #f23f3f !important;
}

button.triumph-dash-link {
	appearance: none;
	background-color: transparent;
	font: inherit;
	text-align: left;
}

/* Invalid / empty required — эталон «Заполните поле» */
.triumph-float__error {
	display: none;
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	margin: 0;
	padding: 0;
	font-size: 11px;
	line-height: 14px;
	color: #f23f3f;
	pointer-events: none;
}

.triumph-float.is-invalid,
.woocommerce-invalid .triumph-float {
	padding-bottom: 16px;
}

.triumph-float.is-invalid .triumph-float__hr,
.woocommerce-invalid .triumph-float__hr {
	bottom: 16px;
	border-top-color: #f23f3f;
}

.triumph-float.is-invalid .triumph-float__error,
.woocommerce-invalid .triumph-float__error {
	display: block;
}

.triumph-float.is-invalid .triumph-float__label,
.woocommerce-invalid .triumph-float__label {
	top: 0;
	font-size: 11px;
	line-height: 20px;
	color: #f23f3f;
}

.triumph-float.is-invalid .triumph-float__hr::after,
.woocommerce-invalid .triumph-float__hr::after {
	left: 0;
	width: 100%;
}

/* Result after lead submit */
.triumph-lead-result-modal {
	z-index: 1100;
}

.triumph-lead-result-modal__panel.triumph-modal__panel,
.triumph-lead-result-modal__panel {
	width: 520px;
	max-width: calc(100vw - 40px);
	margin: 18vh auto;
	padding: 28px 32px 28px;
	border-radius: 0;
	text-align: left;
}

.triumph-lead-result-modal .triumph-modal__title {
	margin: 0 40px 12px 0;
	font-size: 21px;
	font-weight: 400;
	line-height: 25px;
	color: #404040;
}

.triumph-lead-result-modal.is-error .triumph-lead-result-modal__error .triumph-modal__title {
	color: #991b1b;
}

.triumph-lead-result-modal__text {
	margin: 0 0 24px;
	font-size: 16px;
	line-height: 24px;
	color: #404040;
}

.triumph-lead-result-modal__actions {
	margin: 0;
	text-align: right;
}

/* Lead modals (phone order / callback) */
.triumph-lead-modal__panel.triumph-modal__panel,
.triumph-lead-modal__panel {
	width: 775px;
	max-width: calc(100vw - 40px);
	margin: 12vh auto;
	padding: 25px 30px 30px;
	border-radius: 0;
}

.triumph-lead-modal__title,
.triumph-lead-modal .triumph-modal__title {
	margin: 0 50px 15px 0;
	font-size: 21px;
	font-weight: 400;
	line-height: 25px;
	color: #404040;
}

.triumph-lead-modal__hint {
	margin: 20px 0 10px;
	font-size: 17px;
	line-height: 24px;
	color: #404040;
}

.triumph-float--half {
	max-width: 50%;
}

.triumph-lead-modal .triumph-form-field--consent {
	margin: 10px 0 20px;
}

/* Consent: checkbox left of text; text black, link red; checked = red fill */
.triumph-consent,
label.triumph-consent,
.triumph-form-field--consent label.triumph-consent,
.triumph-form-field--consent .triumph-consent {
	display: flex !important;
	align-items: flex-start;
	gap: 12px;
	max-width: 100%;
	margin: 0 !important;
	font-size: 12px;
	line-height: 16px;
	font-weight: 400 !important;
	color: #404040;
	cursor: pointer;
	position: relative;
}

.triumph-consent__text {
	flex: 1 1 auto;
	min-width: 0;
	order: 2;
	color: #404040;
}

.triumph-consent__text a {
	color: #f23f3f !important;
	text-decoration: none;
}

.triumph-consent input[type='checkbox'],
.triumph-form-field--consent .triumph-consent input[type='checkbox'] {
	position: absolute !important;
	opacity: 0 !important;
	width: 1px !important;
	height: 1px !important;
	max-width: 1px !important;
	margin: 0 !important;
	padding: 0 !important;
	pointer-events: none;
}

.triumph-consent__box {
	order: 1;
	flex: 0 0 22px;
	width: 22px !important;
	min-width: 22px !important;
	max-width: 22px !important;
	height: 22px !important;
	min-height: 22px !important;
	margin: 0 !important;
	box-sizing: border-box;
	border: 2px solid #c3c3c3;
	border-radius: 2px;
	background: #fff;
	position: relative;
	pointer-events: none;
	align-self: flex-start;
}

.triumph-consent input[type='checkbox']:checked + .triumph-consent__box {
	border-color: #f23f3f;
	background: #f23f3f;
}

/* Consent left unchecked on submit: red box (lead forms — .is-invalid, checkout — WooCommerce row class). */
.triumph-consent.is-invalid .triumph-consent__box,
.woocommerce-invalid .triumph-consent__box {
	border-color: #f23f3f;
}

.triumph-consent input[type='checkbox']:checked + .triumph-consent__box::after {
	content: '';
	position: absolute;
	left: 6px;
	top: 2px;
	width: 6px;
	height: 11px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.triumph-consent--checkout {
	width: auto;
	max-width: none;
	align-items: center;
	flex-wrap: nowrap;
}

.triumph-consent--checkout .triumph-consent__text {
	flex: 0 1 auto;
	white-space: nowrap;
	font-size: 12px;
	line-height: 16px;
	color: #404040;
}

.triumph-consent--modal {
	width: 100%;
	max-width: 420px;
	align-items: center;
}

.triumph-consent--inline {
	align-items: center;
	font-size: 14px;
	line-height: 20px;
	max-width: none;
}

.triumph-consent--inline .triumph-consent__text {
	flex: 0 1 auto;
	color: #404040;
}

.triumph-form-actions--end {
	display: flex;
	justify-content: flex-end;
	margin: 0;
}

.triumph-form-actions--center {
	display: flex;
	justify-content: center;
	margin: 0;
}

.triumph-form-actions--end .triumph-btn,
.triumph-form-actions--center .triumph-btn {
	min-height: 30px !important;
	height: 30px !important;
	padding: 0 20px !important;
	font-size: 14px !important;
	line-height: 30px !important;
	border-radius: 2px !important;
}

@media (max-width: 879px) {
	.triumph-float--half {
		max-width: 100%;
	}

	.triumph-lead-modal__panel {
		width: auto;
	}
}
