html[lang="ae"] .b3na-scope,
html[lang="ar"] .b3na-scope {
    direction: rtl;
    text-align: right;
    font-family: 'Cairo', sans-serif;
}

html[lang="en"] .b3na-scope {
    direction: ltr;
    text-align: left;
    font-family: 'Cairo', sans-serif;
}

html[lang="ae"] .b3na-scope .b3acc-passwrap .b3acc-input,
html[lang="ar"] .b3na-scope .b3acc-passwrap .b3acc-input {
    padding-right: 42px !important;
    padding-left: 10px !important;
}

html[lang="en"] .b3na-scope .b3acc-passwrap .b3acc-input {
    padding-left: 42px !important;
    padding-right: 10px !important;
}

html[lang="ae"] .b3na-scope .b3acc-toggle-pass,
html[lang="ar"] .b3na-scope .b3acc-toggle-pass {
    right: 10px;
    left: auto;
}

html[lang="en"] .b3na-scope .b3acc-toggle-pass {
    left: 10px;
    right: auto;
}

html[lang="ae"] .b3na-scope .b3acc-links,
html[lang="ar"] .b3na-scope .b3acc-links {
    justify-content: flex-start;
}

html[lang="en"] .b3na-scope .b3acc-links {
    justify-content: flex-start;
}

html[lang="ae"] .b3na-scope .iti input.b3acc-input,
html[lang="ar"] .b3na-scope .iti input.b3acc-input {
    direction: ltr;
}

html[lang="en"] .b3na-scope .iti input.b3acc-input {
    direction: ltr;
}

.b3na-scope {
    all: initial;
    font-family: 'Cairo', sans-serif;
    box-sizing: border-box;
}

.b3na-scope * {
    box-sizing: border-box;
}

.b3acc-modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 10060;
    font-family: inherit;
}

.b3acc-modal.b3na-open {
    display: block;
}

.b3acc-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    opacity: 0;
    transition: opacity .25s ease;
}

.b3na-open .b3acc-backdrop {
    opacity: 1;
}

.b3acc-dialog {
    position: relative;
    width: clamp(300px, 92vw, 420px);
    max-width: 420px;
    margin: 8vh auto 0;
    background: #fff;
    color: #111317;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .15);
    transform: translateY(15px) scale(.97);
    opacity: 0;
    transition: all .25s cubic-bezier(.25, .8, .25, 1);
    overflow: hidden;

    display: flex;
    flex-direction: column;
    max-height: calc(100dvh - 32px);
    overscroll-behavior: contain;
}

.b3na-open .b3acc-dialog {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.b3acc-header {
    position: sticky;
    top: 0;
    background: #ffffff;
    padding: 16px 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #edf2f7;
    box-shadow: 0 1px 0 rgba(16, 24, 40, .02);
    z-index: 2;
}

.b3acc-title {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: .1px;
}

.b3acc-close {
    position: absolute;
    inset-inline-end: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid #e6eaf0;
    background: #fff;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .08s ease;
}

.b3acc-close:hover {
    background: #f8fafc;
    border-color: #dde5ee;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .06);
}

.b3acc-close:active {
    transform: translateY(-50%) scale(.98);
}

.b3acc-body {
    padding: 20px 18px 24px;
    overflow-x: hidden;
    overflow-y: auto;
    flex: 1 1 auto;
    -webkit-overflow-scrolling: touch;
}

.b3acc-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #f5f7fb;
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
    margin-bottom: 16px;
    border: 1px solid #e5e7eb;
    top: 0;
    z-index: 1;
}

.b3acc-tab {
    background: transparent;
    border: 0;
    border-radius: 10px;
    padding: 10px 8px;
    cursor: pointer;
    font-weight: 700;
    color: #6b7280;
    text-align: center;
    transition: all .2s ease;
}

