.xtnd-otp-wrapper,
.xtnd-otp-wrapper * {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}

.otp-modal-overlay.xtnd-otp-wrapper {
  box-sizing: border-box;
}

.otp-modal-overlay.xtnd-otp-wrapper {
  display: none;
  position: fixed;
  z-index: 99999999;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.5);
  align-items: center;
  justify-content: center;
}
.otp-modal-overlay.xtnd-otp-wrapper.active { display: flex; }

/* Modal Container */
.xtnd-otp-wrapper .otp-modal {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 4px 32px rgba(0,0,0,0.18);
  max-width: 1000px;
  width: 98vw;
  display: flex;
  flex-direction: row;
  overflow: hidden;
  position: relative;
  padding: 0;
  max-height: 90vh;
  height: auto;
  overflow-y: auto;
}

/* Left/Right Columns */
.xtnd-otp-wrapper .otp-modal-left,
.xtnd-otp-wrapper .otp-modal-right {
  display: flex;
  flex-direction: column;
  min-width: 340px;
  padding: 32px 24px;
}
.xtnd-otp-wrapper .otp-modal-left {
  background: linear-gradient(135deg, var(--xtnd-gradient-start) 60%, var(--xtnd-gradient-end) 100%);
  color: #fff;
  flex: 1;
}
.xtnd-otp-wrapper .otp-modal-right {
  background: var(--xtnd-modal-bg);
  flex: 1.2;
  justify-content: center;
  min-width: 420px;
  padding: 32px 32px 24px 32px;
}

/* Shop Logo Styling */
.xtnd-otp-wrapper .otp-modal-left img,
.xtnd-otp-wrapper .otp-modal-logo {
  width: 50px;
  height: 50px;
  object-fit: contain;
  border-radius: 12px;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.1);
  padding: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
  display: block;
}
.xtnd-otp-wrapper .otp-modal-left img:hover,
.xtnd-otp-wrapper .otp-modal-logo:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  border-color: rgba(255, 255, 255, 0.3);
}

.xtnd-otp-wrapper .otp-modal-shop {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 24px;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.5px;
}

/* Close Button */
.xtnd-otp-wrapper .otp-modal-close {
  position: absolute;
  right: 24px;
  top: 24px;
  font-size: 32px;
  color: #000000bb;
  font-weight: bold;
  cursor: pointer;
  z-index: 2;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
}
[dir="rtl"] .otp-modal-close {
  right: unset !important;
  left: 24px !important;
}

/* Title, Description, Label */
.xtnd-otp-wrapper .otp-modal-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #000000ee;
}
.xtnd-otp-wrapper .otp-modal-desc {
  color: #00000090;
  font-size: 13px;
  margin-bottom: 24px;
}
.xtnd-otp-wrapper .otp-modal-label {
  display: block;
  margin-bottom: 8px;
  color: #000000cc;
  font-weight: 500;
  font-size: 13px;
}

/* Inputs and Buttons */
.xtnd-otp-wrapper .otp-modal-input {
  background-color: #ffffffaa;
  width: 100%;
  padding: 12px;
  border: 1px solid #00000030;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 18px;
  transition: border-color 0.2s;
  direction: ltr;
}

.xtnd-otp-wrapper .otp-modal-input::placeholder{
    color: #000000cc;
}

[dir="rtl"] .otp-modal-right .otp-modal-input {
  direction: rtl;
  text-align: right;
  padding-right: 12px;
  padding-left: 12px;
}

/* When user starts typing in RTL, switch to LTR for proper input */
[dir="rtl"] .otp-modal-right .otp-modal-input:not(:placeholder-shown) {
  direction: ltr;
  text-align: left;
}

/* Error state for input fields */
.xtnd-otp-wrapper .otp-modal-input.error {
  border-color: #dc3545;
  box-shadow: 0 0 0 1px #dc3545;
}

/* Input-specific error messages */
.xtnd-otp-wrapper .input-error-message {
  color: #dc3545;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  margin-top: 4px;
  line-height: 1.3;
}

/* RTL support for input error messages */
[dir="rtl"] .xtnd-otp-wrapper .input-error-message {
  text-align: right;
}

.xtnd-otp-wrapper .otp-modal-btn {
  background: var(--xtnd-button-color);
  color: #fff;
  padding: 14px 0;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  width: 100%;
  margin-bottom: 10px;
  transition: background 0.2s;
  display: block;
}
.xtnd-otp-wrapper .otp-modal-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.xtnd-otp-wrapper .otp-modal-btn-alt {
  background-color: rgba(0, 0, 0, 0.1);
  color: var(--xtnd-button-color);
  margin-top: 0;
}
[dir="rtl"] .xtnd-otp-wrapper .otp-modal-btn {
  direction: rtl;
  text-align: center;
}

