/**
 * Correção para inputs em fundos escuros
 * DAG Forms - Input Focus Fix
 * Versão simplificada
 */

/* REGRA PRINCIPAL - Máxima prioridade para sobrescrever Bootstrap */
.form-control:focus,
.form-select:focus,
textarea.form-control:focus {
    background-color: inherit !important;
    border-color: #86b7fe !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Apenas para fundos REALMENTE escuros com classe específica */
.dark-background .form-control,
.dark-background .form-select,
.dark-background textarea.form-control {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    color: #ffffff !important;
}

.dark-background .form-control:focus,
.dark-background .form-select:focus,
.dark-background textarea.form-control:focus {
    background-color: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.6) !important;
    box-shadow: none !important;
    color: #ffffff !important;
    outline: none !important;
}

.dark-background .form-control::placeholder,
.dark-background .form-select::placeholder,
.dark-background textarea.form-control::placeholder {
    color: rgba(255, 255, 255, 0.6) !important;
}

.dark-background .form-label {
    color: #ffffff !important;
}

/* Classe específica para detecção automática - apenas fundos muito escuros */
.auto-dark-input {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    color: #ffffff !important;
    transition: all 0.3s ease;
}

.auto-dark-input:focus {
    background-color: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.6) !important;
    box-shadow: none !important;
    color: #ffffff !important;
    outline: none !important;
}

.auto-dark-input::placeholder {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* Responsividade */
@media (max-width: 768px) {
    .dark-background .form-control,
    .auto-dark-input {
        font-size: 16px; /* Previne zoom no iOS */
    }
}

/* Animações suaves */
.form-control,
.form-select {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease !important;
}
