/* Form Input Visibility Fix - Force visible text colors */

/* Input fields - always have dark text on white background */
input[type="text"],
input[type="email"], 
input[type="password"],
input[type="tel"],
input[type="date"],
input[type="number"],
textarea,
select {
    background-color: #ffffff !important;
    color: #1f2937 !important;
    border: 1px solid #d1d5db !important;
    -webkit-text-fill-color: #1f2937 !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

/* TEXT SELECTION FIX - Prevent text from vanishing when selected */
/* Higher specificity to override global selection styles */
form input[type="text"]::selection,
form input[type="email"]::selection, 
form input[type="password"]::selection,
form input[type="tel"]::selection,
form input[type="date"]::selection,
form input[type="number"]::selection,
form textarea::selection,
input[type="text"]::selection,
input[type="email"]::selection, 
input[type="password"]::selection,
input[type="tel"]::selection,
input[type="date"]::selection,
input[type="number"]::selection,
textarea::selection {
    background-color: #3b82f6 !important;
    background-image: none !important;
    color: #ffffff !important;
}

/* Firefox selection fix with higher specificity */
form input[type="text"]::-moz-selection,
form input[type="email"]::-moz-selection, 
form input[type="password"]::-moz-selection,
form input[type="tel"]::-moz-selection,
form input[type="date"]::-moz-selection,
form input[type="number"]::-moz-selection,
form textarea::-moz-selection,
input[type="text"]::-moz-selection,
input[type="email"]::-moz-selection, 
input[type="password"]::-moz-selection,
input[type="tel"]::-moz-selection,
input[type="date"]::-moz-selection,
input[type="number"]::-moz-selection,
textarea::-moz-selection {
    background-color: #3b82f6 !important;
    background-image: none !important;
    color: #ffffff !important;
}

/* Input placeholders */
input::placeholder,
textarea::placeholder {
    color: #6b7280 !important;
}

/* Focus states */
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #3b82f6 !important;
    outline-offset: 2px !important;
    border-color: #3b82f6 !important;
}

/* Labels - ensure they're visible */
label {
    color: #374151 !important;
}

/* Form containers */
.form-container {
    background-color: #ffffff !important;
    color: #1f2937 !important;
}

/* Override any dark mode styles that might interfere */
.dark input[type="text"],
.dark input[type="email"], 
.dark input[type="password"],
.dark input[type="tel"],
.dark input[type="date"],
.dark input[type="number"],
.dark textarea,
.dark select {
    background-color: #ffffff !important;
    color: #1f2937 !important;
    border: 1px solid #d1d5db !important;
}

/* Dark mode selection fix */
.dark input[type="text"]::selection,
.dark input[type="email"]::selection, 
.dark input[type="password"]::selection,
.dark input[type="tel"]::selection,
.dark input[type="date"]::selection,
.dark input[type="number"]::selection,
.dark textarea::selection {
    background-color: #3b82f6 !important;
    color: #ffffff !important;
}

.dark input[type="text"]::-moz-selection,
.dark input[type="email"]::-moz-selection, 
.dark input[type="password"]::-moz-selection,
.dark input[type="tel"]::-moz-selection,
.dark input[type="date"]::-moz-selection,
.dark input[type="number"]::-moz-selection,
.dark textarea::-moz-selection {
    background-color: #3b82f6 !important;
    color: #ffffff !important;
}

.dark label {
    color: #374151 !important;
}

.dark .form-container {
    background-color: #ffffff !important;
    color: #1f2937 !important;
}

/* Additional fixes for text selection issues */
* {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
}

/* Ensure all text remains visible */
input, textarea, select {
    -webkit-text-fill-color: #1f2937 !important;
    -webkit-opacity: 1 !important;
    opacity: 1 !important;
}

/* Fix for webkit autofill that might cause text to vanish */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0px 1000px #ffffff inset !important;
    -webkit-text-fill-color: #1f2937 !important;
    border: 1px solid #d1d5db !important;
}

/* Prevent any transform or opacity issues */
input, textarea, select {
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
}