/* Footer, Powered, Icons */
.xtnd-otp-wrapper .otp-modal-footer {
  margin-top: 18px;
  display: flex;
  gap: 18px;
  justify-content: center;
  color: #00000090;
  font-size: 13px;
  flex-wrap: wrap;
}
[dir="rtl"] .xtnd-otp-wrapper .otp-modal-footer {
  direction: rtl;
  text-align: center;
}
.xtnd-otp-wrapper .otp-modal-footer a {
  color: #000000bb;
  text-decoration: underline;
  margin: 0 4px;
}

.xtnd-otp-wrapper .otp-modal-powered,.xtnd-otp-wrapper .otp-modal-footer-secured{
    font-size: 10px;
}

.xtnd-otp-wrapper .otp-modal-powered a,
[dir="rtl"] .xtnd-otp-wrapper .otp-modal-powered a {
  margin: 0 4px;
  color: white;
  text-decoration: none;
}

/* Contact Info and Edit Button */
.xtnd-otp-wrapper .otp-contact-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.xtnd-otp-wrapper .otp-contact-display {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.xtnd-otp-wrapper .otp-contact-display .otp-sent-to-edit {
  display: flex;
  align-items: center;
  gap: 12px;
}

.xtnd-otp-wrapper .otp-sent-to-text {
  font-size: 13px;
  color: #666666;
  margin-right: 8px;
  font-weight: 500;
}

.xtnd-otp-wrapper .otp-contact-value {
  font-weight: 600;
  font-size: 13px;
  color: #000000bb;
  letter-spacing: 0.5px;
}

.xtnd-otp-wrapper .otp-edit-contact-btn {
  padding: 6px 18px;
  font-size: 13px;
  border-radius: 20px;
  border: none;
  background: #e4e5e7;
  color: #000000bb;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.xtnd-otp-wrapper .otp-edit-contact-btn:hover {
  background: #d1d2d6;
}

/* Security Features Section */
.xtnd-otp-wrapper .otp-modal-security {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.xtnd-otp-wrapper .otp-modal-security-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #fff;
}
.xtnd-otp-wrapper .otp-modal-security-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.xtnd-otp-wrapper .otp-modal-security-item {
  display: flex;
  align-items: center;
  gap: 10px;
}
.xtnd-otp-wrapper .otp-modal-security-icon {
  font-size: 20px;
  text-align: center;
}
.xtnd-otp-wrapper .otp-modal-security-text {
  font-size: 13px;
  color: #ffffffbb;
  line-height: 1.4;
}
[dir="rtl"] .xtnd-otp-wrapper .otp-modal-security-text {
  text-align: right;
}
[dir="rtl"] .xtnd-otp-wrapper .otp-modal-security-items {
  direction: rtl;
}
[dir="rtl"] .xtnd-otp-wrapper .otp-modal-security-icon {
  margin-left: 0;
  margin-right: 10px;
}

/* RTL Support for OTP Contact Display */
[dir="rtl"] .xtnd-otp-wrapper .otp-contact-display {
  flex-direction: row-reverse;
}

[dir="rtl"] .xtnd-otp-wrapper .otp-sent-to-text {
  margin-right: 0;
  margin-left: 8px;
}

/* RTL Support for Error and Success Messages */
[dir="rtl"] #otpErrorMessage,
[dir="rtl"] #otpSuccessMessage {
  text-align: right;
  direction: rtl;
}

.otp-modal-right .otp-input-group {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 20px;
    direction: ltr;
}

[dir="rtl"] .otp-modal-right .otp-digit-input {
  text-align: center !important;
}

/* Force LTR for OTP inputs regardless of language */
[dir="rtl"] .otp-modal-right .otp-input-group {
  direction: ltr;
}

.otp-modal-right .otp-digit-input {
    text-align: center;
    width: 50px;
    height: 60px;
    margin-bottom: 0;
    font-size: 20px;
    font-weight: 600;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    background: #fafbfc;
    color: #2c3e50;
    transition: all 0.3s ease;
    outline: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.otp-modal-right .otp-digit-input:focus {
    border-color: #232946;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(34, 41, 70, 0.1), 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.otp-modal-right .otp-digit-input:not(:placeholder-shown) {
    background: #ffffff;
    border-color: #232946;
    box-shadow: 0 2px 8px rgba(34, 41, 70, 0.15);
}

.otp-modal-right .otp-digit-input.error {
    border-color: #dc3545;
    background: #fff5f5;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2), 0 2px 8px rgba(220, 53, 69, 0.1);
}

.otp-modal-right .otp-digit-input.error:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.2), 0 4px 12px rgba(220, 53, 69, 0.1);
}

