﻿/* wwwroot/css/applogin.css */

/* ============================================================
   🎨 متغیرها
   ============================================================ */
:root {
    --primary: #0D9276;
    --primary-dark: #0a7d65;
    --primary-darker: #075e4a;
    --primary-gradient: linear-gradient(135deg, #0D9276, #075e4a);
    --primary-gradient-light: linear-gradient(135deg, #0D9276, #0a7d65);
    --secondary: #f8f9fa;
    --text-primary: #2c3e50;
    --text-secondary: #6c757d;
    --text-light: #ffffff;
    --card-border: #e9ecef;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-xl: 20px;
    --error: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    --accent: #FF6B35;
}

/* ============================================================
   📱 BASE
   ============================================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
    background: linear-gradient(135deg, #f0f9f7 0%, #e8f5f1 100%);
}

.login-wrapper {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

.login-container {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 0;
    min-height: 650px;
    border-radius: var(--border-radius-xl);
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
    background: white;
}

/* ============================================================
   📝 فرم ورود
   ============================================================ */
.login-form-side {
    background: white;
    padding: 3rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow-y: auto;
}

.login-form-container {
    max-width: 450px;
    margin: 0 auto;
    width: 100%;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.login-logo-icon {
    font-size: 2.5rem;
    color: var(--primary);
}

.login-logo-text {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--primary-darker);
}

.login-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ============================================================
   📋 فرم‌ها
   ============================================================ */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    position: relative;
}

.form-label {
    display: block;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .form-label i {
        color: var(--primary);
        font-size: 1rem;
    }

.form-control, .form-select {
    width: 100%;
    padding: 0.85rem 1rem;
    background: var(--secondary);
    border: 2px solid var(--card-border);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    min-height: 48px;
}

    .form-control:focus,
    .form-select:focus {
        outline: none;
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(13, 146, 118, 0.1);
    }

.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%230D9276' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left 1rem center;
    background-size: 14px;
    padding-left: 2.5rem;
    cursor: pointer;
    appearance: none;
}

/* ============================================================
   🔐 رمز عبور
   ============================================================ */
.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.3s;
}

    .password-toggle:hover {
        color: var(--primary);
        background: rgba(13, 146, 118, 0.1);
    }

.password-wrapper .form-control {
    padding-left: 50px;
}

/* ============================================================
   ✅ اعتبارسنجی
   ============================================================ */
.validation-error {
    display: none;
    color: var(--error);
    font-size: 0.8rem;
    margin-top: 0.4rem;
    padding: 0.4rem 0.5rem;
    background: rgba(239, 68, 68, 0.05);
    border-radius: 6px;
    border-right: 3px solid var(--error);
}

    .validation-error.show {
        display: flex;
        align-items: center;
        gap: 0.4rem;
    }

.form-control.error,
.form-select.error {
    border-color: var(--error);
}

.form-control.success,
.form-select.success {
    border-color: var(--success);
}

/* ============================================================
   🎯 دکمه‌ها
   ============================================================ */
.submit-btn {
    background: var(--primary-gradient-light);
    color: white;
    border: none;
    padding: 0.9rem;
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 8px 20px rgba(13, 146, 118, 0.2);
}

    .submit-btn:hover {
        background: var(--primary-dark);
        transform: translateY(-2px);
        box-shadow: 0 12px 25px rgba(13, 146, 118, 0.25);
    }

    .submit-btn:disabled {
        opacity: 0.7;
        cursor: not-allowed;
        transform: none !important;
    }

