/**
 * Shared Contact and Partner/Reseller form controls.
 * Component styles retain content layout, variant values, and response states.
 */

/* The Reseller field also carries this shared anti-spam class. */
.octops-contact-form__honeypot {
	height: 1px !important;
	left: -10000px !important;
	opacity: 0 !important;
	pointer-events: none !important;
	position: absolute !important;
	width: 1px !important;
}

.octops-contact-form,
.octops-partner-reseller-form {
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.octops-contact-form__fields,
.octops-partner-reseller-form__fields {
	display: grid;
	gap: var(--octops-grid-gap);
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.octops-contact-field,
.octops-partner-reseller-form__field {
	min-width: 0;
}

.octops-contact-field--full,
.octops-partner-reseller-form__field--full {
	grid-column: 1 / -1;
}

.octops-contact-field__label,
.octops-partner-reseller-form__label {
	font-family: var(--octops-font-body);
	font-size: 14px;
	font-weight: 500;
	letter-spacing: 0;
	line-height: 20px;
	text-transform: uppercase;
}

.octops-contact-field__required,
.octops-partner-reseller-form__required {
	font-size: 10px;
	line-height: 14px;
}

.octops-contact-control,
.octops-partner-reseller-form__control {
	-webkit-appearance: none;
	appearance: none;
	background: #ffffff;
	border: 1px solid #e4e4e7;
	border-radius: 8px;
	color: #27272a;
	display: block;
	font-family: var(--octops-font-body);
	font-size: 18px;
	font-weight: 400;
	height: 64px;
	letter-spacing: 0;
	line-height: 28px;
	outline: 0;
	padding: 17px 20px;
	transition: border-color 160ms ease,
		box-shadow 160ms ease,
		background-color 160ms ease;
	width: 100%;
}

.octops-contact-control::placeholder,
.octops-partner-reseller-form__control::placeholder {
	opacity: 1;
}

.octops-contact-control:hover,
.octops-partner-reseller-form__control:hover {
	border-color: #a1a1aa;
}

.octops-contact-control:focus,
.octops-contact-select.is-open .octops-contact-select__trigger,
.octops-partner-reseller-form__control:focus,
.octops-partner-reseller-form__select-wrap.is-open
.octops-partner-reseller-form__select-trigger {
	border-color: #3371f4;
	box-shadow: 0 0 0 1px rgba(51, 113, 244, 0.14);
}

html[data-theme="dark"] .octops-contact-control,
html[data-theme="dark"] .octops-partner-reseller-form__control {
	background: #0a111c;
	border-color: #27272a;
	color: #fafafa;
}

html[data-theme="dark"] .octops-contact-control::placeholder,
html[data-theme="dark"] .octops-contact-select__trigger:not(.has-value),
html[data-theme="dark"] .octops-partner-reseller-form__control::placeholder,
html[data-theme="dark"]
.octops-partner-reseller-form__select-trigger:not(.has-value) {
	color: #71717a;
}

html[data-theme="dark"] .octops-contact-control:hover,
html[data-theme="dark"] .octops-partner-reseller-form__control:hover {
	border-color: #52525b;
}

html[data-theme="dark"] .octops-contact-control:focus,
html[data-theme="dark"] .octops-contact-select.is-open .octops-contact-select__trigger,
html[data-theme="dark"] .octops-partner-reseller-form__control:focus,
html[data-theme="dark"] .octops-partner-reseller-form__select-wrap.is-open
.octops-partner-reseller-form__select-trigger {
	border-color: #76a0f8;
	box-shadow: 0 0 0 1px rgba(118, 160, 248, 0.18);
}

.octops-contact-control--textarea,
.octops-partner-reseller-form__textarea {
	height: auto;
	min-height: 188px;
	resize: vertical;
}

.octops-contact-select,
.octops-partner-reseller-form__select-wrap {
	position: relative;
}

.octops-contact-select:not(.is-enhanced)::after,
.octops-partner-reseller-form__select-wrap:not(.is-enhanced)::after {
	background: currentColor;
	content: "";
	height: 20px;
	pointer-events: none;
	position: absolute;
	right: 20px;
	top: 22px;
	-webkit-mask: url("../images/icons/chevron.svg") center / 8.5px 4.5px no-repeat;
	mask: url("../images/icons/chevron.svg") center / 8.5px 4.5px no-repeat;
	width: 20px;
}

.octops-contact-select__native,
.octops-partner-reseller-form__select {
	padding-right: 52px;
}

.octops-contact-select.is-enhanced .octops-contact-select__native,
.octops-partner-reseller-form__select-wrap.is-enhanced
.octops-partner-reseller-form__select {
	height: 1px;
	left: 0;
	opacity: 0;
	pointer-events: none;
	position: absolute;
	top: 0;
	width: 1px;
}

.octops-contact-select__trigger,
.octops-partner-reseller-form__select-trigger {
	align-items: center;
	cursor: pointer;
	display: flex;
	justify-content: space-between;
	text-align: left;
}

.octops-contact-select__trigger:not(.has-value),
.octops-partner-reseller-form__select-trigger:not(.has-value) {
	color: #a1a1aa;
}

.octops-contact-select__trigger svg,
.octops-partner-reseller-form__select-trigger svg {
	flex: 0 0 20px;
	height: 20px;
	transition: transform 160ms ease;
	width: 20px;
}

.octops-contact-select.is-open .octops-contact-select__trigger svg,
.octops-partner-reseller-form__select-wrap.is-open
.octops-partner-reseller-form__select-trigger svg {
	transform: rotate(180deg);
}

.octops-contact-select__menu,
.octops-partner-reseller-form__select-menu {
	background: #ffffff;
	border: 1px solid #e4e4e7;
	border-radius: 4px;
	box-shadow: 0 0 1px rgba(24, 24, 27, 0.3),
		0 8px 16px rgba(24, 24, 27, 0.1);
	display: flex;
	flex-direction: column;
	gap: 8px;
	left: 0;
	overscroll-behavior: contain;
	overflow-y: auto;
	padding: 4px;
	position: absolute;
	right: 0;
	top: calc(100% + 4px);
	z-index: 40;
}

.octops-contact-select.is-open-upward .octops-contact-select__menu,
.octops-partner-reseller-form__select-wrap.is-open-upward
.octops-partner-reseller-form__select-menu {
	bottom: calc(100% + 4px);
	top: auto;
}

html[data-theme="dark"] .octops-contact-select__menu,
html[data-theme="dark"] .octops-partner-reseller-form__select-menu {
	background: #0a111c;
	border-color: #27272a;
	box-shadow: 0 12px 28px rgba(0, 0, 0, 0.36);
}

.octops-contact-select__option,
.octops-partner-reseller-form__select-option {
	-webkit-appearance: none;
	appearance: none;
	background: transparent;
	border: 0;
	border-radius: 2px;
	color: #27272a;
	cursor: pointer;
	font-family: var(--octops-font-body);
	font-size: 14px;
	font-weight: 400;
	height: 32px;
	line-height: 20px;
	min-height: 32px;
	padding: 6px 8px;
	text-align: left;
	width: 100%;
}

.octops-contact-select__option.is-active,
.octops-contact-select__option:hover,
.octops-contact-select__option[aria-selected="true"],
.octops-partner-reseller-form__select-option.is-active,
.octops-partner-reseller-form__select-option:hover,
.octops-partner-reseller-form__select-option[aria-selected="true"] {
	background: #eff6ff;
	color: #173da6;
}

html[data-theme="dark"] .octops-contact-select__option,
html[data-theme="dark"] .octops-partner-reseller-form__select-option {
	color: #fafafa;
}

html[data-theme="dark"] .octops-contact-select__option.is-active,
html[data-theme="dark"] .octops-contact-select__option:hover,
html[data-theme="dark"] .octops-contact-select__option[aria-selected="true"],
html[data-theme="dark"] .octops-partner-reseller-form__select-option.is-active,
html[data-theme="dark"] .octops-partner-reseller-form__select-option:hover,
html[data-theme="dark"]
.octops-partner-reseller-form__select-option[aria-selected="true"] {
	background: rgba(46, 103, 222, 0.22);
	color: #a3cfff;
}

.octops-contact-field.is-invalid .octops-contact-control,
.octops-partner-reseller-form__field.is-invalid .octops-partner-reseller-form__control {
	box-shadow: none;
}

html[data-theme="dark"] .octops-contact-field.is-invalid .octops-contact-control,
html[data-theme="dark"]
.octops-partner-reseller-form__field.is-invalid
.octops-partner-reseller-form__control {
	border-color: #fca5a5;
}

.octops-contact-form__actions,
.octops-partner-reseller-form__actions {
	display: flex;
	justify-content: flex-end;
}

.octops-contact-form__submit,
.octops-partner-reseller-form__submit {
	-webkit-appearance: none;
	align-items: center;
	appearance: none;
	-webkit-backdrop-filter: blur(45.15px);
	backdrop-filter: blur(45.15px);
	background: linear-gradient(90deg, rgba(175, 206, 255, 0.05), rgba(255, 212, 150, 0.05)) padding-box;
	border: 2px solid #afceff;
	border-radius: 9999px;
	box-sizing: border-box;
	color: #222222;
	cursor: pointer;
	display: inline-flex;
	font-family: var(--octops-font-body);
	font-size: 16px;
	font-weight: 500;
	gap: 8px;
	height: 48px;
	justify-content: center;
	line-height: 24px;
	overflow: hidden;
	padding: 2px 20px;
	position: relative;
	transition: filter 160ms ease,
		transform 160ms ease,
		opacity 160ms ease;
	white-space: nowrap;
	width: max-content;
}

@supports ((-webkit-mask-composite: xor) or (mask-composite: exclude)) {
	.octops-contact-form__submit,
	.octops-partner-reseller-form__submit {
		border-color: transparent;
	}

	.octops-contact-form__submit::before,
	.octops-partner-reseller-form__submit::before {
		-webkit-mask: linear-gradient(#000 0 0) content-box,
			linear-gradient(#000 0 0);
		-webkit-mask-composite: xor;
		background: linear-gradient(90deg, #afceff, #ffd496);
		border-radius: inherit;
		content: "";
		inset: 0;
		mask: linear-gradient(#000 0 0) content-box,
			linear-gradient(#000 0 0);
		mask-composite: exclude;
		padding: 2px;
		pointer-events: none;
		position: absolute;
	}
}

html[data-theme="dark"] .octops-contact-form__submit,
html[data-theme="dark"] .octops-partner-reseller-form__submit {
	color: var(--octops-text);
}

.octops-contact-form__submit [data-contact-submit-label],
.octops-partner-reseller-form__submit [data-partner-submit-label] {
	flex: 1 1 auto;
	min-width: 0;
	white-space: nowrap;
}

.octops-contact-form__submit:hover:not(:disabled),
.octops-partner-reseller-form__submit:hover:not(:disabled) {
	filter: brightness(1.06);
}

.octops-contact-form__submit:active:not(:disabled),
.octops-partner-reseller-form__submit:active:not(:disabled) {
	transform: translateY(1px);
}

.octops-contact-form__submit:disabled,
.octops-partner-reseller-form__submit:disabled {
	cursor: wait;
	opacity: 0.72;
}

.octops-contact-form__submit-icon,
.octops-partner-reseller-form__submit-icon {
	background: currentColor;
	flex: 0 0 20px;
	height: 20px;
	-webkit-mask: url("../images/icons/asterisk.svg") center / 10.6603px 12px no-repeat;
	mask: url("../images/icons/asterisk.svg") center / 10.6603px 12px no-repeat;
	width: 20px;
}

@media (prefers-reduced-motion: no-preference) {
	.octops-contact-form__submit:not(:disabled):is(:hover, :focus-visible)
	.octops-contact-form__submit-icon,
	.octops-partner-reseller-form__submit:not(:disabled):is(:hover, :focus-visible)
	.octops-partner-reseller-form__submit-icon {
		animation: octops-button-asterisk-spin 520ms cubic-bezier(0.22, 1, 0.36, 1);
	}
}

.octops-contact-form__spinner,
.octops-partner-reseller-form__spinner {
	border: 2px solid color-mix(in srgb, currentColor 38%, transparent);
	border-radius: 50%;
	border-top-color: currentColor;
	display: none;
	flex: 0 0 20px;
	height: 20px;
	width: 20px;
}

.octops-contact-form.is-submitting .octops-contact-form__submit-icon,
.octops-partner-reseller-form.is-submitting .octops-partner-reseller-form__submit-icon {
	display: none;
}

.octops-contact-form.is-submitting .octops-contact-form__spinner,
.octops-partner-reseller-form.is-submitting .octops-partner-reseller-form__spinner {
	display: block;
}

@media (max-width: 640px) {
	.octops-contact-form__fields,
	.octops-partner-reseller-form__fields {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (forced-colors: active) {
	.octops-contact-form__submit,
	.octops-partner-reseller-form__submit {
		border-color: ButtonText;
	}

	.octops-contact-form__submit::before,
	.octops-partner-reseller-form__submit::before {
		display: none;
	}
}
