/* Nova Tools - Form Styles */

/* Form Messages */
.form-message {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    font-size: 0.9rem;
    font-weight: 500;
    animation: slideIn 0.3s ease-out;
}

.form-message.success {
    background: #f0f9ef;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.form-message.error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.form-message i {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Field Errors */
.field-error {
    display: block;
    color: #dc2626;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    font-weight: 500;
}

input.error,
textarea.error {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* Loading States */
.btn.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    color: white;
}

/* Form Improvements */
.form-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #374151;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: #fff;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* Required field indicator */
.form-group label.required::after {
    content: " *";
    color: #dc2626;
}

/* Character count for textarea */
.char-count {
    font-size: 0.8rem;
    color: #6b7280;
    text-align: right;
    margin-top: 0.25rem;
}

.char-count.warning {
    color: #d97706;
}

.char-count.error {
    color: #dc2626;
}

/* Form animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Newsletter form specific */
.newsletter-form {
    max-width: 400px;
    margin: 0 auto;
}

.newsletter-input {
    display: flex;
    gap: 0.5rem;
}

.newsletter-input input {
    flex: 1;
    border-radius: 8px 0 0 8px;
}

.newsletter-input .btn {
    border-radius: 0 8px 8px 0;
    padding: 0.75rem 1.5rem;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .newsletter-input {
        flex-direction: column;
    }
    
    .newsletter-input input,
    .newsletter-input .btn {
        border-radius: 8px;
    }
}

/* Form success states */
.form-success {
    text-align: center;
    padding: 2rem;
    background: #f0f9ef;
    border-radius: 8px;
    border: 1px solid #bbf7d0;
}

.form-success h3 {
    color: #166534;
    margin: 0 0 1rem 0;
}

.form-success p {
    color: #166534;
    margin: 0;
}