/* ============================================================
   Phone Auth Widget (OTP-based login/register)
   Markup: Views/Shared/_PhoneAuthDialog.cshtml
   Logic:  Content/js/phone-auth.js
   ============================================================ */

/* intlTelInput overrides scoped to the dialog */
#PhoneAuthDialog .iti {
    width: 100%;
    direction: ltr;
    display: block;
}

#PhoneAuthDialog .iti input {
    width: 100%;
    padding-left: 90px !important;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    height: 48px;
    font-size: 15px;
}

#PhoneAuthDialog .iti input:focus {
    border-color: #999;
    outline: none;
    box-shadow: none;
}

#PhoneAuthDialog .iti .iti__flag-container {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    direction: ltr;
}

#PhoneAuthDialog .iti__country-list {
    z-index: 1060;
    max-height: 200px;
    overflow-y: auto;
    position: absolute;
}

#PhoneAuthDialog .modal-body,
#PhoneAuthDialog .modal-content {
    overflow: visible;
}

[dir="rtl"] #PhoneAuthDialog .close {
    right: auto;
    left: 15px;
}

/* Method selection cards (SMS / WhatsApp) */
.phoneauth-method-card {
    flex: 1;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 10px 12px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin: 0;
    background: #fff;
}

.phoneauth-method-card:hover {
    border-color: #ccc;
}

.phoneauth-method-card.selected {
    border-color: #D92228;
    background-color: #fef2f2;
}

.phoneauth-method-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.phoneauth-method-card.selected .phoneauth-method-icon-wrap {
    background: #fce4e4;
}

.phoneauth-method-icon {
    font-size: 18px;
    margin-left: unset;
    margin-right: unset;
}

.phoneauth-method-text {
    flex: 1;
    min-width: 0;
}

[dir="rtl"] .phoneauth-method-text {
    text-align: left;
}

[dir="ltr"] .phoneauth-method-text {
    text-align: right;
}

.phoneauth-method-title {
    font-weight: bold;
    font-size: 13px;
    color: #333;
    display: block;
}

.phoneauth-method-sub {
    font-size: 11px;
    color: #999;
    display: block;
}

.phoneauth-method-radio {
    width: 18px;
    height: 18px;
    border: 2px solid #ccc;
    border-radius: 50%;
    position: relative;
    display: inline-block;
    flex-shrink: 0;
}

.phoneauth-method-card.selected .phoneauth-method-radio {
    border-color: #D92228;
}

.phoneauth-method-card.selected .phoneauth-method-radio::after {
    content: '';
    width: 10px;
    height: 10px;
    background: #D92228;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* OTP inputs */
.phoneauth-otp-container {
    display: flex;
    justify-content: center;
    gap: 8px;
    direction: ltr;
}

.phoneauth-otp-input {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 22px;
    font-weight: bold;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    outline: none;
    transition: border-color 0.2s;
    background: #fff;
    color: #333;
    padding: 0;
    -moz-appearance: textfield;
}

.phoneauth-otp-input::-webkit-outer-spin-button,
.phoneauth-otp-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.phoneauth-otp-input:focus {
    border-color: #D92228;
    box-shadow: 0 0 0 3px rgba(217, 34, 40, 0.1);
}

.phoneauth-otp-input::placeholder {
    color: #ccc;
}

/* Smooth validation messages in popups */
.popup-validation {
    display: none;
    margin-top: 6px;
}

#PhoneAuth-general-error,
#PhoneAuth-otp-error {
    display: none;
    text-align: center;
}

/* Center captcha widgets inside the dialog */
#phoneAuthCaptchaDiv,
#phoneAuthResendCaptchaDiv {
    width: 100%;
    text-align: center;
}

#phoneAuthCaptchaWidget,
#phoneAuthResendCaptchaWidget {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

#phoneAuthCaptchaWidget > div,
#phoneAuthResendCaptchaWidget > div {
    margin: 0 auto;
}

@media (max-width: 480px) {
    #phoneAuthCaptchaWidget > div,
    #phoneAuthResendCaptchaWidget > div {
        transform: scale(0.84);
        -webkit-transform: scale(0.84);
        transform-origin: center top;
        -webkit-transform-origin: center top;
    }

    #phoneAuthCaptchaWidget,
    #phoneAuthResendCaptchaWidget {
        min-height: 70px;
    }
}

