/* =========================================
   ASRA GPS - Glass Login Box & Full Mobile Fit
   ========================================= */

html,
body {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* عکس پس‌زمینه کل صفحه فقط در زمان نمایش فرم لاگین */
#root:has(form) {
    min-height: 100vh !important;
    min-height: 100dvh !important;
    width: 100vw !important;
    max-width: 100% !important;
    background-color: #172b40 !important;
    background-image: url("/login-bg.jpg") !important;
    background-position: center center !important;
    background-size: cover !important;
    background-repeat: no-repeat !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 16px !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
}

/* حذف کامل کادرهای اضافی ترکر و جلوگیری از بیرون‌زدگی در موبایل */
#root:has(form) > div,
#root:has(form) > main,
#root:has(form) > main > div,
#root:has(form) > div > div,
#root:has(form) .MuiPaper-root,
#root:has(form) .MuiContainer-root {
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
    border: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
}

/* مخفی کردن بخش سمت چپ پیش‌فرض ترکر */
#root:has(form) > main > div:first-child,
#root:has(form) > div > div:first-child {
    display: none !important;
}

/* باکس اصلی فرم ورود به شکل شیشه‌ای شفاف (Glassmorphism) */
#root form {
    width: 100% !important;
    max-width: 390px !important;
    min-width: 0 !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
    padding: 32px 24px !important;
    background: rgba(255, 255, 255, 0.08) !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    border: 1px solid rgba(255, 255, 255, 0.45) !important;
    border-radius: 18px !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35) !important;
    display: block !important;
}

/* حذف لوگوی پیش‌فرض Traccar و جایگزینی با لوگوی ASRA */
#root form img {
    display: none !important;
}

#root form::before {
    content: "";
    display: block;
    width: 165px;
    height: 82px;
    margin: 0 auto 18px;
    background: url("/asra-logo.png") center center / contain no-repeat;
}

/* رنگ سفید و خوانا برای عنوان‌ها و نوشته‌های روی شیشه */
#root form h1,
#root form h2,
#root form label,
#root form p,
#root form span,
#root form a {
    color: #ffffff !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45) !important;
}

/* کادر ورودی ایمیل و پسورد کاملاً مات و سفید تا نوشته داخلش واضح دیده شود */
#root form .MuiInputBase-root,
#root form input {
    background-color: #ffffff !important;
    color: #172b40 !important;
    border-radius: 8px !important;
    font-size: 16px !important;
}

#root form input {
    border: 1px solid #cbd5e1 !important;
    min-height: 44px;
    box-sizing: border-box;
    text-shadow: none !important;
}

/* لیبل شناور داخل کادر سفید ایمیل و پسورد تیره باشد تا روی سفید دیده شود */
#root form .MuiInputLabel-root {
    color: #334155 !important;
    text-shadow: none !important;
    background: rgba(255, 255, 255, 0.9);
    padding: 0 4px;
    border-radius: 4px;
}

#root form input:focus {
    border-color: #1674bd !important;
    outline: none;
    box-shadow: 0 0 0 3px rgba(22, 116, 189, 0.25);
}

/* دکمه ورود کاملاً پررنگ و واضح */
#root form button[type="submit"],
#root form button {
    background-color: #1674bd !important;
    color: #ffffff !important;
    border-radius: 8px !important;
    min-height: 46px !important;
    font-weight: bold !important;
    font-size: 16px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
    text-shadow: none !important;
}

/* تنظیمات ویژه صفحه‌های موبایل */
@media (max-width: 600px) {
    #root:has(form) {
        padding: 12px !important;
        background-position: center center !important;
        background-size: cover !important;
    }

    #root form {
        width: 100% !important;
        max-width: 100% !important;
        padding: 24px 16px !important;
        border-radius: 16px !important;
    }

    #root form::before {
        width: 140px;
        height: 70px;
        margin-bottom: 14px;
    }
}
