html {
    height: 100%;

}

body {
    font-family: 'Lato', sans-serif;
    background-color: #f4f4f4;
    margin: 0;
    padding: 0;
    min-height: fit-content;
    min-height: 100vh;
    
}

/* Overlay loader generazione cumulativo Allegato 4B */
.overlay-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.overlay-loader .overlay-content { max-width: 320px; }

/* Pulsante download cumulativo */
.btn-download {
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    line-height: 1.2;
    white-space: nowrap;
}
.btn-download .download-text { font-weight: 500; }

form {
    width: 100%;
}

.dashboard {
    display: flex;
}

/* .active {
    background-color: #c9c9c9 !important;

} */

.full-height {
    height: 100%;
}

.main {
    display: flex;
    flex-direction: row;
    flex-grow: 1;
    min-height: 100vh;
}

.main_frontend {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.password-container {
    position: relative;
}

.toggle-password {
    cursor: pointer;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 16px;
    z-index: 10;
}

.password-match-container {
    margin-top: 5px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    padding: 8px;
    border-radius: 4px;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #e9ecef;
}

.password-match-container .text-success {
    color: #28a745 !important;
}

.password-match-container .text-danger {
    color: #dc3545 !important;
}

/* Stili per reset password */
.reset-password-main {
    min-height: 100vh;
}

.reset-password-form {
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    max-width: 500px;
    width: 100%;
}

.password-requirements {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 10px;
}

.requirement {
    display: flex;
    align-items: center;
    margin-bottom: 2px;
    font-size: 0.875rem;
}

.requirement.valid {
    color: #28a745;
}

.requirement.invalid {
    color: #dc3545;
}

.requirement .req-icon {
    margin-right: 8px;
    font-weight: bold;
    display: inline-block;
    width: 20px;
}

#password-match {
    padding: 5px;
}

.password-strength {
    margin-top: 10px;
}

.strength-bar {
    height: 6px;
    background-color: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 5px;
}

.strength-bar-fill {
    height: 100%;
    transition: width 0.3s ease, background-color 0.3s ease;
    width: 0%;
}