.btn-loader {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.face-login-btn {
    background: linear-gradient(135deg, #FF6B35, #FF8C5A);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

    .face-login-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(255, 107, 53, 0.3);
    }

/* ============================================================
   🎨 ویژگی‌ها
   ============================================================ */
.features-side {
    background: var(--primary-gradient);
    padding: 3rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: white;
}

.features-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    padding-bottom: 0.75rem;
    position: relative;
}

    .features-title::after {
        content: '';
        position: absolute;
        bottom: 0;
        right: 0;
        width: 50px;
        height: 3px;
        background: var(--accent);
        border-radius: 2px;
    }

.features-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.feature-icon {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.feature-content h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.feature-content p {
    font-size: 0.85rem;
    opacity: 0.9;
    line-height: 1.5;
}

/* ============================================================
   🔴 خطاها
   ============================================================ */
.error-container {
    display: none;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error);
    border-radius: var(--border-radius-sm);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

    .error-container.show {
        display: block;
    }

.error-title {
    color: var(--error);
    font-weight: 600;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.error-message {
    color: var(--error);
    font-size: 0.85rem;
}

/* ============================================================
   🎭 مودال
   ============================================================ */
.face-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

    .face-modal.show {
        display: flex;
    }

.face-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
}

.face-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    width: 500px;
    max-width: 100%;
    z-index: 1;
    overflow: hidden;
}

.face-modal-header {
    background: linear-gradient(135deg, #FF6B35, #FF8C5A);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.face-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.face-modal-body {
    padding: 1.5rem;
}

.btn-capture {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

/* ============================================================
   🎬 انیمیشن‌ها
   ============================================================ */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }

    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }

    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.5s ease;
}

.login-form-side::-webkit-scrollbar {
    width: 4px;
}

.login-form-side::-webkit-scrollbar-track {
    background: transparent;
}

.login-form-side::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 10px;
}

/* ============================================================
   📱 RESPONSIVE - Tablet (768px - 992px)
   ============================================================ */