/* Hover effect */
.otp-digit-input:hover:not(:focus):not(.error) {
    border-color: #cbd5e0;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Responsive Styles */
@media (max-width: 767px) {
  .xtnd-otp-wrapper .otp-modal {
    flex-direction: column;
    max-width: 95vw;
    min-width: 0;
    width: 95vw;
    height: auto;
    max-height: 90vh;
    border-radius: 20px;
    box-shadow: 0 4px 32px rgba(0,0,0,0.18);
    padding: 0;
    margin: 20px;
  }
  .xtnd-otp-wrapper .otp-modal-left, .xtnd-otp-wrapper .otp-modal-right {
    min-width: 0;
    padding: 20px 16px 16px 16px;
  }
  .xtnd-otp-wrapper .otp-modal-left img,
  .xtnd-otp-wrapper .otp-modal-logo {
    width: 40px;
    height: 40px;
    margin-bottom: 16px;
    padding: 6px;
    border-radius: 10px;
  }
  .xtnd-otp-wrapper .otp-modal-shop {
    font-size: 16px;
    margin-bottom: 20px;
  }
  .xtnd-otp-wrapper .otp-modal-title {
    font-size: 16px;
    margin-bottom: 16px;
  }
  .xtnd-otp-wrapper .otp-modal-desc {
    font-size: 14px;
    margin-bottom: 18px;
  }
  .xtnd-otp-wrapper .otp-modal-label {
    font-size: 14px;
    margin-bottom: 6px;
  }
  .xtnd-otp-wrapper .otp-modal-input {
    font-size: 14px;
    margin-bottom: 14px;
  }
  .xtnd-otp-wrapper .otp-modal-btn {
    font-size: 14px;
    padding: 14px 0;
    margin-bottom: 12px;
  }
  .xtnd-otp-wrapper .otp-modal-close {
    right: 16px;
    top: 22px;
    font-size: 22px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 10;
  }
  [dir="rtl"] .otp-modal-close {
    right: unset !important;
    left: 16px !important;
  }
  .xtnd-otp-wrapper .otp-modal-footer {
    margin-top: 18px;
    gap: 10px;
    font-size: 12px;
    flex-wrap: wrap;
  }
  .xtnd-otp-wrapper .otp-modal-powered {
    display: none;
  }
  .xtnd-otp-wrapper .otp-modal-security {
    padding: 12px;
    margin-bottom: 16px;
  }
  .xtnd-otp-wrapper .otp-modal-security-title {
    font-size: 16px;
    margin-bottom: 8px;
  }
  .xtnd-otp-wrapper .otp-modal-security-items {
    gap: 6px;
  }
  .xtnd-otp-wrapper .otp-modal-security-item {
    gap: 6px;
  }
  .xtnd-otp-wrapper .otp-modal-security-icon {
    font-size: 18px;
  }
  .xtnd-otp-wrapper .otp-modal-security-text {
    font-size: 13px;
  }
  .otp-modal-right .otp-input-group {
    gap: 8px;
  }
  .otp-modal-right .otp-digit-input {
    width: 42px;
    height: 56px;
    font-size: 20px;
    border-radius: 10px;
    text-align: center;
  }
  .xtnd-otp-wrapper .otp-contact-display{
    flex-direction: column;
    align-items: start;
  }

  .xtnd-otp-wrapper .otp-contact-display .otp-sent-to-edit {
    width: 100%;
    justify-content: space-between;
  }
}

/* Success Animation Styles */
@keyframes xtndCheckmarkStroke {
  100% {
    stroke-dashoffset: 0;
  }
}

@keyframes xtndCheckmarkScale {
  0%, 100% {
    transform: none;
  }
  50% {
    transform: scale3d(1.1, 1.1, 1);
  }
}

@keyframes xtndCheckmarkFade {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

.xtnd-success-animation {
  display: none;
}

.xtnd-success-animation.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 40px 20px;
}

.xtnd-success-checkmark {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: block;
  stroke-width: 3;
  stroke: var(--xtnd-button-color);
  stroke-miterlimit: 10;
  box-shadow: inset 0px 0px 0px var(--xtnd-button-color);
  animation: xtndCheckmarkScale .3s ease-in-out .4s both, xtndCheckmarkFade .3s ease-in-out .4s both;
}

.xtnd-success-checkmark__circle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  stroke-width: 3;
  stroke-miterlimit: 10;
  stroke: var(--xtnd-button-color);
  fill: none;
  animation: xtndCheckmarkStroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.xtnd-success-checkmark__check {
  transform-origin: 50% 50%;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: xtndCheckmarkStroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

.xtnd-success-message {
  margin-top: 20px;
  font-size: 18px;
  font-weight: 600;
  color: #1A2236;
  text-align: center;
}

.xtnd-success-submessage {
  margin-top: 8px;
  font-size: 14px;
  color: #70788C;
  text-align: center;
}

/* --- END XTND OTP MODAL CLEAN, CONSOLIDATED STYLES --- */
