html, body {
    width: 100vw;
    min-height: 100vh;
    height: 100dvh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background: #fff;
    box-sizing: border-box;
}

button, input, textarea, select {
    font-family: 'Almarai', Arial, Helvetica, sans-serif !important;
}

/* عناصر الصفحة الرئيسية */
.main-center {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.login-logo-mobile {
    display: none;
    margin: 0 auto;
    width: 200px;
    height: 200px;
    object-fit: contain;
}

@media (max-width: 900px) {
    .login-logo-mobile {
        display: block;
    }
}

.custom-container {
    max-width: 600px;
    margin: 10px auto 0;
    border-radius: 16px;
    padding: 28px 24px 18px 24px;
}

/* عناصر النصوص والحقول */
.custom-heading {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: #7a5fa9;
    font-weight: bold;
    letter-spacing: 1px;
}
.custom-label {
    display: block;
    font-size: 1rem;
    margin-bottom: 15px;
    color: #8e79b7;
}
.custom-input-container {
    display: flex;
    align-items: center;
    background: #f6f6fb;
    border-radius: 8px;
    margin-bottom: 5px;
    border: 1px solid #e6e6ef;
}
.flag-button {
    background: none;
    border: none;
    padding: 0 10px;
    outline: none;
}
.flag-icon {
    width: 26px;
    height: 22px;
}
.customxfield {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1.1rem;
    padding: 12px 30px;
    outline: none;
    direction: ltr;
}
.custom-button {
    width: 100%;
    padding: 12px 0;
    background: linear-gradient(90deg, #8e79b7, #7a5fa9);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 700;
    transition: 0.2s;
    cursor: pointer;
    margin-top: 10px;
}
.custom-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.form-message {
    margin-top: 14px;
    color: #b91535;
    text-align: center;
    font-size: 1rem;
    min-height: 24px;
}

/* OTP Modal Styles */
.modal-bg {
    position: fixed;
    top: 0; right: 0; left: 0; bottom: 0;
    background: rgba(45,50,80,.25);
    z-index: 999;
    display: none;
    align-items: center;
    justify-content: center;
}
.modal-bg.active { display: flex; }
.modal-box {
    background: #fff;
    padding: 24px 20px;
    border-radius: 16px;
    box-shadow: 0 4px 24px #0e193733;
    width: 92%;
    max-width: 350px;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #183149;
}
.modal-close {
    background: none;
    border: none;
    font-size: 1.6rem;
    color: #888;
    cursor: pointer;
    margin-right: -8px;
}
.modal-body {
    margin-top: 14px;
}
.otp-container {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}
.otp-input-single {
    text-align: center;
    font-size: 2rem;
    letter-spacing: 10px;
    border: 1px solid #d2d2d2;
    border-radius: 7px;
    padding: 12px;
    width: 100%;
    outline: none;
    background: #f8fafd;
    direction: ltr;
}

#timer-message {
    text-align: center;
    margin-top: 10px;
    color: #d81b60;
    font-size: 1rem;
}

/* Responsive */
@media (max-width: 900px) {
    .custom-container { margin: 5px auto 0; max-width: 95%; padding: 18px 8px 12px 8px;}
    .modal-box { max-width: 98%; padding: 16px 8px;}
    .custom-heading { font-size: 1.2rem; }
}

/* لإجبار الأرقام تظهر إنجليزي */
input[type="tel"], .otp-input-single {
    direction: ltr !important;
    unicode-bidi: plaintext !important;
    font-family: 'Almarai', Arial, Tahoma, Geneva, sans-serif !important;
    font-variant-numeric: lining-nums !important;
}

/* ==== Popup Modal/الصفحة المنبثقة ==== */
.popup-modal-bg {
    position: fixed;
    inset: 0;
    background: rgba(35, 35, 67, 0.17);
    z-index: 11000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    overflow-y: auto;
}
/* حاوية الصفحة المنبثقة */
.popup-modal-content {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 4px 28px #a777fb2c, 0 1.5px 8px #0001;
    padding: 27px 16px 20px 16px;
    width: 100%;
    max-width: 390px;
    min-width: 220px;
    max-height: 94vh;
    overflow-y: auto;
    font-family: inherit;
    text-align: right;
    position: relative;
    animation: popupAppear 0.22s cubic-bezier(.57,1.63,.39,.94);
    border: 1.5px solid #ede7f6;
    margin: 0 auto;
}

/* عناوين الحقول داخل المنبثقة */
.popup-modal-content .custom-heading {
    font-size: 1.2rem;
    margin-bottom: 17px;
    color: #7a5fa9;
    text-align: center;
    font-weight: 800;
    letter-spacing: 1px;
}

/* الحقول داخل المنبثقة: نفس الحقول الرئيسية مع ضبط العرض */
.popup-modal-content input[type="text"],
.popup-modal-content input[type="tel"],
.popup-modal-content input[type="date"] {
    width: 100%;
    padding: 13px 17px;
    margin-bottom: 14px;
    border-radius: 8px;
    border: 1.3px solid #e2e0f5;
    background: #faf9fe;
    color: #232343;
    font-size: 1.07rem;
    outline: none;
    transition: border-color 0.17s;
    box-sizing: border-box;
    display: block;
}

.popup-modal-content input[type="text"]:focus,
.popup-modal-content input[type="tel"]:focus,
.popup-modal-content input[type="date"]:focus {
    border-color: #a777fb;
    background: #f3effc;
}

.popup-modal-content .custom-input-container {
    display: flex;
    align-items: center;
    background: #f6f6fb;
    border-radius: 8px;
    margin-bottom: 13px;
    border: 1px solid #e6e6ef;
    width: 100%;
    box-sizing: border-box;
}

.popup-modal-content .flag-button {
    background: none;
    border: none;
    padding: 0 10px;
    outline: none;
}

.popup-modal-content .flag-icon {
    width: 26px;
    height: 22px;
}

.popup-modal-content .customxfield {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1.07rem;
    padding: 13px 14px;
    outline: none;
    direction: ltr;
    width: 100%;
    box-sizing: border-box;
}

.popup-modal-content .custom-button {
    width: 100%;
    padding: 12px 0;
    background: linear-gradient(90deg, #8e79b7, #7a5fa9);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.13rem;
    font-weight: 700;
    margin-top: 7px;
    transition: 0.18s;
    cursor: pointer;
}

.popup-modal-content .form-message {
    margin-top: 13px;
    min-height: 24px;
    font-size: 1rem;
    text-align: center;
    color: #b91535;
}

@media (max-width: 540px) {
    .popup-modal-content {
        max-width: 97vw;
        padding: 12px 2vw 12px 2vw;
    }
    .popup-modal-content .custom-heading { font-size: 1.03rem; }
    .popup-modal-content input { font-size: 13.2px; }
}