@media (max-width: 992px) {
    .login-container {
        grid-template-columns: 1fr;
        max-width: 550px;
        margin: 0 auto;
        min-height: auto;
    }

    .features-side {
        order: -1;
        padding: 2rem;
    }

    .login-form-side {
        padding: 2.5rem 2rem;
    }

    .features-list {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .feature-item {
        flex-direction: column;
        text-align: center;
        align-items: center;
        gap: 0.5rem;
    }

    .features-title {
        text-align: center;
        font-size: 1.3rem;
        margin-bottom: 1.5rem;
    }

        .features-title::after {
            right: 50%;
            transform: translateX(50%);
        }
}

/* ============================================================
   📱 RESPONSIVE - Mobile (تا 768px)
   ============================================================ */
@media (max-width: 768px) {
    .login-page {
        padding: 0.5rem;
        align-items: flex-start;
    }

    .login-container {
        border-radius: 16px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    }

    .features-side {
        padding: 1.5rem;
    }

    .login-form-side {
        padding: 1.5rem;
    }

    .login-form-container {
        max-width: 100%;
    }

    .features-list {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .feature-item {
        flex-direction: row;
        text-align: right;
        align-items: center;
        gap: 0.75rem;
    }

    .feature-icon {
        width: 38px;
        height: 38px;
        font-size: 0.9rem;
    }

    .feature-content h4 {
        font-size: 0.9rem;
    }

    .feature-content p {
        font-size: 0.8rem;
    }

    .login-logo-text {
        font-size: 1.5rem;
    }

    .login-title {
        font-size: 1.3rem;
    }

    .login-subtitle {
        font-size: 0.85rem;
    }

    .form-control, .form-select {
        padding: 0.7rem 0.85rem;
        font-size: 0.9rem;
        min-height: 44px;
    }

    .submit-btn {
        padding: 0.75rem;
        font-size: 0.95rem;
    }
}

/* ============================================================
   📱 RESPONSIVE - Small Mobile (تا 480px)
   ============================================================ */
@media (max-width: 480px) {
    .login-page {
        padding: 0;
    }

    .login-container {
        border-radius: 0;
        min-height: 100vh;
    }

    .features-side {
        padding: 1.25rem;
    }

    .login-form-side {
        padding: 1.25rem;
    }

    .login-header {
        margin-bottom: 1.5rem;
    }

    .login-logo-icon {
        font-size: 2rem;
    }

    .login-logo-text {
        font-size: 1.3rem;
    }

    .login-title {
        font-size: 1.2rem;
    }

    .features-title {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }

    .feature-item {
        gap: 0.5rem;
    }

    .feature-content h4 {
        font-size: 0.85rem;
    }

    .feature-content p {
        font-size: 0.75rem;
        line-height: 1.4;
    }

    .form-label {
        font-size: 0.8rem;
    }

    .form-control, .form-select {
        font-size: 0.85rem;
        min-height: 42px;
        padding: 0.6rem 0.75rem;
    }
}

/* ============================================================
   🔥 استایل‌های جدید برای ورود چند مرحله‌ای
   ============================================================ */

/* ========== مراحل ========== */
.login-step {
    animation: fadeInStep 0.4s ease;
}

@keyframes fadeInStep {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.step-title {
    font-size: 1rem;
    font-weight: 700;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #f0fdf9;
    border-radius: 10px;
    border-right: 4px solid #0D9276;
    margin-bottom: 15px;
}

    .step-title i {
        font-size: 1.2rem;
        color: #0D9276;
    }

/* ========== کارت‌های انتخاب نوع کاربر ========== */
.user-type-selection {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.user-type-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    background: white;
}

    .user-type-card:hover {
        border-color: #0D9276;
        background: #f0fdf9;
    }

    .user-type-card.active {
        border-color: #0D9276;
        background: #f0fdf9;
        box-shadow: 0 3px 12px rgba(13, 146, 118, 0.12);
    }

.user-type-icon {
    width: 45px;
    height: 45px;
    min-width: 45px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.user-type-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

    .user-type-info strong {
        font-size: 0.9rem;
        color: #333;
    }

    .user-type-info small {
        font-size: 0.75rem;
        color: #6c757d;
        margin-top: 2px;
    }

.user-type-check {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: transparent;
    flex-shrink: 0;
    transition: all 0.3s;
    background: white;
}

.user-type-card.active .user-type-check {
    background: #0D9276;
    border-color: #0D9276;
    color: white;
}

/* ========== نمایش کاربر انتخاب شده ========== */
.selected-user-type {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #f0fdf9;
    border-radius: 10px;
    border: 1px solid #D1ECE5;
    font-weight: 600;
    color: #0B755D;
    font-size: 0.85rem;
}

/* ========== دکمه بازگشت ========== */
.btn-back {
    background: white;
    color: #666;
    border: 1px solid #e0e0e0;
    padding: 0.7rem 1.2rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

    .btn-back:hover {
        background: #f8f9fa;
        color: #333;
    }

/* ========== SweetAlert2 سفارشی ========== */
.fiscal-year-swal-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s;
    background: white;
    margin-bottom: 8px;
}

    .fiscal-year-swal-item:hover {
        border-color: #0D9276;
        background: #f0fdf9;
    }

    .fiscal-year-swal-item.selected {
        border-color: #0D9276;
        background: #f0fdf9;
        box-shadow: 0 3px 12px rgba(13, 146, 118, 0.12);
    }

/* ========== ریسپانسیو مراحل ========== */
@media (max-width: 480px) {
    .step-title {
        font-size: 0.9rem;
        padding: 8px 12px;
    }

    .user-type-card {
        padding: 12px 14px;
        gap: 10px;
    }

    .user-type-icon {
        width: 40px;
        height: 40px;
        min-width: 40px;
        font-size: 1rem;
    }

    .user-type-info strong {
        font-size: 0.85rem;
    }

    .user-type-info small {
        font-size: 0.7rem;
    }

    .btn-back {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
}

/* ========== مرحله 3 - لیست سال‌های مالی ========== */
.fiscal-years-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    padding: 5px;
}

    .fiscal-years-container::-webkit-scrollbar {
        width: 5px;
    }

    .fiscal-years-container::-webkit-scrollbar-thumb {
        background: #D1ECE5;
        border-radius: 10px;
    }

.fiscal-year-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s;
    background: white;
}

    .fiscal-year-option:hover {
        border-color: #0D9276;
        background: #f0fdf9;
    }

    .fiscal-year-option.selected {
        border-color: #0D9276;
        background: #f0fdf9;
        box-shadow: 0 3px 12px rgba(13, 146, 118, 0.12);
    }

    .fiscal-year-option .fy-info {
        display: flex;
        flex-direction: column;
        flex: 1;
    }

        .fiscal-year-option .fy-info strong {
            font-size: 0.9rem;
            color: #333;
        }

        .fiscal-year-option .fy-info small {
            font-size: 0.72rem;
            margin-top: 2px;
        }

.fy-last-badge {
    font-size: 0.6rem;
    background: #0D9276;
    color: white;
    padding: 3px 8px;
    border-radius: 20px;
    font-weight: 700;
    flex-shrink: 0;
}

.fy-check-circle {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
    transition: all 0.3s;
}
