.mia-otp-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, .55);
  z-index: 100000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.mia-otp-overlay.mia-otp-open,
.mia-otp-open .mia-otp-overlay {
  display: flex;
}

.mia-otp-open {
  display: flex;
}

.mia-otp-popup {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 16px;
  padding: 20px 20px 24px;
  box-shadow: 0 20px 50px rgba(17, 24, 39, .25);
  font-family: Arial, "Heebo", sans-serif;
  direction: rtl;
  text-align: right;
}

.mia-otp-hidden {
  display: none !important;
}

.mia-otp-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 18px;
}

.mia-otp-header-text {
  flex: 1;
  min-width: 0;
}

.mia-otp-back,
.mia-otp-close {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: none !important;
  background: transparent;
  color: #667085;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  border-radius: 50%;
}

.mia-otp-close {
  font-size: 20px;
  line-height: 1;
}

.mia-otp-back:hover,
.mia-otp-close:hover {
  background: #f2f4f7;
  color: #101828;
}

.mia-otp-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #101828;
}

.mia-otp-subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: #667085;
}

.mia-otp-step {
  display: none;
}

.mia-otp-step.mia-otp-step-active {
  display: block;
}

/* Step 1 — method rows */
.mia-otp-methods {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mia-otp-method-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border: 1px solid #e9edf3 !important;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  text-align: right;
}

.mia-otp-method-row:hover {
  border-color: #2f6fed !important;
  background: #f5f8ff;
}

.mia-otp-method-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  color: #fff;
}

.mia-otp-icon-sms {
  background: #2f6fed;
}

.mia-otp-icon-whatsapp {
  background: #25d366;
}

.mia-otp-icon-email {
  background: #6b7280;
}

.mia-otp-method-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mia-otp-method-title {
  font-weight: 700;
  font-size: 14px;
  color: #101828;
}

.mia-otp-method-subtitle {
  font-size: 12px;
  color: #667085;
}

.mia-otp-method-chevron {
  flex: 0 0 auto;
  color: #98a2b3;
  font-size: 13px;
}

/* Step 2 — destination input */
.mia-otp-input-wrap {
  position: relative;
  margin-bottom: 6px;
}

.mia-otp-input-icon {
  position: absolute !important;
  top: 50% !important;
  right: 14px !important;
  left: auto !important;
  transform: translateY(-50%) !important;
  color: #98a2b3 !important;
  font-size: 14px !important;
  pointer-events: none;
}

.mia-otp-destination-input {
  width: 100%;
  box-sizing: border-box !important;
  padding: 12px 40px 12px 14px !important;
  border: 1px solid #e9edf3 !important;
  border-radius: 10px;
  font-size: 14px;
}

.mia-otp-destination-input:focus {
  outline: none;
  border-color: #2f6fed !important;
}

.mia-otp-privacy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 10px 0 0;
  font-size: 12px;
  color: #98a2b3;
  text-align: center;
}

/* Buttons shared by steps 2 & 3 */
.mia-otp-send-btn,
.mia-otp-confirm-btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: #2f6fed;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
}

.mia-otp-send-btn:disabled,
.mia-otp-confirm-btn:disabled {
  background: #b9cdfb;
  cursor: default;
}

.mia-otp-resend-btn {
  width: 100%;
  padding: 8px;
  border: none;
  background: transparent;
  color: #2f6fed;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}

.mia-otp-resend-btn:disabled {
  color: #98a2b3;
  cursor: default;
}

/* Step 3 — code boxes */
.mia-otp-code-boxes {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
  direction: ltr;
}

.mia-otp-code-box {
  width: 46px;
  height: 54px;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  color: #101828;
  border: 1px solid #d0d5dd !important;
  border-radius: 10px;
  box-sizing: border-box;
}

.mia-otp-code-box:focus {
  outline: none;
  border-color: #2f6fed !important;
  box-shadow: 0 0 0 3px rgba(47, 111, 237, .15);
}

.mia-otp-code-box:disabled {
  background: #f2f4f7;
}

.mia-otp-resend-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0 0 4px;
  font-size: 13px;
  color: #667085;
  text-align: center;
}

.mia-otp-error {
  min-height: 18px;
  color: #d92d20;
  font-size: 12px;
  margin-bottom: 4px;
  text-align: center;
}
