/**
 * Form Validation Styles
 */

/* Input field states */
.form-input {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: #6B7280;
    box-shadow: 0 0 0 2px rgba(107, 114, 128, 0.1);
}

/* Error state */
.form-input.border-red-500 {
    border-color: #EF4444 !important;
    border-width: 2px !important;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.1) !important;
}

.form-input.border-red-500:focus {
    border-color: #EF4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

/* Success state */
.form-input.border-green-500 {
    border-color: #10B981 !important;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.1) !important;
}

.form-input.border-green-500:focus {
    border-color: #10B981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15) !important;
}

/* Error message styling */
.form-validation-error {
    color: #EF4444;
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.form-validation-error::before {
    content: "⚠";
    font-size: 0.875rem;
}

/* Form container improvements */
.form-container {
    position: relative;
}

.form-group {
    margin-bottom: 1rem;
    position: relative;
}

/* Custom checkbox styling for agree terms */
input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 1rem;
    height: 1rem;
    border: 2px solid #D1D5DB;
    border-radius: 0.25rem;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

input[type="checkbox"]:checked {
    background-color: #3B82F6;
    border-color: #3B82F6;
}

input[type="checkbox"]:checked::after {
    content: "✓";
    position: absolute;
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Error state for checkbox */
input[type="checkbox"].border-red-500 {
    border-color: #EF4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.1);
}

/* Responsive improvements */
@media (max-width: 640px) {
    .form-validation-error {
        font-size: 0.7rem;
    }
}

/* Animation for error messages */
.form-validation-error {
    animation: slideInError 0.3s ease-out;
}

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

/* Loading state for form submission */
.form-submitting {
    pointer-events: none;
    opacity: 0.7;
}

.form-submitting button {
    cursor: not-allowed;
}

/* Success message styling */
.form-success {
    background-color: #D1FAE5;
    border: 1px solid #10B981;
    color: #047857;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-success::before {
    content: "✓";
    font-weight: bold;
    color: #10B981;
}

/* Utility classes for better form styling */
.input-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.input-label {
    position: absolute;
    left: 0.75rem;
    top: -0.5rem;
    background-color: white;
    padding: 0 0.25rem;
    font-size: 0.75rem;
    color: #6B7280;
    transition: all 0.3s ease;
}

.input-floating:focus + .input-label,
.input-floating:not(:placeholder-shown) + .input-label {
    transform: translateY(-1.5rem);
    font-size: 0.7rem;
    color: #3B82F6;
}