    * {
    	margin: 0;
    	padding: 0;
    	box-sizing: border-box;
    }

    .overlay-message {
    	position: fixed;
    	top: 0;
    	left: 0;
    	width: 100%;
    	height: 100%;
    	background: rgba(0, 0, 0, 0.5);
    	/* Sfondo scuro semi-trasparente */
    	display: flex;
    	align-items: center;
    	justify-content: center;
    	z-index: 1000;
    	opacity: 1;
    	transition: opacity 0.5s ease-in-out;
    }

    .message-box {
    	background: white;
    	padding: 20px;
    	border-radius: 10px;
    	text-align: center;
    	font-size: 18px;
    	font-weight: bold;
    	min-width: 300px;
    	box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.3);
    }

    /* Stile per messaggi di successo ed errore */
    .success {
    	border: 2px solid green;
    	color: green;
    }

    .error {
    	border: 2px solid red;
    	color: red;
    }



    .message {
    	padding: 15px !important;
    	margin: 20px 0 !important;
    	border-radius: 5px !important;
    	color: #fff !important;
    	font-weight: bold !important;
    	text-align: center !important;
    	font-size: 16px !important;
    }

    /* Stile per il messaggio di successo */
    .message.success {
    	background-color: #4CAF50 !important;
    	/* Verde per il successo */
    }

    /* Stile per il messaggio di errore */
    .message.error {
    	background-color: #f44336 !important;
    	/* Rosso per l'errore */
    }

    /**********************************************************************************/


    .legale-container {
    	padding: 20px;
    	border-radius: 8px;

    }

    .legale-section {
    	margin-bottom: 15px;
    	border-radius: 5px;

    	display: flex;
    	flex-wrap: wrap;
    	gap: 15px;
    	justify-content: space-between;
    }

    .legale-field-group {
    	flex: 1;

    	display: flex;
    	flex-direction: column;
    	gap: 5px;
    }

    .legale-label {
    	font-weight: bold;
    	text-align: left;
    }

    .legale-input {
    	text-transform: uppercase;
    }

    .legale-input,
    .legale-select {
    	width: 100%;
    	padding: 10px;
    	border: 1px solid #ccc;
    	border-radius: 4px;
    	box-sizing: border-box;
    }


    .error-message {
    	color: red;
    	font-size: 12px;
    	margin-top: 5px;
    }


    .legale-btn-container {
    	text-align: center;
    	margin-top: 15px;
    }



    .nota-legale {
    	background-color: #fff3cd;
    	/* Giallo chiaro */
    	color: #856404;
    	/* Testo marrone per contrasto */
    	padding: 10px;
    	border-left: 4px solid #ffcc00;
    	/* Bordo giallo più scuro */
    	font-style: italic;
    	margin-bottom: 10px;
    	border-radius: 5px;
    }



    .legale-btn-container {
    	text-align: center;
    	margin-top: 20px;
    }

    .legale-btn {
    	background: #449c94;
    	color: white;
    	font-size: 16px;
    	padding: 12px 20px;
    	border: none;
    	border-radius: 8px;
    	cursor: pointer;

    }

    .legale-btn:hover {
    	background: #356f6a;
    }

    .mainlegale {

    	padding: 20px;
    	background-color: #cfe4d9;
    	display: flex;
		flex-direction:column;

    }

    /* Stile per il div header_legale */
    .header_legale {
    	background-color: #449c94;
    	padding: 10px;
    	text-align: left;
    	font-weight: bold;
    	font-family: Arial, sans-serif;
    }

    .file-name {
    	color: green;
    	font-size: 14px;
    	margin-top: 10px;
    	font-weight: bold;
    }

    .blocco-legale {
    	display: flex;
    	flex-direction: column;
    	gap: 12px;
    	padding: 20px;
    	background-color: #f6f9f7;
    	border: 1px solid #ccc;
    	border-radius: 6px;

    }

    .legale-label {
    	font-weight: bold;
    	font-size: 14px;
    	color: #333;
    }

    .colonna-checkbox {
    	display: flex;
    	flex-direction: column;
    	gap: 10px;
    }

    .checkbox-riga {
    	display: flex;
    	align-items: center;
    	gap: 8px;
    	font-size: 14px;
    }

    .riga-flex {
    	display: flex;
    	font-family: Arial, sans-serif;
    	gap: 20px;
    }


    .box_detrazione {
    	display: flex;
    	flex-direction: column;
    }


  .toolbar {
      display: flex;
      padding: 10px;
      
    }

    .toolbar button {
      background-color: #3498db;
      border: none;
      color: white;
      padding: 10px 16px;
      margin-right: 10px;
      border-radius: 4px;
      cursor: pointer;
      font-size: 14px;
      transition: background-color 0.3s;
    }

    .toolbar button:hover {
      background-color: #2980b9;
    }

    .toolbar button:active {
      background-color: #1f6391;
    }
    /*********************** UPLOAD SECTION ********************************/
    .upload-section {
    	display: flex;
    	flex-direction: column;
    	gap: 15px;
    	padding: 20px;
    	background: #9ca6b829;
    	border-radius: 8px;
    	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    }

    .upload-field {
    	display: flex;
    	flex-direction: column;
    	gap: 5px;
    }

    .upload-label {
    	font-weight: bold;
    	color: #333;
    }

    .upload-input {
    	padding: 10px;
    	border: 1px solid #ccc;
    	border-radius: 5px;
    	background: white;
    	cursor: pointer;
    	transition: 0.3s;
    }

    .upload-input:hover {
    	border-color: #449c94;
    }



    /**************************************** CONFIRM ********************************************/
    /* Contenitore per la finestra di conferma */
    .confirm-container {
    	position: fixed;
    	top: 50%;
    	left: 50%;
    	transform: translate(-50%, -50%);
    	background-color: #fff;
    	padding: 20px;
    	border-radius: 10px;
    	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    	z-index: 1000;
    	text-align: center;
    }

    .confirm-container button {
    	padding: 10px 20px;
    	margin: 10px;
    	border: none;
    	border-radius: 5px;
    	cursor: pointer;
    }

    .confirm-container .btn-confirm {
    	background-color: #4CAF50;
    	color: white;
    }

    .confirm-container .btn-cancel {
    	background-color: #f44336;
    	color: white;
    }

    .confirm-overlay {
    	position: fixed;
    	top: 0;
    	left: 0;
    	width: 100%;
    	height: 100%;
    	background: rgba(0, 0, 0, 0.5);
    	z-index: 999;
    }


    /**************************** PERIODO DI DETRAZIONE **********************************/

    .styled-table {
    	border-collapse: separate;
    	border-spacing: 0;
    	margin: 20px auto;
    	font-family: 'Verdana', sans-serif;
    	font-size: 12px;
    	padding: 10px;
    	width: 500px;
    	border: none;
    }

    .styled-table td {
    	padding: 10px;
    	border-bottom: 1px solid #e0e0e0;
    	vertical-align: middle;
    }

    .styled-table tr:last-child td {
    	border-bottom: none;
    }

    .styled-table td:first-child {
    	font-weight: bold;
    	color: #333;
    	width: 180px;
    }

    .styled-table input[type="text"],
    .styled-table select {
    	width: 200px;
    	padding: 6px;
    	border: 1px solid #ccc;
    	border-radius: 4px;
    	font-size: 11px;
    	background-color: #fff;
    }

    .styled-table input[type="checkbox"] {
    	transform: scale(1.1);
    }

    .styled-table tr:hover {
    	background-color: #e6f9ec !important;
    	/* verde chiaro molto tenue */
    }



    /**************************************** CONFIRM ********************************************/


    .cf-input-group {
    	display: flex;
    	gap: 8px;
    	/* spazio tra input e bottone */
    	align-items: center;
    }

    .cf-input-group input {
    	flex: 1;
    	/* l'input si allarga */
    }

    .cf-button {
    	padding: 8px 12px;
    	background-color: #449c94;
    	color: white;
    	border: none;
    	border-radius: 4px;
    	cursor: pointer;
    	transition: background-color 0.2s;
    }

    .cf-button:hover {
    	background-color: rgb(54, 130, 57);
    }



    .info-box {
    	background-color: #f0f8f5;
    	/* verde molto chiaro */
    	border-left: 5px solid #479a99;
    	/* barra colorata a sinistra */
    	padding: 16px;
    	margin: 20px 0;
    	font-family: Arial, sans-serif;
    	font-size: 14px;
    	color: #333;
    	border-radius: 4px;
    	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }

    .info-box ul {
    	padding-left: 20px;
    	margin: 0;
    }

    .info-box li {
    	margin: 6px;
    	text-align: left;
    	line-height: 1.5;
    }



    .confirm-container {
    	position: fixed;
    	top: 50%;
    	left: 50%;
    	transform: translate(-50%, -50%);
    	background-color: #fff;
    	padding: 20px;
    	border-radius: 10px;
    	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    	z-index: 1000;
    	text-align: center;
    }

    .confirm-container button {
    	padding: 10px 20px;
    	margin: 10px;
    	border: none;
    	border-radius: 5px;
    	cursor: pointer;
    }

    .confirm-container .btn-confirm {
    	background-color: #4CAF50;
    	color: white;
    }

    .confirm-container .btn-cancel {
    	background-color: #f44336;
    	color: white;
    }

    .confirm-overlay {
    	position: fixed;
    	top: 0;
    	left: 0;
    	width: 100%;
    	height: 100%;
    	background: rgba(0, 0, 0, 0.5);
    	z-index: 999;
    }

    /************* DATATABLE*************************************/
    .text-center {
    	text-align: center;
    }

    /******************************************************************* */


    /* Stile per la tabella principale */
    table {
    	font-size: 11px;
    	font-family: Verdana, sans-serif;
    	width: 100%;
    	border-collapse: collapse;
    	margin-top: 10px;
    }

    /* Stile per le celle */
    table td {
    	padding: 6px 10px;
    	vertical-align: middle;

    }

    /* Intestazioni (prima colonna) */
    table td:first-child {
    	font-weight: bold;
    	color: #333;
    	width: 150px;
    	white-space: nowrap;
    }


    /* Calendario icona */
    img[src*="calendario.bmp"] {
    	vertical-align: middle;
    	margin-left: 4px;
    	cursor: pointer;
    }

    /* Container città/provincia */
    #divcbCitta select {
    	width: 100%;
    }

    input[type="checkbox"] {
    	transform: scale(1.4);
    	margin-right: 6px;
    	cursor: pointer;
    	accent-color: #659e9e;
    	/* colore blu per i browser moderni */
    }


    /* popup */
	.popup-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 20px;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    animation: fadeInOut 3s forwards;
}

