/**
 * FORM VALIDATION STYLES
 * 
 * Visual feedback for email and phone validation
 */

/* Input field states */
input.valid {
    border-color: #10b981 !important;
    background-color: #f0fdf4 !important;
}

input.invalid {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
}

/* Validation feedback messages */
.validation-feedback {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    min-height: 1.25rem;
    transition: all 0.2s ease;
}

.validation-feedback.valid {
    color: #10b981;
}

.validation-feedback.invalid {
    color: #ef4444;
}

/* Suggestion button for email typos */
.suggestion-btn {
    margin-top: 0.5rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #2563eb;
    background-color: #eff6ff;
    border: 1px solid #2563eb;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.suggestion-btn:hover {
    background-color: #2563eb;
    color: white;
}

/* Input focus states with validation */
input.valid:focus {
    outline: none;
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

input.invalid:focus {
    outline: none;
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Loading/validating state */
input.validating {
    border-color: #f59e0b !important;
    background-color: #fffbeb !important;
}

/* Form field container */
.form-field {
    margin-bottom: 1.5rem;
}

/* Validation icons (optional - using emoji in JS instead) */
.validation-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.25rem;
    pointer-events: none;
}

.validation-icon.valid {
    color: #10b981;
}

.validation-icon.invalid {
    color: #ef4444;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .validation-feedback {
        font-size: 0.8125rem;
    }
    
    .suggestion-btn {
        font-size: 0.8125rem;
        padding: 0.25rem 0.5rem;
    }
}

/* Accessibility: High contrast mode support */
@media (prefers-contrast: high) {
    input.valid {
        border-width: 2px;
        border-color: #059669 !important;
    }
    
    input.invalid {
        border-width: 2px;
        border-color: #dc2626 !important;
    }
}

/* Animation for validation feedback appearing */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-0.5rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.validation-feedback {
    animation: slideDown 0.2s ease;
}

/* Phone number formatting hint */
.phone-hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: #6b7280;
    font-style: italic;
}

/* Email hint */
.email-hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: #6b7280;
    font-style: italic;
}

/* Required field indicator */
.required {
    color: #ef4444;
    margin-left: 0.25rem;
}

/* Submit button disabled state when form invalid */
button[type="submit"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button[type="submit"]:disabled:hover {
    background-color: inherit;
    transform: none;
}
