/* Kalame Auth — OTP login popup styles (ported from ithome) */

.kalame-auth-popup.w_popup {
    display: none;
    background-color: rgba(0, 0, 0, 0.35);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    font-family: inherit;
    direction: rtl;
}

.kalame-auth-popup .w_popup-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
}

.kalame-auth-popup .w_popup-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 96%;
    max-height: 80%;
}

.kalame-auth-popup .w_popup-inner > .w_popup-section {
    background-color: #fff;
    border-radius: 12px;
    padding: 24px;
    min-width: 270px;
    max-height: 100%;
    overflow: auto;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.kalame-auth-popup .w_popup-close {
    position: absolute;
    left: 10px;
    top: 6px;
    font-size: 2.5rem;
    width: 32px;
    height: 32px;
    line-height: 1;
    font-weight: 300;
    color: #888;
    z-index: 200;
    cursor: pointer;
}

.kalame-auth-popup.w_auth-popup .w_popup-wrapper,
.kalame-auth-popup.full-screen .w_popup-wrapper {
    width: 100%;
    height: 100%;
    background: #fff;
}

.kalame-auth-popup .w_popup-inner.full-screen {
    max-width: 100%;
    max-height: 100%;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.kalame-auth-popup .w_popup-inner.full-screen > .w_popup-section {
    border: transparent;
    box-shadow: none;
    height: fit-content;
}

#w_auth-popup {
    text-align: center;
    width: 100%;
    max-width: 400px;
}

#w_auth-popup .w_title {
    font-size: 1.35rem;
    margin: 0.5rem 0;
    color: #1a1a1a;
}

#w_auth-popup header p {
    color: #666;
    font-size: 0.95rem;
    margin: 0;
}

#w_auth-popup input,
#w_auth-popup [type="submit"],
#w_auth-popup .kalame-auth-btn {
    width: 100%;
    margin: 0.75rem 0;
    box-sizing: border-box;
}

#w_auth-popup input[type="tel"],
#w_auth-popup input[type="text"] {
    text-align: center;
    font-size: 1.1rem;
    padding: 0.85rem 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fafafa;
}

#w_auth-popup input:focus {
    outline: none;
    border-color: #333;
    background: #fff;
}

#w_auth-popup input::placeholder {
    transition: 0.3s all ease-in-out;
    color: #aaa;
}

#w_auth-popup input:focus::placeholder {
    opacity: 0;
}

#w_auth-popup .w_form-logo {
    margin-bottom: 1.5rem;
    width: 148px;
    height: auto;
    max-height: 48px;
    object-fit: contain;
}

#w_auth-popup .w_form-brand {
    display: block;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: #1a1a1a;
}

#w_auth-popup .w_user-verify,
#w_auth-popup .w_user-signup {
    display: none;
}

#w_auth-popup .w_user-verify input[name="otp_code"],
#w_auth-popup .w_user-detector input[name="phone"] {
    letter-spacing: 0.4rem;
    padding-left: 1.25rem;
}

#w_auth-popup .w_form-inputs {
    margin: 1.5rem 0;
}

#w_auth-popup .w_phone-opt-resend {
    display: none;
    cursor: pointer;
    color: #2563eb;
    text-decoration: underline;
}

#w_auth-popup .w_phone-opt-waiting {
    color: #666;
    font-size: 0.9rem;
}

#w_auth-popup .kalame-auth-btn,
#w_auth-popup .btn {
    display: inline-block;
    padding: 0.85rem 1.25rem;
    border: none;
    border-radius: 8px;
    background: #1a1a1a;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: opacity 0.2s;
}

#w_auth-popup .kalame-auth-btn:hover,
#w_auth-popup .btn:hover {
    opacity: 0.9;
}

#w_auth-popup .kalame-auth-btn:disabled,
#w_auth-popup .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#w_auth-popup .kalame-auth-btn-outline,
#w_auth-popup .btn-outline,
#w_auth-popup #editNumberPhone {
    display: block;
    width: 100%;
    box-sizing: border-box;
    background: transparent;
    color: #333;
    border: 1px solid #ccc;
}

#w_auth-popup footer small {
    color: #888;
    font-size: 0.8rem;
}

#w_auth-popup footer a {
    color: #2563eb;
}

.w_form-notice {
    display: block;
    min-height: 1.25rem;
    font-size: 0.9rem;
    margin: 0.25rem 0;
}

.w_form-notice.success-message {
    color: #15803d !important;
}

.w_form-notice.error-message {
    color: #dc2626 !important;
}

.w_input-group {
    position: relative;
    background-color: #fff;
    padding-top: 1rem;
    text-align: right;
}

.w_input-group label {
    position: absolute;
    top: 1rem;
    right: 0;
    transform: translate(-1rem, -50%);
    background-color: inherit;
    padding: 0 0.75rem;
    font-size: 0.85rem;
    color: #666;
}

.w_input-group input {
    background-color: #fafafa;
    text-align: right !important;
    letter-spacing: normal !important;
}

.kalame-login-button,
button.w_header-login {
    cursor: pointer;
}

form.loading {
    opacity: 0.7;
    pointer-events: none;
}

@media (max-width: 576px) {
    .kalame-auth-popup .w_popup-close {
        left: 14px;
    }

    #w_auth-popup {
        max-width: 100%;
    }
}