.b3acc-tab.b3acc-active {
    background: #fff;
    color: #111317;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}

.b3na-scope [hidden] {
    display: none !important;
}

.b3acc-form {
    display: block;
}

.b3acc-form.b3acc-active {
    display: block !important;
}

.b3acc-form.b3acc-inactive {
    display: none !important;
}

.b3acc-field {
    display: grid;
    gap: 6px;
    margin-bottom: 10px;
}

.b3acc-label {
    font-size: 13px;
    color: #6b7280;
    font-weight: 600;
}

.b3acc-input {
    height: 48px !important;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #111317;
    padding: 0 10px !important;
    font-size: 16px;
    width: 100%;
    min-width: 0;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.b3acc-input:focus {
    border-color: #2196f3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, .18);
}

/* غلاف حقل كلمة المرور */
.b3acc-passwrap {
    position: relative;
}

/* الوضع الافتراضي سيتم تعديله في أعلى الملف حسب اللغة */

/* زر إظهار/إخفاء كلمة المرور */
.b3acc-toggle-pass {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    outline: none;
    color: #6b7280;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease, transform .08s ease;
}

.b3acc-toggle-pass svg {
    display: block;
}

.b3acc-toggle-pass:hover {
    background: #f8fafc;
    border-color: #d1d5db;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
}

.b3acc-toggle-pass:active {
    transform: translateY(-50%) scale(.97);
}

.b3acc-toggle-pass--active {
    background: #e3f2fd;
    border-color: #2196f3;
    color: #1d4ed8;
}

.b3acc-actions {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.b3acc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 700;
    font-size: 15px;
    transition: all .2s ease;
}

.b3acc-btn--primary {
    background: var(--color-primary);
    color: #fff;
}

.b3acc-btn--primary:hover {
    background: var(--color-primary);
}

.b3acc-links {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 6px 2px 10px;
}

.b3acc-link {
    background: none;
    border: none;
    padding: 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--color-primary);
    cursor: pointer;
    text-decoration: none;
    transition: color .2s ease;
}

.b3acc-link:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

.b3acc-divider {
    position: relative;
    text-align: center;
    margin: 14px 0 8px;
    color: #9ca3af;
    font-size: 13px;
}

.b3acc-divider::before,
.b3acc-divider::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: #e5e7eb;
}

.b3acc-divider::before {
    right: 0;
}

.b3acc-divider::after {
    left: 0;
}

.b3acc-modernlink {
    text-align: center;
}

.b3acc-modernlink button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    color: var(--color-primary);
    transition: color .2s ease;
}

.b3acc-modernlink button:hover {
    color: #1976d2;
    text-decoration: underline;
}

.iti {
    width: 100%;
}

.iti input.b3acc-input {
    padding-left: 48px !important;
}

/* قائمة الدول في fullscreen تبقى LTR */
.iti--fullscreen-popup .iti__country-list {
    direction: ltr;
}

.b3acc-field.error .b3acc-input {
    border-color: #d32f2f !important;
    box-shadow: 0 0 0 3px rgba(211, 47, 47, .10) !important;
}

.b3acc-error {
    color: #b71c1c;
    background: #fff5f5;
    border: 1px solid #ffcdd2;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 13px;
    margin-top: 8px;
}

.b3acc-otp-head {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.b3acc-otp-title {
    font-weight: 800;
    font-size: 18px;
    color: #0f172a;
}

.b3acc-otp-sub {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.8;
}

.b3acc-otp-phone {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    direction: ltr;
    background: #f1f5ff;
    border: 1px solid #e3ebff;
    color: #111317;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 700;
}

#otp-single {
    text-align: center;
    letter-spacing: 4px;
    font-weight: 700;
    font-size: 20px;
    height: 50px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    width: 100%;
}

#otp-single:focus {
    border-color: #2196f3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, .18);
}

@media (max-width:480px) {
    .b3acc-dialog {
        margin: 4vh auto 0;
    }
}

.b3na-scope .b3acc-input::placeholder {
    opacity: 0.2;
    color: #111317;
}

.b3acc-alert {
    border: 1px solid #e5e7eb;
    background: #f8fafc;
    color: #111317;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
    margin: 8px 0 12px;
}

.b3acc-alert--error {
    border-color: #ffcdd2;
    background: #fff5f5;
    color: #b71c1c;
}

.b3acc-alert--success {
    border-color: #c8e6c9;
    background: #f1fff2;
    color: #1b5e20;
}

.b3acc-alert--info {
    border-color: #bbdefb;
    background: #f1f7ff;
    color: #0d47a1;
}



/* =========================================================
   Dark Mode — Full Override (dialog = #181818)
   ========================================================= */
body.dark-mode .b3na-scope {
    color: #f1f1f1;
}

