/**
 * VX Toolkit — Phone Field decorator styles.
 *
 * intl-tel-input ships its own CSS (loaded as `vx-toolkit:intl-tel.css`,
 * a dep of this file). We only add:
 *   • Full-width `.iti` wrapper so the picker fills the form group.
 *   • Transparent background on the dial-code chip (Voxel's wrapper
 *     applies a background to children, which competes with the chip's
 *     own styling).
 *   • z-index lift for the dropdown content inside Voxel popup dialogs.
 *   • WhatsApp link styling.
 *
 * Selectors deliberately target generic intl-tel-input classes (NOT a
 * `.vx-toolkit-phone-field` wrapper) because we don't modify Voxel's
 * template — we just decorate `<input type="tel">` directly.
 */

/* The inline `.iti` wrapper around the <input> should fill its form
 * group. We exclude `.iti--container` (the teleported dropdown) so it
 * doesn't stretch to 100% of <body>. */
.iti:not(.iti--container) {
	width: 100% !important;
}

.iti--separate-dial-code .iti__selected-country {
	background-color: transparent !important;
}

/* ============================================================
 *  Teleported country dropdown (`dropdownContainer: document.body`)
 *
 *  intl-tel-input appends a `.iti.iti--container` div to <body>.
 *  We need:
 *    1. z-index above the dialog (500000) so it paints on top
 *    2. Reasonable max-width so it doesn't span the full viewport
 *    3. Polished visual treatment (shadow, border-radius)
 * ============================================================ */
.iti--container {
	z-index: 500002 !important;
}

.iti--container .iti__dropdown-content {
	max-width: 360px;
	border-radius: 10px;
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18),
	            0 2px 8px  rgba(0, 0, 0, 0.08);
	border: 1px solid rgba(0, 0, 0, 0.08);
	overflow: hidden;
}

.iti--container .iti__search-input {
	border-radius: 6px;
	border: 1px solid #d1d5db;
	padding: 8px 12px;
	font-size: 14px;
	margin: 8px;
	width: calc(100% - 16px);
	box-sizing: border-box;
}

.iti--container .iti__search-input:focus {
	outline: none;
	border-color: #2563eb;
	box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.iti--container .iti__country-list {
	max-height: 260px;
}

.iti--container .iti__country {
	padding: 8px 12px;
	transition: background-color 0.1s ease;
}

.iti--container .iti__country:hover,
.iti--container .iti__country--highlight {
	background-color: #f3f4f6;
}

/* WhatsApp helper link rendered by phone-field.js next to the input. */
.vx-toolkit-phone-field__whatsapp {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: 8px;
	padding: 4px 0;
	font-size: 13px;
	color: #25D366;
	text-decoration: none;
	transition: opacity 0.15s ease;
}

.vx-toolkit-phone-field__whatsapp:hover {
	opacity: 0.85;
	text-decoration: underline;
}

.vx-toolkit-phone-field__whatsapp::before {
	content: "";
	display: inline-block;
	width: 14px;
	height: 14px;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2325D366'><path d='M17.5 14.4c-.3-.1-1.7-.8-1.9-.9-.3-.1-.4-.1-.6.1-.2.3-.7.9-.8 1-.2.2-.3.2-.6.1-1.7-.8-2.8-1.5-3.9-3.4-.3-.5.3-.5.8-1.5.1-.2 0-.3 0-.5s-.6-1.4-.8-2c-.2-.5-.4-.4-.6-.4h-.5c-.2 0-.5.1-.7.4-.2.3-.9.9-.9 2.2s1 2.6 1.1 2.8c.1.2 1.9 2.9 4.6 4.1.6.3 1.1.4 1.5.5.6.2 1.2.2 1.6.1.5-.1 1.7-.7 1.9-1.3.2-.7.2-1.2.2-1.3-.1-.1-.3-.2-.6-.3zM12 2C6.5 2 2 6.5 2 12c0 1.9.5 3.7 1.5 5.3L2 22l4.8-1.5c1.5.8 3.3 1.3 5.2 1.3 5.5 0 10-4.5 10-10S17.5 2 12 2zm0 18.2c-1.7 0-3.4-.5-4.8-1.4l-.3-.2-3 1 .9-2.9-.2-.3C3.5 15.1 3 13.6 3 12c0-5 4-9 9-9s9 4 9 9-4 9.2-9 9.2z'/></svg>");
	background-repeat: no-repeat;
	background-size: contain;
}
