/* static/css/pages/login.css */

/* ریست کلی برای جلوگیری از بهم ریختگی */
.login-wrapper * {
    box-sizing: border-box;
}

/* =========================
   Brand Variables (Org Theme)
   ========================= */
:root {
    /* اتصال مستقیم به رنگ سازمانی: فقط این قسمت تغییر کرده */
    --brand-color: var(--main-color);
    --brand-hover: #d9550f; /* نسخه تیره‌تر نارنجی اصلی */
    --brand-focus: rgba(var(--main-color-rgb), 0.15); /* شفافیت نارنجی برای فوکوس */

    /* پس‌زمینه کارت: تغییر از #f5f8ff به نارنجی کم‌رنگ‌تر */
    --bg-color: #fff8f3;

    --text-main: #333;
    --text-muted: #777;
}

/* =========================
   Layout
   ========================= */
.login-wrapper {
    width: 100%;
    min-height: 85vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
    font-family: inherit;
}

/* =========================
   Animations
   ========================= */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================
   Card
   ========================= */
.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.08);
    position: relative;
    overflow: hidden;
    text-align: center;
    animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* =========================
   Header
   ========================= */
.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 #f1e4dc;
    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: #b8a399;
    font-size: 1.2rem;
    pointer-events: none;
}

.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.25s ease;
    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.35);
}

/* =========================
   Segmented Tabs
   ========================= */
.segmented-control {
    display: flex;
    /* پس‌زمینه تب‌ها: تغییر از #f1f3f5 به نارنجی خیلی کم‌رنگ */
    background: #fff1e8;
    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: #9a6a52;
    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 4px 12px rgba(var(--main-color-rgb), 0.15);
}

/* =========================
   Verify Page
   ========================= */
.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.18);
}

.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;
}

/* =========================
   Timer
   ========================= */
.timer-container {
    margin-top: 25px;
    /* پس‌زمینه تایمر: تغییر به نارنجی کم‌رنگ */
    background: #fff3ea;
    /* رنگ متن تایمر: تغییر به قهوه‌ای/نارنجی */
    color: #6b4a3b;
    padding: 10px;
    border-radius: 12px;
    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); }
}

/* =========================
   Inputs Special (بدون تغییر)
   ========================= */
.fa-num {
    font-family: "Vazir", "Yekan", sans-serif;
}

#mobileInput,
#passwordInput {
    font-weight: 800 !important;
    color: #000 !important;
    font-size: 1.2rem;
    letter-spacing: 2px;
}

#mobileInput::placeholder,
#passwordInput::placeholder {
    font-weight: 400 !important;
    color: #b8a399 !important;
    font-size: 0.95rem;
    letter-spacing: normal;
}

/* =========================
   Register Page (بدون تغییر)
   ========================= */
.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);
}

/* =========================
   Textarea (بدون تغییر)
   ========================= */
textarea.form-control-custom {
    height: auto !important;
    min-height: 120px;
    padding-top: 15px;
    padding-bottom: 15px;
    line-height: 1.6;
    resize: vertical;
}

/* =========================
   Password Hint
   ========================= */
.password-hint {
    font-size: 0.85rem;
    /* رنگ متن: تغییر به قهوه‌ای/نارنجی */
    color: #6b4a3b;
    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;
}

/* =========================
   Responsive (بدون تغییر)
   ========================= */
@media (max-width: 500px) {
    .login-card {
        padding: 30px 20px;
    }
    .segmented-control {
        flex-direction: column;
    }
    .otp-input {
        font-size: 1.5rem;
        letter-spacing: 8px;
    }
}
