/* Clean Phone Field Styles - Visible Dial Code + Centered Text */

.iti { position: relative; }
.iti__flag-container { position: absolute; left: 0; top: 0; bottom: 0; width: 56px; z-index: 3; }
.iti--allow-dropdown input.iti__tel-input,
.iti--separate-dial-code input.iti__tel-input { padding-left: 62px; text-align: center !important; }
.iti__country-list { z-index: 10000; }

/* 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;
  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;
}
