/* static/css/pages/login.css */

/* --- تعریف متغیرهای رنگی بر اساس پالت سازمانی --- */
:root {
    /* رنگ‌های اصلی سازمانی */
    --main-color: #016a68;
    --main-color-rgb: 1, 106, 104;
    --secondary-color: #1a3460;

    /* مپ کردن متغیرهای عملکردی به رنگ‌های سازمانی */
    --brand-color: var(--main-color);       /* سبز کله‌غازی برای دکمه‌ها و بوردرها */
    --brand-hover: var(--secondary-color);  /* سرمه‌ای برای حالت هاور دکمه */
    --brand-focus: rgba(var(--main-color-rgb), 0.15); /* هاله دور اینپوت‌ها */

    --bg-color: #f8f9fa;
    --text-main: #212529;
    --text-muted: #5f5c6b; /* استفاده از رنگ خاکستری خاص شما برای متون فرعی */
    --color-success: #24b02a;
}

/* ریست کلی برای جلوگیری از بهم ریختگی */
.login-wrapper * {
    box-sizing: border-box;
}

.login-wrapper {
    width: 100%;
    min-height: 85vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
    font-family: inherit;
}

/* --- تعریف انیمیشن Fade In Up --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card {
    width: 100%;
    max-width: 450px;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    padding: 40px;
    /* بوردر بسیار کمرنگ از رنگ اصلی */
    border: 1px solid rgba(var(--main-color-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 #e9ecef;
    border-radius: 14px;
    background-color: #fcfcfc;
    font-size: 0.95rem;
    color: #495057;
    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(--brand-hover); /* تغییر به سرمه‌ای در هاور */
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(var(--main-color-rgb), 0.3);
}

/* --- 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(--main-color-rgb), 0.08);
    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(--main-color-rgb), 0.15);
}
.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: #495057;
    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: #000000 !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;
}

/* لینک قوانین */
.register-form .link {
    color: var(--brand-color);
    text-decoration: none;
    border-bottom: 1px dashed var(--brand-color);
    transition: color 0.2s;
}
.register-form .link:hover {
    color: var(--brand-hover);
    border-bottom-style: solid;
}

/* --- اصلاح ارتفاع فیلد آدرس --- */
textarea.form-control-custom {
    height: auto !important;
    min-height: 120px;
    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(--color-success); /* استفاده از رنگ سبز موفقیت برای آیکون راهنما */
    margin-left: 6px;
    position: relative;
    top: 3px;
}
