.amadeo-form { box-sizing: border-box; }
.amadeo-form *, .amadeo-form *::before, .amadeo-form *::after { box-sizing: inherit; }
.amadeo-field-help { display: block; font-size: 12px; color: #666; margin-top: 4px; }
.amadeo-required { color: #d63638; }
.amadeo-radio-label, .amadeo-checkbox-label, .amadeo-consent-label { display: block; margin-bottom: 6px; }
.amadeo-form-message { border-radius: 4px; }
.amadeo-form.is-disabled { opacity: 0.6; pointer-events: none; }
.amadeo-field-input.amadeo-invalid, .amadeo-field-textarea.amadeo-invalid, .amadeo-field-select.amadeo-invalid { border-color: #d63638 !important; }
.amadeo-submit-btn:disabled { opacity: 0.7; cursor: not-allowed; }

.amadeo-phone-wrap {
	position: relative;
	display: block;
	width: 100%;
}
.amadeo-phone-wrap .amadeo-phone-local {
	width: 100%;
}
.amadeo-phone-wrap .amadeo-phone-cc {
	position: absolute;
	left: 0;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2;
	width: auto;
	min-width: 0;
	height: auto;
	margin: 0;
	padding: 0 10px 0 20px !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	background-image: none !important;
	box-shadow: none !important;
	color: #8a8a8a !important;
	font: inherit;
	font-weight: 400 !important;
	text-align: left;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
}
.amadeo-phone-wrap .amadeo-phone-cc::-ms-expand {
	display: none;
}
.amadeo-phone-wrap .amadeo-phone-cc:focus {
	outline: none;
}

/*
 * Custom calling-code menu. The native <select> stays in the form for submit
 * and is hidden once .amadeo-phone-cc--ready is set. Colors come from CSS
 * variables painted from the phone input so the list follows the landing.
 */
.amadeo-form .amadeo-phone-wrap.amadeo-phone-cc--ready > .amadeo-phone-cc {
	position: absolute !important;
	left: 0 !important;
	top: 0 !important;
	width: 1px !important;
	height: 1px !important;
	min-width: 0 !important;
	min-height: 0 !important;
	max-width: 1px !important;
	max-height: 1px !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	opacity: 0 !important;
	overflow: hidden !important;
	pointer-events: none !important;
	appearance: none !important;
	-webkit-appearance: none !important;
	box-shadow: none !important;
	background: transparent !important;
	color: transparent !important;
	z-index: 0 !important;
}

.amadeo-phone-wrap .amadeo-phone-cc-ui {
	position: absolute;
	left: 0;
	top: 0;
	height: 100%;
	z-index: 6 !important;
	display: flex;
	align-items: stretch;
}

.amadeo-phone-wrap .amadeo-phone-cc-ui__trigger {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: flex-start !important;
	gap: 8px !important;
	width: auto !important;
	max-width: none !important;
	height: 100% !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 10px 0 12px !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	background-image: none !important;
	box-shadow: none !important;
	color: var(--amadeo-cc-color, inherit) !important;
	font-family: var(--amadeo-cc-font, inherit) !important;
	font-size: var(--amadeo-cc-size, 16px) !important;
	font-weight: 500 !important;
	line-height: 1 !important;
	letter-spacing: normal !important;
	text-transform: none !important;
	text-decoration: none !important;
	white-space: nowrap !important;
	cursor: pointer !important;
	appearance: none !important;
	-webkit-appearance: none !important;
}

.amadeo-phone-wrap .amadeo-phone-cc-ui__trigger:focus-visible {
	outline: 2px solid var(--amadeo-cc-border, currentColor);
	outline-offset: -2px;
}

.amadeo-phone-cc-ui__flag {
	display: block !important;
	width: 20px !important;
	height: 15px !important;
	max-width: 20px !important;
	flex: 0 0 20px;
	object-fit: cover;
	border-radius: 2px;
	box-shadow: 0 0 0 1px color-mix(in srgb, var(--amadeo-cc-color, #222) 28%, transparent);
}

.amadeo-phone-cc-ui__iso {
	font-weight: 600;
	letter-spacing: 0.02em;
}

.amadeo-phone-cc-ui__dial {
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.amadeo-phone-cc-ui__rule {
	display: block;
	width: 1px;
	height: 18px;
	flex: 0 0 1px;
	margin-left: 2px;
	background: currentColor;
	opacity: 0.28;
}

.amadeo-phone-cc-ui__chevron {
	display: block;
	width: 7px;
	height: 7px;
	flex: 0 0 7px;
	margin-left: 2px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: translateY(-2px) rotate(45deg);
	opacity: 0.85;
}

.amadeo-phone-cc-ui.is-open .amadeo-phone-cc-ui__chevron {
	transform: translateY(1px) rotate(225deg);
}

.amadeo-phone-cc-ui__menu {
	display: none;
	position: fixed;
	z-index: 100000 !important;
	box-sizing: border-box;
	margin: 0;
	padding: 6px 0;
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
	background: var(--amadeo-cc-bg, #fff) !important;
	color: var(--amadeo-cc-color, #222) !important;
	border: 1px solid var(--amadeo-cc-border, #ccc) !important;
	border-radius: var(--amadeo-cc-radius, 8px) !important;
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22) !important;
	font-family: var(--amadeo-cc-font, inherit);
	font-size: 14px;
	line-height: 1.3;
}

.amadeo-phone-cc-ui__menu.is-open {
	display: block;
}

.amadeo-phone-cc-ui__search {
	display: block !important;
	box-sizing: border-box !important;
	width: calc(100% - 16px) !important;
	max-width: none !important;
	height: auto !important;
	min-height: 0 !important;
	margin: 6px 8px 8px !important;
	padding: 8px 10px !important;
	border: 1px solid var(--amadeo-cc-border, #ccc) !important;
	border-radius: 6px !important;
	background: var(--amadeo-cc-bg, #fff) !important;
	background-image: none !important;
	box-shadow: none !important;
	color: var(--amadeo-cc-color, #222) !important;
	font-family: var(--amadeo-cc-font, inherit) !important;
	font-size: 14px !important;
	font-weight: 400 !important;
	line-height: 1.3 !important;
	appearance: none !important;
}

.amadeo-phone-cc-ui__search::placeholder {
	color: var(--amadeo-cc-color, #222);
	opacity: 0.55;
}

.amadeo-phone-cc-ui__search:focus {
	outline: 1px solid var(--amadeo-cc-border, currentColor);
	outline-offset: 0;
}

.amadeo-phone-cc-ui__empty {
	margin: 0;
	padding: 12px 14px;
	opacity: 0.75;
}

.amadeo-phone-cc-ui__option {
	display: flex !important;
	align-items: center !important;
	justify-content: flex-start !important;
	gap: 10px !important;
	width: 100% !important;
	max-width: none !important;
	min-height: 40px !important;
	height: auto !important;
	margin: 0 !important;
	padding: 8px 14px !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	background-image: none !important;
	box-shadow: none !important;
	color: var(--amadeo-cc-color, #222) !important;
	font-family: var(--amadeo-cc-font, inherit) !important;
	font-size: 14px !important;
	font-weight: 400 !important;
	line-height: 1.2 !important;
	letter-spacing: normal !important;
	text-align: left !important;
	text-transform: none !important;
	text-decoration: none !important;
	cursor: pointer !important;
	appearance: none !important;
}

.amadeo-phone-cc-ui__option[hidden],
.amadeo-phone-cc-ui__empty[hidden] {
	display: none !important;
}

.amadeo-phone-cc-ui__option:hover,
.amadeo-phone-cc-ui__option:focus,
.amadeo-phone-cc-ui__option.is-current {
	background: var(--amadeo-cc-hover, rgba(0, 0, 0, 0.06)) !important;
	color: var(--amadeo-cc-color, #222) !important;
	outline: none;
}

.amadeo-phone-cc-ui__option.is-selected {
	background: var(--amadeo-cc-active, rgba(0, 0, 0, 0.08)) !important;
	box-shadow: inset 3px 0 0 var(--amadeo-cc-border, currentColor) !important;
	font-weight: 600 !important;
}

.amadeo-phone-cc-ui__option .amadeo-phone-cc-ui__dial {
	flex: 0 0 auto;
	min-width: 3.4em;
}

.amadeo-phone-cc-ui__name {
	flex: 1 1 auto;
	min-width: 0;
	margin-left: auto;
	text-align: right;
	opacity: 0.72;
}

.amadeo-phone-cc-ui__option.is-selected .amadeo-phone-cc-ui__name {
	opacity: 0.95;
}
