@font-face {
    font-family: 'Kalameh';
    src: url('../fonts/Kalameh.ttf') format('truetype');
}

@font-face {
    font-family: 'Kalameh';
    src: url('../fonts/Kalameh-Bold.ttf') format('truetype');
    font-weight: bold;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Kalameh', sans-serif;
    min-height: 100vh;
    direction: rtl;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top right, #9f67ff 0%, #6d28d9 35%, #3b0764 100%);
    padding: 20px;
    overflow-y: auto;
}

body::before {
    content: '';
    position: fixed;
    width: 700px;
    height: 700px;
    background: rgba(255, 255, 255, .05);
    border-radius: 50%;
    top: -250px;
    right: -150px;
    pointer-events: none;
}

body::after {
    content: '';
    position: fixed;
    width: 500px;
    height: 500px;
    background: rgba(255, 255, 255, .04);
    border-radius: 50%;
    bottom: -180px;
    left: -120px;
    pointer-events: none;
}

.login-wrapper {
    width: 1100px;
    max-width: 100%;
    background: #fff;
    border-radius: 32px;
    overflow: hidden;
    display: flex;
    position: relative;
    z-index: 10;
    box-shadow: 0 25px 70px rgba(0, 0, 0, .25);
    flex-direction: row;
    flex-wrap: wrap;
}

.login-left {
    width: 55%;
    background: linear-gradient(145deg, #5b21b6, #7c3aed);
    color: #fff;
    padding: 70px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.logo {
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.crm-title {
    font-size: 24px;
    opacity: .95;
    margin-bottom: 50px;
    line-height: 1.4;
}

.feature {
    font-size: 18px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.feature:last-child {
    margin-bottom: 0;
}

.login-right {
    width: 45%;
    padding: 70px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-title {
    text-align: center;
    font-size: 30px;
    font-weight: bold;
    color: #4c1d95;
    margin-bottom: 40px;
}

.form-label {
    margin-bottom: 8px;
    color: #555;
    display: block;
    font-weight: 500;
}

.form-control {
    height: 58px;
    border-radius: 16px;
    border: 1px solid #ddd;
    padding: 0 18px;
    font-size: 15px;
    transition: .3s;
    width: 100%;
    font-family: 'Kalameh', sans-serif;
}

.form-control:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 .25rem rgba(124, 58, 237, .15);
    outline: none;
}

.btn-login {
    height: 58px;
    border: none;
    border-radius: 16px;
    margin-top: 15px;
    background: linear-gradient(90deg, #6d28d9, #8b5cf6);
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    transition: .3s;
    cursor: pointer;
    width: 100%;
    font-family: 'Kalameh', sans-serif;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(124, 58, 237, .3);
}

.btn-login:active {
    transform: translateY(0);
}

#loginResult {
    margin-top: 20px;
}

#loginResult .alert {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    text-align: center;
}

.alert-danger {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.version {
    text-align: center;
    margin-top: 30px;
    color: #999;
    font-size: 13px;
}

.mb-3 {
    margin-bottom: 1rem !important;
}

.w-100 {
    width: 100% !important;
}

/* ===== ریسپانسیو برای تبلت ===== */
@media (max-width: 992px) {
    .login-left {
        padding: 40px;
    }
    
    .login-right {
        padding: 40px;
    }
    
    .logo {
        font-size: 40px;
    }
    
    .crm-title {
        font-size: 20px;
        margin-bottom: 30px;
    }
    
    .feature {
        font-size: 16px;
        margin-bottom: 14px;
    }
    
    .login-title {
        font-size: 26px;
        margin-bottom: 30px;
    }
}

/* ===== موبایل - نمایش بخش توضیحات زیر فرم ===== */
@media (max-width: 768px) {
    body {
        padding: 15px;
        align-items: flex-start;
        padding-top: 30px;
        padding-bottom: 30px;
    }
    
    .login-wrapper {
        flex-direction: column;
        border-radius: 24px;
    }
    
    /* بخش فرم (قسمت چپ سابق) - اول نمایش داده میشه */
    .login-right {
        width: 100%;
        padding: 35px 25px;
        order: 1;
    }
    
    /* بخش توضیحات (قسمت راست سابق) - زیر فرم نمایش داده میشه */
    .login-left {
        width: 100%;
        padding: 35px 25px;
        order: 2;
        border-radius: 0 0 24px 24px;
        text-align: center;
    }
    
    .logo {
        font-size: 32px;
        text-align: center;
    }
    
    .crm-title {
        font-size: 18px;
        margin-bottom: 25px;
        text-align: center;
    }
    
    .feature {
        font-size: 15px;
        margin-bottom: 12px;
        justify-content: center;
        background: rgba(255, 255, 255, 0.1);
        padding: 10px 15px;
        border-radius: 50px;
        backdrop-filter: blur(5px);
    }
    
    .feature span {
        margin-left: 8px;
    }
    
    .login-title {
        font-size: 24px;
        margin-bottom: 25px;
    }
    
    .form-control {
        height: 52px;
        font-size: 14px;
        padding: 0 15px;
    }
    
    .btn-login {
        height: 52px;
        font-size: 16px;
    }
    
    .form-label {
        font-size: 14px;
    }
    
    .version {
        margin-top: 20px;
        font-size: 11px;
    }
    
    #loginResult .alert {
        font-size: 13px;
        padding: 10px 14px;
    }
    
    /* اضافه کردن جداکننده زیبا بین فرم و بخش توضیحات */
    .login-right::after {
        display: none;
    }
}

/* ===== موبایل خیلی کوچک ===== */
@media (max-width: 480px) {
    .login-right {
        padding: 25px 18px;
    }
    
    .login-left {
        padding: 25px 18px;
    }
    
    .login-title {
        font-size: 22px;
        margin-bottom: 20px;
    }
    
    .form-control {
        height: 48px;
    }
    
    .btn-login {
        height: 48px;
        font-size: 15px;
    }
    
    .logo {
        font-size: 28px;
    }
    
    .crm-title {
        font-size: 16px;
        margin-bottom: 20px;
    }
    
    .feature {
        font-size: 13px;
        margin-bottom: 10px;
        padding: 8px 12px;
    }
    
    .mb-3 {
        margin-bottom: 0.75rem !important;
    }
}

/* ===== صفحه‌های بسیار بلند ===== */
@media (max-height: 700px) and (max-width: 768px) {
    body {
        padding-top: 20px;
        padding-bottom: 20px;
    }
    
    .login-right {
        padding: 20px;
    }
    
    .login-left {
        padding: 20px;
    }
    
    .login-title {
        margin-bottom: 15px;
    }
    
    .version {
        margin-top: 15px;
    }
    
    .crm-title {
        margin-bottom: 15px;
    }
    
    .feature {
        margin-bottom: 8px;
        padding: 6px 12px;
    }
}