/* ============================================
   FORM VALIDATION STYLES - حرفه‌ای
   ============================================ */
.form-group {
    position: relative;
    margin-bottom: 18px;
}

/* فیلد معتبر */
.form-control.valid,
.form-group input.valid,
.form-group textarea.valid,
.auth-form input.valid {
    border-color: #10b981 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2310b981' viewBox='0 0 16 16'%3E%3Cpath d='M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: left 12px center !important;
    padding-left: 36px !important;
}

/* فیلد نامعتبر */
.form-control.invalid,
.form-group input.invalid,
.form-group textarea.invalid,
.auth-form input.invalid {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23ef4444' viewBox='0 0 16 16'%3E%3Cpath d='M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z'/%3E%3Cpath d='M7.002 11a1 1 0 1 1 2 0 1 1 0 0 1-2 0zM7.1 4.995a.905.905 0 1 1 1.8 0l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 4.995z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: left 12px center !important;
    padding-left: 36px !important;
    animation: shake 0.4s ease;
}

/* پیام خطای inline */
.field-error {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #ef4444;
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 6px;
    padding-right: 4px;
    animation: slideDown 0.3s ease;
}

.field-error::before {
    content: "\26A0";
    font-size: 0.85rem;
}

.field-success {
    color: #10b981;
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 6px;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* حالت تاریک */
.theme-dark .form-control.invalid,
.theme-dark .form-group input.invalid,
.theme-dark .form-group textarea.invalid,
.theme-dark .auth-form input.invalid {
    background-color: rgba(239, 68, 68, 0.1) !important;
}

.theme-dark .field-error {
    color: #fca5a5;
}

/* شمارش کاراکتر */
.char-counter {
    font-size: 0.72rem;
    color: #94a3b8;
    text-align: left;
    margin-top: 4px;
}

.char-counter.warn { color: #f59e0b; }
.char-counter.danger { color: #ef4444; }
