/* ========================================= 1. Phone Field
========================================= */

@font-face {
	font-family: 'Twemoji Country Flags';
	unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E0063, U+E0065, U+E0067, U+E006C, U+E006E, U+E0073-E0074, U+E0077, U+E007F;
	src: url('../fonts/twemoji-country-flags.woff2') format('woff2');
	font-display: swap;
}

.oforms-phone-field {
	position: relative;
	display: block;
	width: 100%;
	min-width: 0;
	--oforms-phone-control-height: 2.75rem;
	--oforms-phone-toggle-space: 2.75rem;
	--oforms-phone-status-space: 3rem;
	--oforms-phone-inline-gap: 0.0625rem;
}

.oforms-phone-field__toggle {
	position: absolute;
	left: 0;
	top: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 0.35rem;
	width: var(--oforms-phone-toggle-space);
	min-height: var(--oforms-phone-control-height);
	height: var(--oforms-phone-control-height);
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	cursor: pointer;
}

.oforms-phone-field__flag {
	font-family: 'Twemoji Country Flags', 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif;
	font-size: 1.25rem;
	line-height: 1;
}

.oforms-phone-field__chevron {
	font-size: 0.9rem;
	line-height: 1;
	opacity: 0.72;
}

.oforms-phone-field__status {
	position: absolute;
	right: 0.75rem;
	top: 0;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	height: var(--oforms-phone-control-height);
	font-size: 1.35rem;
	line-height: 1;
	color: #34c759;
	pointer-events: none;
}

.oforms-phone-field__message {
	font-size: 0.95rem;
	line-height: 1.35;
	color: var(--oforms-popup-field-error-text-color, #ffb3b3);
}

.oforms-phone-field__message:not(:empty) {
	display: block;
	margin-top: 0.625rem;
}

.oforms-phone-field__message:empty,
.oforms-phone-field__message[hidden] {
	display: none !important;
	margin-top: 0;
}

.oforms-phone-field input[data-oforms-phone-input] {
	display: block;
	width: 100%;
	box-sizing: border-box;
	min-width: 0;
	min-height: var(--oforms-phone-control-height);
	height: var(--oforms-phone-control-height);
	padding-left: calc(var(--oforms-phone-toggle-space) + var(--oforms-phone-inline-gap));
	padding-right: var(--oforms-phone-status-space);
}

.oforms-phone-field[data-oforms-phone-state='invalid'] input[data-oforms-phone-input] {
	border-color: var(--oforms-popup-field-error-border-color, #ff7d7d);
	background: var(--oforms-popup-field-error-bg-color, transparent);
}

.oforms-popup[data-vi-field-mode='line'] .oforms-phone-field input[data-oforms-phone-input] {
	padding-left: calc(var(--oforms-phone-toggle-space) + var(--oforms-phone-inline-gap)) !important;
	padding-right: var(--oforms-phone-status-space) !important;
}

.oforms-phone-field__dropdown {
	position: absolute;
	left: 0;
	right: 0;
	top: calc(var(--oforms-phone-control-height) + 0.75rem);
	z-index: 30;
	display: flex;
	flex-direction: column;
	max-height: min(22rem, 58vh);
	border: 1px solid rgba(15, 20, 28, 0.14);
	border-radius: 1.1rem;
	background: #fff;
	box-shadow: 0 18px 48px rgba(8, 12, 20, 0.18);
	color: #1d2630;
	overflow: hidden;
}

.oforms-phone-field__dropdown[hidden] {
	display: none;
}

.oforms-phone-field__search-row {
	border-bottom: 1px solid rgba(15, 20, 28, 0.08);
}

.oforms-phone-field__search {
	width: 100%;
	height: 3rem;
	min-height: 0;
	margin: 0;
	padding: 0 0.95rem;
	border: 0;
	border-bottom: 1px solid rgba(15, 20, 28, 0.14);
	border-radius: 0;
	appearance: none;
	-webkit-appearance: none;
	background: #fff;
	color: #1d2630;
	-webkit-text-fill-color: #1d2630;
	caret-color: #1d2630;
	font-family: inherit;
	font-size: 0.875rem;
	font-weight: inherit;
	line-height: 1.35;
	box-shadow: none;
	text-shadow: none;
	opacity: 1;
	outline: none;
}

.oforms-popup__field input.oforms-phone-field__search[type='search'],
.oforms-popup[data-vi-field-mode='line'] .oforms-popup__field input.oforms-phone-field__search[type='search'],
.oforms-popup[data-vi-field-mode='filled'] .oforms-popup__field input.oforms-phone-field__search[type='search'] {
	height: 3rem !important;
	padding: 0 0.95rem !important;
	border: 0 !important;
	border-bottom: 0 !important;
	border-radius: 0 !important;
	background: #fff !important;
	color: #1d2630 !important;
	-webkit-text-fill-color: #1d2630 !important;
	caret-color: #1d2630 !important;
	font-family: inherit !important;
	font-size: 0.875rem !important;
	font-weight: inherit !important;
	text-shadow: none !important;
	opacity: 1 !important;
	box-sizing: border-box;
}

.oforms-popup__field input.oforms-phone-field__search[type='search']:hover {
	border-bottom-color: rgba(15, 20, 28, 0.22) !important;
	background: #fff !important;
}

.oforms-popup__field input.oforms-phone-field__search[type='search']:focus {
	border-bottom-color: var(--oforms-popup-field-focus-border-color, #d2ac32) !important;
	background: #fff !important;
}

.oforms-popup__field input.oforms-phone-field__search[type='search']::placeholder,
.oforms-popup__field input.oforms-phone-field__search[type='search']::-webkit-input-placeholder,
.oforms-popup__field input.oforms-phone-field__search[type='search']::-moz-placeholder {
	color: #66717d !important;
	font-size: 0.875rem !important;
	opacity: 1 !important;
}

.oforms-phone-field__results {
	min-height: 0;
	overflow: auto;
}

.oforms-phone-field__empty {
	padding: 1rem;
	color: #66717d;
}

.oforms-phone-field__list {
	display: flex;
	flex-direction: column;
}

.oforms-phone-field__option {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 0.75rem;
	width: 100%;
	padding: 0.625rem 1rem;
	border: 0;
	background: #fff;
	color: inherit;
	text-align: left;
	cursor: pointer;
}

.oforms-phone-field__option:hover,
.oforms-phone-field__option:focus-visible,
.oforms-phone-field__option.is-active,
.oforms-phone-field__option.is-selected {
	background: rgba(15, 20, 28, 0.06);
}

.oforms-phone-field__option-flag {
	font-family: 'Twemoji Country Flags', 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif;
	font-size: 1.25rem;
	line-height: 1;
}

.oforms-phone-field__option-copy {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.oforms-phone-field__option-native {
	color: #66717d;
}

/* ========================================= 2. Desktop
========================================= */

@media (min-width: 768px) {
	.oforms-phone-field__dropdown {
		max-height: min(26rem, 65vh);
	}

	.oforms-phone-field__option {
		padding-left: 1rem;
		padding-right: 1rem;
	}
}
