/* ===================================================================
   SUBLIMA AE FORM — Modello Replicabile Anagrafiche BS5
   ===================================================================
   Classi standard per tutte le form ae_*.html (semplici e complesse).
   Garantisce coerenza visiva: header → sezioni → footer sempre uguali.
   Colori dal Pantone system (--sublima-burgundy, --gray-*, --bs5-*).
   =================================================================== */

/* --- HEADER BANNER --- */
.ae-header {
    background: linear-gradient(135deg, var(--sublima-burgundy, #8B0000) 0%, var(--sublima-burgundy-light, #A52A2A) 100%);
    padding: 14px 0 12px 0;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(60, 60, 60, 0.10);
}

.ae-header h2 {
    font-weight: 700;
    letter-spacing: 2px;
    font-size: 1.6rem;
    margin: 0;
    color: #fff;
    text-align: center;
}

.ae-header h2 i {
    margin-right: 8px;
}

/* --- SEZIONE CARD --- */
.ae-section {
    margin-bottom: 16px;
    border: 1px solid var(--gray-300, #dee2e6);
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.ae-section-header {
    background: linear-gradient(90deg, var(--gray-100, #f8f9fa) 0%, var(--gray-200, #e9ecef) 100%);
    border-bottom: 1px solid var(--gray-300, #dee2e6);
    padding: 10px 16px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gray-800, #343a40);
    letter-spacing: 0.03em;
}

.ae-section-header i {
    margin-right: 6px;
    color: var(--sublima-burgundy, #8B0000);
}

.ae-section > .card-body {
    padding: 16px;
}

/* --- FORM TYPOGRAPHY (scoped a #ae_form) --- */
#ae_form .form-label,
#ae_form label.form-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--gray-800, #343a40);
    margin-bottom: 4px;
    letter-spacing: 0.02em;
}

#ae_form .form-control,
#ae_form .form-select {
    font-size: 0.95rem;
}

#ae_form .form-control::placeholder {
    color: var(--gray-500, #adb5bd);
    font-weight: 400;
}

/* --- SWITCH BS5 dentro ae_form --- */
#ae_form .form-check.form-switch {
    padding-top: 6px;
}

#ae_form .form-check.form-switch .form-check-input {
    width: 2.8em;
    height: 1.4em;
    cursor: pointer;
}

#ae_form .form-check.form-switch .form-check-label {
    font-size: 0.88rem;
    font-weight: 400;
    cursor: pointer;
    padding-top: 2px;
}

/* --- NOTE / AVVERTENZE sotto i campi --- */
#ae_form .ae-field-note {
    font-size: 0.8rem;
    color: var(--gray-600, #6c757d);
    margin-top: 4px;
    line-height: 1.35;
}

#ae_form .ae-field-warning {
    font-size: 0.8rem;
    color: var(--bs5-danger, #dc3545);
    margin-top: 4px;
    font-weight: 500;
    line-height: 1.35;
}

/* --- FOOTER BOTTONI --- */
.ae-actions {
    display: flex;
    gap: 12px;
    padding: 20px 0 8px 0;
    border-top: 1px solid var(--gray-200, #e9ecef);
    margin-top: 8px;
}

.ae-actions .btn {
    min-width: 120px;
    font-weight: 600;
    font-size: 0.95rem;
}

.ae-actions .btn i {
    font-size: 1rem;
}

/* --- SELECT2 DENTRO AE_FORM (fix altezza coerente) --- */
#ae_form .select2-container--bootstrap-5 .select2-selection {
    min-height: calc(1.5em + 0.75rem + 2px);
    font-size: 0.95rem;
}

/* --- SIDEBAR NAV BUTTONS (tab laterali ae_articolo / ae_cliente) --- */
.ae-sidebar-btn {
    background: linear-gradient(90deg, var(--sublima-burgundy, #8B0000) 0%, var(--sublima-burgundy-light, #A52A2A) 100%);
    color: #fff;
    font-weight: 600;
    margin-bottom: 4px;
    border-radius: 10px;
    border: none;
}

.ae-sidebar-btn:hover,
.ae-sidebar-btn:focus {
    background: linear-gradient(90deg, var(--sublima-burgundy-dark, #6B0000) 0%, var(--sublima-burgundy, #8B0000) 100%);
    color: #fff;
}

.ae-sidebar-btn i {
    margin-left: 6px;
    color: rgba(255, 255, 255, 0.85);
}

.ae-sidebar-btn .list-group-item {
    background: transparent;
    color: inherit;
    font-size: 1rem;
    font-weight: 500;
    border: none;
}

/* --- RESPONSIVE --- */
@media (max-width: 575.98px) {
    .ae-header h2 {
        font-size: 1.25rem;
        letter-spacing: 1px;
    }

    .ae-section-header {
        font-size: 0.85rem;
        padding: 8px 12px;
    }

    .ae-actions {
        flex-direction: column;
    }

    .ae-actions .btn {
        width: 100%;
    }
}
