/* Broker Input Validation Styles */
/* Add to: frontend/assets/css/validation.css */

/* Validation Feedback Messages */
.validation-feedback {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    animation: slideDown 0.3s ease-out;
}

.validation-feedback.valid {
    color: #10b981;
    background-color: #d1fae5;
    border-left: 3px solid #10b981;
}

.validation-feedback.invalid {
    color: #ef4444;
    background-color: #fee2e2;
    border-left: 3px solid #ef4444;
}

/* Input Field States */
input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transition: all 0.2s ease;
}

input.validating {
    border-color: #f59e0b !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23f59e0b' viewBox='0 0 16 16'%3E%3Cpath d='M8 3a5 5 0 1 0 0 10A5 5 0 0 0 8 3zM1 8a7 7 0 1 1 14 0A7 7 0 0 1 1 8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
}

/* Password Requirements Display */
.validation-requirements {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background-color: #f9fafb;
    border-radius: 0.375rem;
    border: 1px solid #e5e7eb;
}

.validation-requirements ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.validation-requirements li {
    padding: 0.375rem 0;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

.validation-requirements li::before {
    content: '○';
    margin-right: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.validation-requirements li.requirement-met {
    color: #10b981;
}

.validation-requirements li.requirement-met::before {
    content: '✓';
    color: #10b981;
    font-weight: bold;
}

.validation-requirements li.requirement-unmet {
    color: #6b7280;
}

/* Form Group with Validation */
.form-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.form-group label span[style*="color: #ef4444"] {
    color: #ef4444 !important;
    margin-left: 0.25rem;
}

.form-group input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.375rem;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
}

.form-group input:hover {
    border-color: #d1d5db;
}

.form-group .form-hint {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    color: #6b7280;
}

/* Loading State for Database Validation */
.form-group.checking::after {
    content: '';
    position: absolute;
    right: 0.75rem;
    top: 2.5rem;
    width: 1rem;
    height: 1rem;
    border: 2px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-0.5rem);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Submit Button States */
#submit-btn {
    padding: 0.75rem 1.5rem;
    background-color: #3b82f6;
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

#submit-btn:hover:not(:disabled) {
    background-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

#submit-btn:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Error Summary */
.validation-errors {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: #fee2e2;
    border-left: 4px solid #ef4444;
    border-radius: 0.375rem;
}

.validation-errors h4 {
    margin: 0 0 0.5rem 0;
    color: #dc2626;
    font-size: 0.9375rem;
    font-weight: 600;
}

.validation-errors ul {
    margin: 0;
    padding-left: 1.25rem;
}

.validation-errors li {
    color: #991b1b;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

/* Success States */
.form-group.validated-success input {
    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");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
}

.form-group.validated-error input {
    border-color: #ef4444 !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='M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .form-group input {
        font-size: 16px;
        /* Prevents zoom on iOS */
    }

    .validation-feedback {
        font-size: 0.8125rem;
        padding: 0.375rem 0.625rem;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .validation-requirements {
        background-color: #1f2937;
        border-color: #374151;
    }

    .form-group label {
        color: #e5e7eb;
    }

    .form-group input {
        background-color: #1f2937;
        border-color: #374151;
        color: #e5e7eb;
    }

    .form-group input:hover {
        border-color: #4b5563;
    }

    .form-hint {
        color: #9ca3af;
    }
}