.strength-weak { background-color: #dc3545; }
.strength-fair { background-color: #ffc107; }
.strength-good { background-color: #fd7e14; }
.strength-strong { background-color: #28a745; }

.sidebar {
    width: 80px; /* Larghezza ridotta */
    height: 100vh;
    background-color: #333;
    padding: 20px;
    transition: width 0.5s; /* Effetto di transizione fluido */
    overflow: hidden; /* Nasconde il contenuto che fuoriesce */
}

.sidebar.expanded {
    width: 250px; /* Larghezza espansa */
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar ul li a {
    color: #bbb;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.sidebar ul li a:hover {
    color: #fff;
}

.sidebar .icon {
    margin-right: 10px; /* Spazio tra icona e testo */
}

.sidebar .text {
    display: none; /* Nasconde il testo di default */
}

.sidebar.expanded .text {
    display: inline; /* Mostra il testo nella versione espansa */
}

.content {
    flex-grow: 1;
}

.content h1 {
    margin-top: 0;
}

.form {
    display: flex;
    flex-direction: column;
    margin: 0 auto;
}

/*
LOGIN
*/

.log-form{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 500px;
    padding: 25px;
}

.login-main{
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.bottom-line{
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

.log-form .alert-success {
    background-color: #d4edda;
    color: #155724;
}

.log-form .alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.bottom-line{
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

/*
CONTENUTO PAGINA
*/

.page_content{
    display: flex;
    width: 100%
}

.section_title{
    margin-top: 5px;
    margin-bottom: 25px;
}

/*
TEMPLATE CONTENT
*/
.template_container{
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 20px;
}

/*
BUTTONS
*/
.navigation_button{
    width: 150px;
}

a.btn {
    margin-bottom: 20px;
    margin-right: 20px;
}

/* Pulsanti gestione Allegato 4A/4B uniformati */
.btn-4a, .btn-4b-action { font-size: 0.75rem; padding: 0.35rem 0.7rem; line-height: 1.1; font-weight:500; }
.btn-4a-download { border:1px solid #198754; color:#198754; background:#E9F7EF; }
.btn-4a-download:hover { background:#d3f0de; color:#146c43; }
.btn-4a-overwrite { border:1px solid #ffc107; color:#b58100; background:#FFF7E0; }
.btn-4a-overwrite:hover { background:#ffe8a6; color:#7a5600; }
.btn-4a-delete { border:1px solid #dc3545; color:#b02a37; background:#FCE3E6; }
.btn-4a-delete:hover { background:#f8c8ce; color:#7a1d26; }
.btn-4a-upload { border:1px solid #0d6efd; color:#0d6efd; background:#e7f0ff; }
.btn-4a-upload:hover { background:#d2e4ff; color:#0a58ca; }

/* Forza stessa altezza e rimozione differenze bootstrap outline */
.btn-4a-download, .btn-4a-overwrite, .btn-4a-delete, .btn-4a-upload { border-radius:4px; min-width:88px; text-align:center; }

/* Badge stato 4A personalizzati per maggiore contrasto */
.badge-4a-presente { background:#198754 !important; }
.badge-4a-assente { background:#6c757d !important; }



/*
FORMS
*/

.form_container{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #f4f4f4;
    padding: 25px;
}

.form_row {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 10px;
}

.form_element{
    width: 100%;
    margin-bottom: 10px;
    flex-direction: row;
    padding-right: 50px;
}

.action_cell{
    display: flex;
    justify-content: space-evenly;
}

#tipologia_impresa{
    list-style-type: none;
}

.info_container{
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 20px;
    border: 1px solid #333;
    margin: 10px;
}

.info_container a {
    width: 250px;
}

.horizontal-line {
    flex-direction: row;
}

/*
TABLES
*/

.table>thead{
    background-color: #333;
    color: white;
}

/* LEGALI & TITOLARI TABLE */
.legali-table-wrapper{ max-height:70vh; overflow:auto; }
.legali-table thead th{ position:sticky; top:0; z-index:2; }
/* Manteniamo nowrap per colonne compatte, ma lasciamo wrapping sui titolari */
.legali-table td, .legali-table th{ white-space:nowrap; }
.legali-table td.titolari-col{ white-space:normal; min-width:260px; line-height:1.15rem; }
.legali-table .titolari-head{ min-width:220px; }
.legali-table tbody tr:nth-child(even){ background:#fafafa; }
.legali-table tbody tr:hover{ background:#eef6ff; }
.legali-table td{ vertical-align:top; }
.legali-table .cf-col{ font-family: monospace; }
.legali-table-wrapper::-webkit-scrollbar{ width:8px; height:8px; }
.legali-table-wrapper::-webkit-scrollbar-track{ background:#f1f1f1; }
.legali-table-wrapper::-webkit-scrollbar-thumb{ background:#bbb; border-radius:4px; }
.legali-table-wrapper::-webkit-scrollbar-thumb:hover{ background:#999; }

/*
NAV
*/

body > div > div > div.template_container > ul {
    margin-bottom: 20px;
}

.thank_you_page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

/* Stili per il loader */
#loader {
    display: none; /* Nascosto di default */
    position: fixed; /* Posizionato sopra il contenuto della pagina */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8); /* Sfondo bianco semi-trasparente */
    z-index: 9999; /* Alto z-index per essere sopra gli altri elementi */
    text-align: center;
}

#loader:before {
    content: '';
    display: inline-block;
    vertical-align: middle;
    height: 100%;
}

.loader-spinner {
    display: inline-block;
    vertical-align: middle;
    border: 16px solid #f3f3f3; /* Grigio chiaro */
    border-top: 16px solid #3498db; /* Blu */
    border-radius: 50%;
    width: 120px;
    height: 120px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.tooltip-message {
    display: none; /* di base è nascosto */
    position: absolute;
    background: #d4edda; /* colore di sfondo verde chiaro (come l'alert success) */
    color: #155724;
    padding: 10px;
    border-radius: 5px;
    border: 2px solid green;
    box-shadow: 0 0 5px rgba(0,0,0,0.2);
    z-index: 9999;
  }

.tooltip-message::before {
    content: "";
    position: absolute;
    left: 20px;
    top: -10px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid #d4edda;
}

/* Stile per gli avvisi aiuti RNA */
.aiuti-warning {
    background-color: #dc3545 !important;
    color: white !important;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: bold;
    display: inline-block;
}

