/* static/css/pages/login.css */

:root {
    /* --- رنگ‌های سازمانی شما --- */
    --theme-color: #D50000; /* رنگ اصلی (قرمز) */
    --theme-rgb: 213, 0, 0; /* برای استفاده در سایه‌ها و شفافیت‌ها */
    --theme-hover: #b00000; /* نسخه تیره‌تر قرمز برای حالت هاور دکمه */

    --bg-body: #f7f7f7;
    --bg-card: #ffffff;

    --text-main: #212529;
    --text-second: #071339;
    --text-muted: #6c757d;

    --border-color: #e9ecef;

    /* --- مپ کردن متغیرهای عملکردی به رنگ‌های سازمانی --- */
    --brand-color: var(--theme-color);
    --brand-focus: rgba(var(--theme-rgb), 0.15); /* هاله قرمز کمرنگ */
}

/* ریست کلی برای جلوگیری از بهم ریختگی */
.login-wrapper * {
    box-sizing: border-box;
}

.page-wrapper ,.page-mini-header{
    background-color: var(--bg-body)!important;
}

.login-wrapper {
    width: 100%;
    min-height: 85vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
    font-family: inherit;
    background-color: var(--bg-body); /* استفاده از رنگ پس‌زمینه سازمانی */
}

/* --- تعریف انیمیشن Fade In Up --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px); /* شروع از 40 پیکسل پایین‌تر */
    }
    to {
        opacity: 1;
        transform: translateY(0); /* پایان در جای اصلی */
    }
}

