/* Clean Phone Field Styles - Visible Dial Code + Centered Text */

/* Base container */
.iti { 
  position: relative !important; 
  display: block !important;
  width: 100% !important;
}

/* Flag container - left side for RTL */
.iti__flag-container { 
  position: absolute !important; 
  left: 0 !important; 
  right: auto !important;
  top: 0 !important; 
  bottom: 0 !important; 
  z-index: 3 !important;
  display: flex !important;
  align-items: center !important;
}

/* Selected flag button */
.iti__selected-flag {
  display: flex !important;
  align-items: center !important;
  height: 100% !important;
  padding: 0 8px !important;
  cursor: pointer !important;
  background: rgba(248, 249, 250, 0.9) !important;
  border-radius: 8px 0 0 8px !important;
}

/* Flag icon */
.iti__flag {
  display: inline-block !important;
  width: 20px !important;
  height: 15px !important;
}

/* Arrow down */
.iti__arrow {
  display: inline-block !important;
  margin-left: 6px !important;
  border-left: 3px solid transparent !important;
  border-right: 3px solid transparent !important;
  border-top: 4px solid #555 !important;
}

/* Dial code display (+20, +1, etc.) */
.iti__selected-dial-code {
  margin-left: 6px !important;
  color: #333 !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  direction: ltr !important;
}

/* Input padding for flag container */
.iti--allow-dropdown input.iti__tel-input,
.iti--separate-dial-code input.iti__tel-input,
.iti input[type="tel"] { 
  padding-left: 90px !important; 
  text-align: center !important; 
  direction: ltr !important;
}

/* Country dropdown list - Fix text color */
.iti__country-list { 
  z-index: 10000;
  background: #fff !important;
  color: #000 !important;
}

.iti__country {
  color: #000 !important;
  background: #fff !important;
}

.iti__country:hover,
.iti__country.iti__highlight {
  background: #f0f0f0 !important;
  color: #000 !important;
}

.iti__country-name,
.iti__dial-code {
  color: #000 !important;
}

/* Ensure phone inputs are always centered and editable */
input[type="tel"],
input[name="phone_display"],
.iti input[type="tel"] {
  text-align: center !important;
  direction: ltr !important;
  unicode-bidi: plaintext !important;
  pointer-events: auto !important;
  -webkit-user-select: text !important;
  user-select: text !important;
  caret-color: auto !important;
}

/* Override RTL for phone inputs */
[dir="rtl"] input[type="tel"],
[dir="rtl"] input[name="phone_display"],
[dir="rtl"] .iti input[type="tel"] {
  text-align: center !important;
  direction: ltr !important;
  unicode-bidi: plaintext !important;
}

/* Modal compatibility */
.modal input[type="tel"],
.modal .iti input[type="tel"] {
  text-align: center !important;
  direction: ltr !important;
  pointer-events: auto !important;
}

/* Loading states */
.submit.is-loading,
button.submit.is-loading,
.btn-submit.is-loading {
  opacity: 0.7;
  pointer-events: none;
  position: relative;
}

.submit.is-loading::after,
button.submit.is-loading::after,
.btn-submit.is-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Error styling */
.phone-error {
  color: #cc0000;
  font-size: 12px;
  margin-top: 6px;
  display: none;
}

.phone-error.show {
  display: block;
}