/* Backdrop */
body.dark-mode .b3na-scope .b3acc-backdrop {
    background: rgba(0, 0, 0, 0.65);
}

/* Dialog */
body.dark-mode .b3na-scope .b3acc-dialog {
    background: #181818;
    color: #f1f1f1;
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 14px 45px rgba(0, 0, 0, 0.55);
}

/* Header */
body.dark-mode .b3na-scope .b3acc-header {
    background: #181818;
    border-bottom-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
}

body.dark-mode .b3na-scope .b3acc-title {
    color: #ffffff;
}

/* Close button */
body.dark-mode .b3na-scope .b3acc-close {
    background: #222;
    border-color: rgba(255, 255, 255, 0.18);
    color: #e5e7eb;
}

body.dark-mode .b3na-scope .b3acc-close:hover {
    background: #2a2a2a;
}

/* Tabs */
body.dark-mode .b3na-scope .b3acc-tabs {
    background: #222;
    border-color: rgba(255, 255, 255, 0.12);
}

body.dark-mode .b3na-scope .b3acc-tab {
    color: rgba(255, 255, 255, 0.65);
}

body.dark-mode .b3na-scope .b3acc-tab.b3acc-active {
    background: #2a2a2a;
    color: #ffffff;
}

/* Labels */
body.dark-mode .b3na-scope .b3acc-label {
    color: rgba(255, 255, 255, 0.7);
}

/* Inputs */
body.dark-mode .b3na-scope .b3acc-input,
body.dark-mode .b3na-scope #otp-single {
    background: #222;
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.18);
}

body.dark-mode .b3na-scope .b3acc-input:focus,
body.dark-mode .b3na-scope #otp-single:focus {
    border-color: #2196f3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.28);
}

body.dark-mode .b3na-scope .b3acc-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
    opacity: 1;
}

/* Toggle password */
body.dark-mode .b3na-scope .b3acc-toggle-pass {
    background: #222;
    border-color: rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.85);
}

body.dark-mode .b3na-scope .b3acc-toggle-pass:hover {
    background: #2a2a2a;
}

body.dark-mode .b3na-scope .b3acc-toggle-pass--active {
    background: rgba(33, 150, 243, 0.28);
    border-color: #2196f3;
    color: #bbdefb;
}

/* Divider */
body.dark-mode .b3na-scope .b3acc-divider {
    color: rgba(255, 255, 255, 0.55);
}

body.dark-mode .b3na-scope .b3acc-divider::before,
body.dark-mode .b3na-scope .b3acc-divider::after {
    background: rgba(255, 255, 255, 0.2);
}

/* OTP */
body.dark-mode .b3na-scope .b3acc-otp-title {
    color: #ffffff;
}

body.dark-mode .b3na-scope .b3acc-otp-sub {
    color: rgba(255, 255, 255, 0.75);
}

body.dark-mode .b3na-scope .b3acc-otp-phone {
    background: rgba(33, 150, 243, 0.28);
    border-color: rgba(33, 150, 243, 0.45);
    color: #ffffff;
}

/* Alerts */
body.dark-mode .b3na-scope .b3acc-alert {
    background: #222;
    border-color: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

body.dark-mode .b3na-scope .b3acc-alert--error {
    background: rgba(239, 68, 68, 0.28);
    border-color: rgba(239, 68, 68, 0.45);
    color: #ffe4e6;
}

body.dark-mode .b3na-scope .b3acc-alert--success {
    background: rgba(16, 185, 129, 0.28);
    border-color: rgba(16, 185, 129, 0.45);
    color: #dcfce7;
}

body.dark-mode .b3na-scope .b3acc-alert--info {
    background: rgba(59, 130, 246, 0.28);
    border-color: rgba(59, 130, 246, 0.45);
    color: #dbeafe;
}

body.dark-mode .b3na-scope .b3acc-error {
    background: rgba(239, 68, 68, 0.28);
    border-color: rgba(239, 68, 68, 0.45);
    color: #ffe4e6;
}

/* intl-tel-input */
body.dark-mode .b3na-scope .iti--fullscreen-popup .iti__country-list {
    background: #181818;
    color: #ffffff;
}

body.dark-mode .b3na-scope .iti__country:hover,
body.dark-mode .b3na-scope .iti__country.iti__highlight {
    background: #2a2a2a;
}
