/* ===== ESTILO ESPECÍFICO PARA FORMULÁRIOS ===== */
.form-container {
    background: #fff;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

/* GRID DE FORMULÁRIO - RESPONSIVO */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.2rem;
}

/* CORREÇÃO: RÓTULOS ALINHADOS À ESQUERDA (não centralizados) */
.form-group label {
    display: block;
    font-weight: 600;
    color: #1ac575;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    /* CORREÇÃO: Alinhamento natural à esquerda */
    text-align: center;
}

.form-control,
.form-select {
    width: 100%;
    padding: 0.9rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    background: #fafafa;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
    outline: none;
}

/* CAMPOS ESPECÍFICOS */
textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

input[type="date"],
input[type="datetime-local"] {
    font-family: 'Poppins', sans-serif;
}

/* GRUPO DE LARGURA TOTAL */
.form-group-full {
    grid-column: 1 / -1;
}

/* AÇÕES DO FORMULÁRIO - CORRIGIDO PARA SEMPRE VISÍVEL */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #f0f0f0;
    /* Garante que os botões sempre apareçam */
    visibility: visible;
    opacity: 1;
}

/* CORREÇÃO: GARANTIR QUE OS BOTÕES SEJAM SEMPRE VISÍVEIS */
.btn {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* FORMULÁRIOS COMPACTOS (para muitos campos) */
.form-compact .form-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.form-compact .form-control,
.form-compact .form-select {
    padding: 0.7rem;
    font-size: 0.9rem;
}

/* VALIDAÇÃO VISUAL */
.form-control:invalid {
    border-color: #dc3545;
}

.form-control:valid {
    border-color: #28a745;
}

/* PLACEHOLDER ESTILIZADO */
.form-control::placeholder {
    color: #999;
    font-style: italic;
}

/* GRUPO DE CAMPOS AGRUPADOS */
.field-group {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary);
    margin-bottom: 1.5rem;
}

.field-group legend {
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    text-align: center;
}

/* CORREÇÃO PARA CAMPOS DE BUSCA ESPECÍFICOS */
.search-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-container input {
    flex: 1;
    min-width: 200px;
}

/* GARANTIR VISIBILIDADE DOS BOTÕES NA BARRA DE AÇÕES */
.actions-bar .btn {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    white-space: nowrap;
}

/* CORREÇÃO PARA BOTÕES EM DISPOSITIVOS MÓVEIS */
@media (max-width: 768px) {
    .form-actions {
        flex-direction: column;
        justify-content: stretch;
    }

    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .actions-bar {
        flex-direction: column;
        gap: 15px;
    }

    .search-container {
        width: 100%;
    }

    .search-container input {
        min-width: 100%;
    }
}

/* ESTILOS ESPECÍFICOS PARA CAMPOS DE FORMULÁRIO EM TABELAS */
.licitacao-table input[type="text"],
.licitacao-table select {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9rem;
}

/* GARANTIR QUE TODOS OS ELEMENTOS DE FORMULÁRIO SEJAM VISÍVEIS */
input,
select,
textarea,
button,
.btn {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}