/* ═══════════════════════════════════════════════════════════════════
   Auth Modal — ورود / ثبت‌نام / بازیابی
   ═══════════════════════════════════════════════════════════════════ */

.mbs-auth-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
}
.mbs-auth-modal:not([hidden]) {
    display: block;
}
.mbs-auth-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: mbs-auth-fade .25s ease;
}
@keyframes mbs-auth-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.mbs-auth-modal__panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% - 32px);
    max-width: 440px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: #ffffff;
    border-radius: 24px;
    padding: 32px 28px 28px;
    box-shadow:
        0 25px 60px -20px rgba(15, 23, 42, .35),
        0 0 0 1px rgba(15, 23, 42, .05);
    animation: mbs-auth-pop .3s cubic-bezier(.2, .8, .2, 1);
}
@keyframes mbs-auth-pop {
    from { opacity: 0; transform: translate(-50%, -46%) scale(.94); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ─── دکمه بستن ─── */
.mbs-auth-modal__close {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    background: var(--mbs-bg-muted, #f1f3f6);
    border: none;
    border-radius: 10px;
    color: var(--mbs-text-secondary, #475569);
    cursor: pointer;
    transition: all .2s;
    z-index: 2;
}
.mbs-auth-modal__close:hover {
    background: #fee2e2;
    color: #b91c1c;
    transform: rotate(90deg);
}
.mbs-auth-modal__close svg {
    width: 18px;
    height: 18px;
}

/* ─── برند ─── */
.mbs-auth-modal__brand {
    text-align: center;
    margin-bottom: 24px;
}
.mbs-auth-modal__logo {
    display: inline-grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin-bottom: 14px;
    background: linear-gradient(135deg, #1e40af, #6c5ce7);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 24px -8px rgba(108, 92, 231, .5);
}
.mbs-auth-modal__logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}
.mbs-auth-modal__logo span {
    color: #fff;
    font-size: 26px;
    font-weight: 900;
}
.mbs-auth-modal__title {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 800;
    color: var(--mbs-text-primary, #0f172a);
}
.mbs-auth-modal__subtitle {
    margin: 0;
    font-size: 12.5px;
    color: var(--mbs-text-muted, #94a3b8);
}

/* ─── تب‌ها ─── */
.mbs-auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 4px;
    padding: 4px;
    background: var(--mbs-bg-muted, #f1f3f6);
    border-radius: 14px;
    margin-bottom: 24px;
}
.mbs-auth-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 8px;
    background: transparent;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    color: var(--mbs-text-secondary, #475569);
    cursor: pointer;
    transition: all .25s cubic-bezier(.2, .8, .2, 1);
}
.mbs-auth-tab svg {
    width: 15px;
    height: 15px;
    color: currentColor;
}
.mbs-auth-tab.is-active {
    background: #fff;
    color: var(--mbs-brand, #1a5fb4);
    box-shadow: 0 2px 8px -2px rgba(15, 23, 42, .12);
}

/* ─── فرم‌ها ─── */
.mbs-auth-form {
    display: none;
}
.mbs-auth-form.is-active {
    display: block;
    animation: mbs-auth-fade .25s ease;
}

.mbs-auth-field {
    margin-bottom: 16px;
}
.mbs-auth-field label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--mbs-text-secondary, #475569);
    margin-bottom: 8px;
}
.mbs-auth-field label svg {
    width: 15px;
    height: 15px;
    color: var(--mbs-brand, #1a5fb4);
}

.mbs-auth-field input[type="email"],
.mbs-auth-field input[type="password"],
.mbs-auth-field input[type="text"] {
    width: 100%;
    padding: 12px 14px;
    background: var(--mbs-bg-muted, #f1f3f6);
    border: 2px solid transparent;
    border-radius: 12px;
    font-family: inherit;
    font-size: 14px;
    color: var(--mbs-text-primary, #0f172a);
    transition: all .25s cubic-bezier(.2, .8, .2, 1);
    box-sizing: border-box;
}
.mbs-auth-field input:focus {
    outline: none;
    background: #fff;
    border-color: var(--mbs-brand, #1a5fb4);
    box-shadow: 0 0 0 4px rgba(26, 95, 180, .12);
}
.mbs-auth-field input::placeholder {
    color: var(--mbs-text-muted, #94a3b8);
}

/* ─── دکمه نمایش رمز ─── */
.mbs-auth-input-wrap {
    position: relative;
}
.mbs-auth-input-wrap input {
    padding-left: 48px !important;
}
.mbs-auth-eye {
    position: absolute;
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--mbs-text-muted, #94a3b8);
    cursor: pointer;
    transition: all .2s;
}
.mbs-auth-eye:hover {
    background: var(--mbs-bg-hover, #eef1f5);
    color: var(--mbs-brand, #1a5fb4);
}
.mbs-auth-eye.is-visible {
    color: var(--mbs-brand, #1a5fb4);
}
.mbs-auth-eye svg {
    width: 18px;
    height: 18px;
}

/* ─── ردیف checkbox + link ─── */
.mbs-auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 20px;
    flex-wrap: wrap;
}
.mbs-auth-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--mbs-text-secondary, #475569);
    cursor: pointer;
    user-select: none;
}
.mbs-auth-check input {
    width: 18px;
    height: 18px;
    accent-color: var(--mbs-brand, #1a5fb4);
    cursor: pointer;
}
.mbs-auth-link {
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    color: var(--mbs-brand, #1a5fb4);
    cursor: pointer;
    transition: color .2s;
    text-decoration: none;
}
.mbs-auth-link:hover {
    color: var(--mbs-accent, #c2185b);
    text-decoration: underline;
}

/* ─── دکمه submit ─── */
.mbs-auth-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #1e40af 0%, #6c5ce7 100%);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 800;
    cursor: pointer;
    transition: all .25s cubic-bezier(.2, .8, .2, 1);
    box-shadow: 0 8px 20px -6px rgba(108, 92, 231, .5);
    text-decoration: none;
    box-sizing: border-box;
}
.mbs-auth-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px -8px rgba(108, 92, 231, .7);
}
.mbs-auth-submit svg {
    width: 18px;
    height: 18px;
    filter: brightness(0) invert(1);
}
.mbs-auth-submit--ghost {
    background: var(--mbs-bg-muted, #f1f3f6);
    color: var(--mbs-text-primary, #0f172a);
    box-shadow: none;
    border: 2px solid var(--mbs-border, #e5e7eb);
}
.mbs-auth-submit--ghost:hover {
    background: #fff;
    border-color: var(--mbs-brand, #1a5fb4);
    color: var(--mbs-brand, #1a5fb4);
    box-shadow: 0 4px 12px -4px rgba(26, 95, 180, .2);
}

/* ─── Footer ─── */
.mbs-auth-footer {
    margin-top: 18px;
    text-align: center;
    font-size: 13px;
    color: var(--mbs-text-secondary, #475569);
}

/* ─── خطا ─── */
.mbs-auth-error {
    padding: 12px 14px;
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
    text-align: center;
}

/* ─── به‌زودی ─── */
.mbs-auth-soon {
    text-align: center;
    padding: 20px 8px 8px;
}
.mbs-auth-soon__icon {
    display: inline-grid;
    place-items: center;
    width: 80px;
    height: 80px;
    margin-bottom: 18px;
    background: linear-gradient(135deg, #e0e7ff, #ede9fe);
    color: #6c5ce7;
    border-radius: 24px;
}
.mbs-auth-soon__icon svg {
    width: 42px;
    height: 42px;
}
.mbs-auth-soon h3 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 800;
    color: var(--mbs-text-primary, #0f172a);
}
.mbs-auth-soon p {
    margin: 0 0 20px;
    font-size: 13.5px;
    line-height: 1.8;
    color: var(--mbs-text-secondary, #475569);
}

/* [حذف — v2] */


/* ═══════════════════════════════════════════════════════════════
   v2 — لوگو با پس‌زمینه سفید/گرادیان + fix موبایل
   ═══════════════════════════════════════════════════════════════ */

/* ─── لوگو: پس‌زمینه سفید گرادیانی ─── */
.mbs-auth-modal__logo {
    background: #ffffff !important;
    border: 2px solid #e0e7ff;
    box-shadow:
        0 10px 24px -8px rgba(108, 92, 231, .25),
        inset 0 0 0 1px rgba(255, 255, 255, .8);
    padding: 4px;
}
.mbs-auth-modal__logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}
.mbs-auth-modal__logo span {
    color: #1e40af !important;
    font-size: 26px;
    font-weight: 900;
    background: linear-gradient(135deg, #1e40af, #6c5ce7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ─── fix موبایل: bottom sheet بالای bottom-nav ─── */
@media (max-width: 480px) {

    /* panel: از پایین ولی بالای bottom-nav */
    .mbs-auth-modal__panel {
        position: fixed;
        top: auto;
        bottom: calc(64px + env(safe-area-inset-bottom, 0px));
        left: 0;
        right: 0;
        width: 100%;
        max-width: none;
        max-height: calc(100vh - 100px);
        border-radius: 24px 24px 0 0;
        padding: 26px 20px 22px;
        transform: translate(0, 0);
        animation: mbs-auth-slide-up .3s cubic-bezier(.2, .8, .2, 1);
        overflow-y: auto;
    }

    @keyframes mbs-auth-slide-up {
        from { opacity: 0; transform: translateY(30px); }
        to   { opacity: 1; transform: translateY(0); }
    }

    /* دکمه بستن: داخل panel، گوشه */
    .mbs-auth-modal__close {
        top: 14px;
        left: 14px;
        width: 32px;
        height: 32px;
        border-radius: 9px;
    }
    .mbs-auth-modal__close svg {
        width: 16px;
        height: 16px;
    }

    /* برند: کوچیک‌تر */
    .mbs-auth-modal__brand {
        margin-bottom: 20px;
    }
    .mbs-auth-modal__logo {
        width: 56px;
        height: 56px;
        border-radius: 16px;
    }
    .mbs-auth-modal__logo span {
        font-size: 22px;
    }
    .mbs-auth-modal__title {
        font-size: 18px;
    }

    /* تب‌ها */
    .mbs-auth-tabs {
        margin-bottom: 20px;
        padding: 3px;
    }
    .mbs-auth-tab {
        padding: 9px 4px;
        font-size: 12px;
        gap: 4px;
    }
    .mbs-auth-tab svg {
        width: 13px;
        height: 13px;
    }

    /* فیلدها */
    .mbs-auth-field input {
        padding: 11px 13px;
        font-size: 13.5px;
    }
    .mbs-auth-field label {
        font-size: 12.5px;
    }

    /* دکمه */
    .mbs-auth-submit {
        padding: 13px 18px;
        font-size: 14px;
    }

    /* ردیف */
    .mbs-auth-row {
        margin: 2px 0 16px;
    }
    .mbs-auth-check {
        font-size: 12.5px;
    }
    .mbs-auth-link {
        font-size: 12.5px;
    }
    .mbs-auth-footer {
        font-size: 12.5px;
    }

    /* دکمه ورود هدر — گوشه بالا راست، اگر مودال باز است */
    .mbs-header__left {
        z-index: 1;
    }
}

/* ─── روی دسکتاپ — پس‌زمینه تیره، modal مرکزی ─── */
@media (min-width: 481px) {
    .mbs-auth-modal__panel {
        top: 50%;
        bottom: auto;
        left: 50%;
        right: auto;
        transform: translate(-50%, -50%);
        width: calc(100% - 32px);
        max-width: 440px;
        border-radius: 24px;
    }
}
