/* css/modal.css */

/* پشت‌زمینه تیره مودال */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
    display: flex;
}

/* محفظه اصلی مودال */
.modal-container {
    background: white;
    width: 90%;
    max-width: 450px;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: slideUp 0.3s ease;
    direction: rtl;
}

/* انیمیشن‌ها */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* هدر مودال */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.modal-header h3 {
    margin: 0;
    color: white;
    font-size: 1.3rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.2s;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    transform: scale(1.1);
    background: rgba(255,255,255,0.2);
}

/* تب‌های ورود و ثبت‌نام */
.modal-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    padding: 15px;
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-light);
    transition: all 0.2s;
    position: relative;
}

.tab-btn.active {
    color: var(--primary-color);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-color);
}

/* محتوای فرم‌ها */
.modal-body {
    padding: 25px;
}

.form-tab {
    display: none;
}

.form-tab.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* استایل فرم‌ها */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.2s;
    outline: none;
    box-sizing: border-box;
}

.form-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* دکمه ارسال فرم */
.submit-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.3);
}

.submit-btn:disabled {
    opacity: 0.6;
    transform: none;
}

/* پیام خطا و موفقیت */
.form-message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.85rem;
    text-align: center;
    display: none;
}

.form-message.error {
    background: #fee2e2;
    color: #dc2626;
    display: block;
}

.form-message.success {
    background: #dcfce7;
    color: #16a34a;
    display: block;
}

/* لینک فراموشی رمز */
.forgot-link {
    text-align: left;
    margin-top: 10px;
}

.forgot-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.85rem;
}

.forgot-link a:hover {
    text-decoration: underline;
}

/* جداساز */
.divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-color);
}

.divider span {
    background: white;
    padding: 0 15px;
    position: relative;
    color: var(--text-light);
    font-size: 0.85rem;
}