.popup-message-success {
    background-color: #28a745;
}

.popup-message-error {
    background-color: #dc3545;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(-20px) translateX(-50%); }
    10% { opacity: 1; transform: translateY(0) translateX(-50%); }
    90% { opacity: 1; transform: translateY(0) translateX(-50%); }
    100% { opacity: 0; transform: translateY(-20px) translateX(-50%); }
}



/****************** BOX C.F.P.IVA ***************************/


/* Card per il box iniziale */
#cf-piva-box {
    max-width: 450px;
    margin: 50px auto;
    padding: 25px 30px;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

#cf-piva-box:hover {
    transform: translateY(-3px);
}

/* Titolo */
#cf-piva-box h2 {
    margin: 0 0 20px 0;
    text-align: center;
    font-size: 20px;
    color: #333;
}

/* Etichette e input */
#cf-piva-box label {
    display: block;
    margin: 12px 0 6px;
    font-weight: 600;
    font-size: 14px;
    color: #444;
}

#cf-piva-box input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

#cf-piva-box input[type="text"]:focus {
    border-color: #007bff;
}

/* Checkbox + label */
#cf-piva-box .checkbox-row {
    margin-top: 15px;
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #555;
}

#cf-piva-box .checkbox-row input {
    margin-right: 8px;
}

/* Bottone */
#cf-piva-box button {
    margin-top: 20px;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background-color: #479a98;
    color: #fff;
    font-weight: bold;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.3s;
}

#cf-piva-box button:hover {
       background-color: #5e9291;
}

/* Messaggi */

.info {
  color: #0d47a1;
  background: #bbdefb;
  padding: 8px;
  border-radius: 4px;
  margin-bottom: 15px;
}


#msg-box {
    margin-top: 15px;
    text-align: center;
    font-size: 14px;
    font-weight: bold;
	padding:4px;
}

#msg-box.success { color: green; }
#msg-box.error { color: red; }

/* Form nascosto inizialmente */
#legale-form {
    display: none;
    margin-top: 20px;
}