.login-card {
    width: 100%;
    max-width: 450px;
    background: var(--bg-card);
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    padding: 40px;
    border: 1px solid rgba(var(--theme-rgb), 0.1); /* بوردر بسیار کمرنگ قرمز */
    position: relative;
    overflow: hidden;
    text-align: center;

    /* --- اعمال انیمیشن هنگام لود صفحه --- */
    animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.login-header {
    margin-bottom: 30px;
}

.login-header h3 {
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 10px;
    font-size: 1.6rem;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* --- Form Elements --- */
.form-group {
    margin-bottom: 20px;
    position: relative;
    width: 100%;
}

.form-control-custom {
    display: block;
    width: 100%;
    height: 54px;
    padding: 0 20px;
    padding-left: 45px;
    border: 2px solid var(--border-color);
    border-radius: 14px;
    background-color: #fcfcfc;
    font-size: 0.95rem;
    color: var(--text-main);
    transition: all 0.2s ease;
}

.form-control-custom:focus {
    border-color: var(--brand-color);
    background-color: #fff;
    box-shadow: 0 0 0 4px var(--brand-focus); /* هاله قرمز دور اینپوت */
    outline: none;
}

.input-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
    font-size: 1.2rem;
    pointer-events: none;
    transition: color 0.2s;
}

.form-control-custom:focus + .input-icon {
    color: var(--brand-color);
}

/* --- Buttons --- */
.btn-login-submit {
    width: 100%;
    height: 54px;
    border-radius: 14px;
    background-color: var(--brand-color);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.btn-login-submit:hover {
    background-color: var(--theme-hover); /* قرمز تیره‌تر در هاور */
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(var(--theme-rgb), 0.25); /* سایه قرمز */
}

/* --- Tabs --- */
.segmented-control {
    display: flex;
    background: #f1f3f5;
    padding: 5px;
    border-radius: 14px;
    margin-bottom: 25px;
    user-select: none;
}

.segmented-option {
    flex: 1;
    text-align: center;
    padding: 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.segmented-option.active {
    color: var(--brand-color); /* متن فعال قرمز */
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* --- Verify Page Elements --- */
.verify-icon-large {
    font-size: 3.5rem;
    color: var(--brand-color);
    margin-bottom: 15px;
    opacity: 0.9;
    display: block;
}

.mobile-display {
    /* پس زمینه قرمز بسیار کمرنگ */
    background-color: rgba(var(--theme-rgb), 0.06);
    border-radius: 12px;
    padding: 8px 16px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0 25px 0;
    color: var(--brand-color);
    font-weight: 600;
    font-size: 1rem;
    border: 1px solid rgba(var(--theme-rgb), 0.1);
}

.otp-input {
    text-align: center;
    letter-spacing: 12px;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--brand-color);
    padding-left: 20px;
}

.otp-input::placeholder {
    letter-spacing: 2px;
    font-size: 1.2rem;
    font-weight: normal;
    color: #ced4da;
}

.timer-container {
    margin-top: 25px;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 12px;
    color: var(--text-muted);
    font-size: 0.9rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

/* --- Tab Animation (برای تغییر تب‌ها) --- */
.animate-slide-up {
    animation: slideUpTab 0.4s ease forwards;
}

@keyframes slideUpTab {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 500px) {
    .login-card {
        padding: 30px 20px;
    }

    .segmented-control {
        flex-direction: column;
    }

    .otp-input {
        font-size: 1.5rem;
        letter-spacing: 8px;
    }
}

.fa-num {
    font-family: "Vazir", "Yekan", sans-serif;
}

/* --- استایل اختصاصی برای بولد کردن شماره موبایل --- */
#mobileInput, #passwordInput {
    font-weight: 800 !important;
    color: var(--text-main) !important;
    font-size: 1.2rem;
    letter-spacing: 1px;
}

#mobileInput::placeholder, #passwordInput::placeholder {
    font-weight: 400 !important;
    color: #adb5bd !important;
    font-size: 0.95rem;
    letter-spacing: normal;
}

/* --- Register Page Specific Styles --- */

/* کارت در حالت ثبت‌نام باید عریض‌تر باشد تا دو ستون جا شود */
.login-card.register-mode {
    max-width: 850px;
}

/* کانتینر اصلی فرم ثبت‌نام: اجبار به راست‌چین بودن */
.register-form {
    text-align: right !important;
    direction: rtl !important;
}

/* استایل لیبل‌ها در صفحه ثبت‌نام */
.register-form label,
.register-form .label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: block;
    font-weight: 600;
    text-align: right !important; /* مهم: راست‌چین */
}

/* متن‌های خطا */
.register-form .text-danger {
    font-size: 0.8rem;
    margin-top: 5px;
    display: block;
    text-align: right;
    color: var(--theme-color) !important; /* خطاها هم قرمز شوند */
}

/* لینک قوانین */
.register-form .link {
    color: var(--brand-color);
    text-decoration: none;
    border-bottom: 1px dashed var(--brand-color);
    transition: all 0.2s;
}

.register-form .link:hover {
    color: var(--theme-hover);
    border-bottom-style: solid;
}

/* --- اصلاح ارتفاع فیلد آدرس (Textarea) --- */
textarea.form-control-custom {
    height: auto !important; /* ارتفاع ثابت 54px را حذف می‌کند */
    min-height: 120px; /* حداقل ارتفاع برای نمایش 5 خط */
    padding-top: 15px; /* فاصله از بالا برای خوانایی بهتر */
    padding-bottom: 15px; /* فاصله از پایین */
    line-height: 1.6; /* فاصله بین خطوط متن */
    resize: vertical; /* اجازه تغییر سایز عمودی به کاربر */
}

/* استایل متن راهنمای زیر پسورد */
.password-hint {
    font-size: 0.85rem; /* سایز فونت ریز و مناسب توضیحات */
    color: var(--text-muted);
    margin-top: 8px; /* فاصله از اینپوت بالا */
    line-height: 1.6; /* ارتفاع خطوط برای خوانایی بهتر */
    text-align: right; /* راست‌چین */
    display: flex;
    align-items: flex-start;
}

.password-hint i {
    color: var(--brand-color); /* رنگ آیکون (قرمز) */
    margin-left: 6px; /* فاصله آیکون از متن */
    position: relative;
    top: 3px; /* تنظیم دقیق تراز عمودی آیکون */
}
