/* --- OTP Popup Overlay --- */
#otp-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

/* --- OTP Popup Container --- */
#otp-popup-container {
    background-color: #ffffff;
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    text-align: center;
    width: 90%;
    max-width: 420px;
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#otp-popup-container h2 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 24px;
    color: #333;
}

#otp-popup-container p {
    margin-bottom: 25px;
    color: #666;
    font-size: 16px;
    line-height: 1.5;
}

/* --- Close Button --- */
.otp-popup-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    color: #aaa;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}
.otp-popup-close:hover {
    color: #333;
}


/* --- OTP Input Fields --- */
.otp-input-fields {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.otp-input {
    width: 45px;
    height: 55px;
    font-size: 24px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 8px;
    transition: all 0.2s ease-in-out;
    -moz-appearance: textfield; /* Firefox */
}
.otp-input::-webkit-outer-spin-button,
.otp-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.otp-input:focus {
    border-color: #0073aa; /* WordPress blue */
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
    outline: none;
}

/* --- Messages and Buttons --- */
.otp-popup-message {
    min-height: 20px;
    margin-bottom: 20px;
    font-weight: 500;
}

#otp-verify-btn {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    background-color: #0073aa;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

#otp-verify-btn:hover:not(:disabled) {
    background-color: #005a87;
}

#otp-verify-btn:disabled {
    background-color: #a0a5aa;
    cursor: not-allowed;
    opacity: 0.7;
}

/* --- Resend Link and Timer --- */
.otp-resend-container {
    margin-top: 20px;
    font-size: 14px;
}

#resend-otp-link {
    color: #0073aa;
    text-decoration: none;
    font-weight: 500;
}
#resend-otp-link:hover {
    text-decoration: underline;
}
#resend-otp-link.disabled {
    color: #999;
    cursor: not-allowed;
    text-decoration: none;
}

#resend-otp-timer {
    color: #666;
}

/* --- Status Message on Form --- */
#otp-phone-status {
    margin-top: 8px;
    font-weight: 500;
}

.otp-input-fields input {
    padding: 15px 10px;
}

/* --- Spinner --- */
.otp-popup-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #0073aa;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* --- Responsive Design --- */
@media (max-width: 480px) {
    #otp-popup-container {
        padding: 25px 20px;
    }
    .otp-input {
        width: 38px;
        height: 50px;
        font-size: 20px;
    }
}
