/* معرفی فونت وزیرمتن از سرور شما */
@font-face {
    font-family: 'Vazirmatn';
    src: url('./font/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('./font/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
}

body {
    background-image: url(./assets/bg-image.png);
    background-size: cover;
    background-position: center;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f0f2f5; /* رنگ پس‌زمینه جایگزین در صورت لود نشدن عکس */
}

.container {
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2); /* سایه نرم و مدرن برای کل باکس */
    border-radius: 12px;
}

.top {
    background-image: url(./assets/bg-image1.png);
    background-size: cover;
    background-position: center;
    width: 400px;
    height: 225px;
    border-radius: 12px 12px 0 0;
    position: relative;
    overflow: hidden;
}

.bottom {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.2rem;
    width: 400px;
    background-color: rgba(255, 255, 255, 0.95); /* سفیدتر و شفافیت کمتر برای خوانایی بهتر */
    padding: 2rem 3rem;
    border-radius: 0 0 12px 12px;
}

.bottom h1 {
    color: #4a148c; /* بنفش تیره‌تر و رسمی‌تر */
    text-align: center;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.bottom form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.5rem;
}

.right-group {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

/* استایل سوییچ (Toggle) */
.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #d1d5db;
    border-radius: 24px;
    transition: 0.3s ease;
}

.slider::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.switch input:checked + .slider {
    background: #6a1b9a; /* رنگ بنفش هماهنگ با تم */
}

.switch input:checked + .slider::before {
    transform: translateX(22px);
}

.remember-me {
    font-size: 0.9rem;
    color: #555; /* رنگ ملایم‌تر برای متن */
    font-weight: normal;
    cursor: pointer;
}

.input-wrapper {
    position: relative;
    width: 100%;
}

/* تغییرات فیلد ورودی برای حالت راست‌چین و زیباتر شدن */
.input-wrapper input {
    width: 100%;
    padding: 0.8rem 3rem 0.8rem 1rem; /* پدینگ سمت راست بیشتر برای آیکون */
    border-radius: 8px; /* گوشه‌های مدرن‌تر (کمتر گرد) */
    background-color: #f3f4f6; /* خاکستری بسیار روشن به جای صورتی */
    border: 1px solid #e5e7eb;
    color: #333; /* رنگ متن تیره برای خوانایی */
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.input-wrapper input:focus {
    outline: none;
    border-color: #9c27b0;
    box-shadow: 0 0 0 3px rgba(156, 39, 176, 0.15); /* هاله بنفش ملایم دور کادر */
    background-color: #fff;
}

.input-wrapper input::placeholder {
    color: #9ca3af;
    font-size: 0.9rem;
}

/* اصلاح جایگاه آیکون‌ها برای راست‌چین (RTL) */
.input-wrapper .input-icon {
    position: absolute;
    top: 50%;
    right: 15px; /* انتقال به سمت راست */
    width: 20px;
    height: 20px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transform: translateY(-50%);
    pointer-events: none;
    opacity: 0.5; /* کمی کمرنگ‌تر برای زیبایی */
}

/* اگر آیکون‌های شما سفید هستند، با توجه به روشن شدن پس‌زمینه input، باید این خطوط را برای معکوس کردن رنگ آیکون‌ها اضافه کنید */
.user-icon { background-image: url(./assets/user.png); filter: invert(1); }
.lock-icon { background-image: url(./assets/padlock.png); filter: invert(1); }

/* استایل Autofill مرورگرها برای تم روشن */
input:-webkit-autofill {
    -webkit-text-fill-color: #333;
    -webkit-box-shadow: 0 0 0 1000px #f3f4f6 inset;
    transition: background-color 5000s ease-in-out 0s;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* دکمه ورود زیباتر */
.login-btn {
    width: 100%;
    padding: 0.8rem;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #8e24aa 0%, #5e35b1 100%); /* گرادیانت بنفش مدرن */
    color: white;
    font-size: 1.05rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 10px rgba(94, 53, 177, 0.3);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(94, 53, 177, 0.4);
}

/* اصلاح جایگاه ارورها برای راست‌چین */
.error {
    color: #e53935; /* قرمز استاندارد متریال */
    font-size: 0.75rem;
    position: absolute;
    right: 0.5rem; /* از راست تراز شود */
    bottom: -1.2rem; 
}

#invalid-pass {
    bottom: -1.2rem; 
}

/* Responsive Media Queries - تغییرات جزئی برای حفظ تناسب */
@media screen and (max-width: 1024px) {
    .top { width: 380px; height: 215px; }
    .bottom { width: 380px; padding: 2rem 2.5rem; }
}

@media screen and (max-width: 768px) {
    .top { width: 360px; height: 200px; }
    .bottom { width: 360px; padding: 1.5rem 2rem; }
    .bottom h1 { font-size: 1.5rem; }
}

@media screen and (max-width: 576px) {
    .top { width: 340px; height: 190px; }
    .bottom { width: 340px; padding: 1.5rem 1.75rem; }
    .input-wrapper input { padding: 0.75rem 2.5rem 0.75rem 1rem; }
}

@media screen and (max-width: 400px) {
    .top { width: 300px; height: 170px; }
    .bottom { width: 300px; padding: 1.5rem; gap: 1rem; }
    .bottom h1 { font-size: 1.3rem; }
    .bottom form { gap: 1rem; }
}
/* استایل کارت نوتیفیکیشن */
.notification-card {
    display: none; /* در ابتدا مخفی است */
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    text-align: center;
    font-weight: bold;
    font-size: 0.95rem;
    animation: fadeInDown 0.4s ease-out forwards;
}

/* حالت موفقیت */
.notification-card.success {
    display: block;
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #34d399;
    box-shadow: 0 4px 6px rgba(52, 211, 153, 0.2);
}

/* حالت خطا */
.notification-card.error {
    display: block;
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #f87171;
    box-shadow: 0 4px 6px rgba(248, 113, 113, 0.2);
}

/* انیمیشن ظاهر شدن کارت */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
