/* متغیرهای رنگی برند متیمد (سیاه و سفید مینیمال) */
:root {
    --mm-color-black: #111111;
    --mm-color-white: #ffffff;
    --mm-color-gray-light: #f5f5f5;
    --mm-color-gray-border: #e0e0e0;
    --mm-color-text-muted: #666666;
    --mm-font-family: 'Vazir', 'IranSans', 'IranYekan', sans-serif;
}

/* لایه تاریک پس‌زمینه (Overlay) */
.mm-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px); /* افکت بلور لوکس */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999; /* بالاتر از همه چیز */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    font-family: var(--mm-font-family);
    direction: rtl;
}

.mm-modal-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

/* باکس اصلی فرم */
.mm-modal-box {
    background: var(--mm-color-white);
    width: 90%;
    max-width: 400px;
    border-radius: 16px; /* گوشه‌های نرم */
    padding: 32px 24px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transform: translateY(20px);
    transition: transform 0.3s ease;
    overflow: hidden; /* برای انیمیشن مراحل */
}

.mm-modal-overlay.is-open .mm-modal-box {
    transform: translateY(0);
}

/* دکمه بستن */
.mm-modal-close {
    position: absolute;
    top: 16px; left: 16px;
    background: none; border: none;
    font-size: 24px; cursor: pointer;
    color: var(--mm-color-text-muted);
}

/* مدیریت مراحل (Steps) */
.mm-step {
    display: none;
    animation: mmFadeIn 0.4s forwards;
}
.mm-step.active { display: block; }

@keyframes mmFadeIn {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: translateX(0); }
}

/* تایپوگرافی */
.mm-modal-title { font-size: 20px; font-weight: 700; margin-bottom: 8px; color: var(--mm-color-black); }
.mm-modal-desc { font-size: 14px; color: var(--mm-color-text-muted); margin-bottom: 24px; }

/* فیلد ورودی شماره */
.mm-input-group {
    display: flex; align-items: center;
    border-bottom: 2px solid var(--mm-color-gray-border);
    padding-bottom: 8px; margin-bottom: 24px;
    transition: border-color 0.2s;
}
.mm-input-group:focus-within { border-bottom-color: var(--mm-color-black); }

.mm-prefix { color: var(--mm-color-text-muted); font-size: 16px; margin-left: 8px; direction: ltr;}
.ltr-input { direction: ltr; text-align: left; font-family: monospace; }

.mm-input {
    border: none; outline: none; background: transparent;
    width: 100%; font-size: 18px; color: var(--mm-color-black);
}

/* دکمه اصلی */
.mm-btn {
    width: 100%; padding: 14px;
    border: none; border-radius: 8px;
    font-size: 16px; font-weight: bold;
    cursor: pointer; transition: 0.2s;
    font-family: var(--mm-font-family);
}
.mm-btn-primary {
    background: var(--mm-color-black); color: var(--mm-color-white);
}
.mm-btn-primary:hover { background: #333; }

/* استایل کدهای ۵ رقمی OTP */
.mm-otp-inputs {
    display: flex; justify-content: space-between; margin-bottom: 24px; gap: 8px;
}
.mm-otp-digit {
    width: 50px; height: 50px;
    border: 1px solid var(--mm-color-gray-border);
    border-radius: 8px;
    text-align: center; font-size: 24px; font-weight: bold;
    color: var(--mm-color-black); outline: none;
    transition: 0.2s;
}
.mm-otp-digit:focus { border-color: var(--mm-color-black); box-shadow: 0 0 0 2px rgba(0,0,0,0.1); }

/* هدر و فوتر مرحله OTP */
.mm-otp-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.mm-btn-edit-phone { background: none; border: none; color: #0066cc; cursor: pointer; font-size: 13px; text-decoration: underline; }
.mm-otp-footer { text-align: center; margin-top: 16px; font-size: 14px; }
.mm-btn-resend { background: none; border: none; color: var(--mm-color-black); font-weight: bold; cursor: pointer; }
.hidden { display: none !important; }
