/* =================================================================== */
/* == FOGLIO DI STILE COMPLETO E UNIFICATO PER PAGINA DATI PARTECIPANTI == */
/* =================================================================== */


/* --- STRUTTURA GENERALE DEL BOX CORSO --- */

.partecipante-box { 
    background: #fff; 
    border: 1px solid #ddd; 
    border-radius: 10px; 
    padding: 25px; 
    margin-bottom: 40px; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.08); 
}

.partecipante-box h3 { 
    margin-top: 0; 
    font-size: 1.4rem; 
    color: #333; 
}

.sottotitolo { 
    margin: 5px 0 20px; 
    font-size: 1rem; 
    color: #777; 
}


/* --- LAYOUT A GRIGLIA PER IL FORM --- */

.campi-partecipante { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); 
    gap: 15px 20px; 
    margin-top: 20px; 
    margin-bottom: 20px; 
    padding: 20px; 
    border: 1px solid #ddd; 
    border-radius: 10px; 
    background: #f9f9f9; 
}

.field-group { 
    display: flex; 
    flex-direction: column; 
}

.field-group label { 
    font-weight: 600; 
    margin-bottom: 5px; 
    font-size: 0.9rem; 
    color: #555; 
}

.field-group input, .field-group select { 
    padding: 8px 10px; 
    font-size: 1rem; 
    border: 1px solid #ccc; 
    border-radius: 6px; 
    transition: border-color 0.3s ease, box-shadow 0.3s ease; 
    width: 100%; 
    box-sizing: border-box; 
}

.field-group input:focus, .field-group select:focus { 
    border-color: #007bff; 
    box-shadow: 0 0 5px rgba(0,123,255,0.5); 
    outline: none; 
}

.field-group input[type="date"] { 
    min-height: 38px; 
}


/* --- ICONA RICALCOLO CODICE FISCALE --- */

.field-group-cf .cf-input-wrapper { 
    position: relative; 
    display: flex;
    align-items: center;
}

.field-group-cf input { 
    text-transform: uppercase; 
}

.field-group-cf .recalculate-cf-icon { 
    position: absolute; 
    right: 8px; 
    top: 50%; 
    transform: translateY(-50%); 
    cursor: pointer; 
    font-size: 1.2em; 
    opacity: 0.7; 
    transition: opacity 0.2s; 
    line-height: 1;
    user-select: none;
}

.field-group-cf .recalculate-cf-icon:hover { 
    opacity: 1; 
    color: #007bff;
}


/* --- INTERFACCIA A TAB --- */

.tab-partecipanti { 
    margin-bottom: 20px; 
    display: flex; 
    flex-wrap: wrap; 
    gap: 8px; 
}

.tab-btn { 
    background: #f1f1f1; 
    border: 1px solid #ccc; 
    padding: 8px 14px; 
    border-radius: 6px; 
    cursor: pointer; 
    font-weight: 600; 
    transition: all 0.3s ease; 
    line-height: 1.2; 
    position:relative; 
    padding-right: 25px; 
}

.tab-btn:hover { 
    background-color: #ff8800; 
    color: #fff; 
    border-color: #ff8800; 
}

.tab-btn.active { 
    background-color: #ff6600; 
    color: #fff; 
    border-color: #ff6600; 
}

.tab-status-indicator { 
    position: absolute; 
    right: 8px; 
    top: 50%; 
    transform: translateY(-50%); 
    font-weight: bold; 
}

.tab-btn.tab-success {
  background-color: #28a745;
  border-color: #28a745;
  color: #ffffff !important;
}

.tab-btn.tab-success:hover {
  background-color: #218838;
  border-color: #218838;
}

.tab-btn.active.tab-success {
    background-color: #28a745;
    border-color: #28a745;
}

/* --- FUNZIONE COPIA DATI --- */

.copy-buttons-placeholder { 
    grid-column: 1 / -1; 
    margin-bottom: 15px; 
    border-top: 1px dashed #ccc; 
    padding-top: 15px; 
}

.copy-buttons-placeholder p { 
    font-size: 0.9em !important; 
    color: #555 !important; 
    margin-bottom: 8px !important; 
}

.copy-participant-data { 
    margin-right:5px !important; 
    margin-bottom:5px !important; 
    background-color: #6c757d !important; 
    border-color: #6c757d !important; 
    color: white !important; 
    font-size: 0.85rem !important; 
    padding: 4px 8px !important; 
}

.copy-participant-data:hover { 
    background-color: #5a6268 !important; 
    border-color: #545b62 !important; 
}


/* --- MESSAGGI E STATI DI VALIDAZIONE --- */

.partecipante-submit-message { 
    grid-column: 1 / -1; 
    margin-top: 10px; 
    padding: 10px; 
    border-radius: 5px; 
}

.partecipante-submit-message[style*="color: red"] { 
    background-color: #f8d7da; 
    border: 1px solid #f5c6cb; 
}

.partecipante-submit-message[style*="color: green"] { 
    background-color: #d4edda; 
    border: 1px solid #c3e6cb;
    font-weight: bold;
}

.input-error { 
    border-color: red !important; 
    background-color: #fff0f0; 
}


/* --- TABELLA DI RIEPILOGO --- */

.summary-table { 
    width: 100%; 
    border-collapse: collapse; 
    margin-bottom: 20px; 
    font-size: 0.95em; 
}

.summary-table th, .summary-table td { 
    padding: 10px 8px; 
    text-align: left; 
    border: 1px solid #e1e1e1; 
    vertical-align: middle;
}

.summary-table th { 
    background-color: #f7f7f7; 
    font-weight: 600; 
}

.summary-table .summary-header-row:hover {
    background-color: #f1f1f1;
}

.summary-table .summary-detail-row td { 
    background-color: #ffffff; 
    padding: 15px 20px; 
    border-top: 1px dashed #eee;
}

.summary-detail-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); 
    gap: 12px 25px; 
    line-height: 1.6;
}

.summary-detail-grid div { 
    font-size: 0.95em;
    word-break: break-word;
}

.summary-detail-grid div strong { 
    display: inline-block;
    margin-right: 8px;
    color: #444;
    font-weight: 600;
}


/* ================================================= */
/* == STILI UNIFICATI PER I BOTTONI DEI FORM       == */
/* ================================================= */

/* --- Stile per il bottone "Inoltra dati partecipante" (VERDE) --- */
#form-partecipanti-wrapper .inoltra-partecipante-btn,
#form-partecipanti-adifer-wrapper .inoltra-partecipante-btn {
    margin-top: 10px;
    background-color: #28a745 !important; /* Verde */
    border-color: #28a745 !important;
    color: #fff !important;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 1rem;
    width: 100%; /* Occupa tutta la larghezza */
}

#form-partecipanti-wrapper .inoltra-partecipante-btn:hover,
#form-partecipanti-adifer-wrapper .inoltra-partecipante-btn:hover {
    background-color: #218838 !important; /* Verde più scuro */
    border-color: #218838 !important;
}

#form-partecipanti-wrapper .inoltra-partecipante-btn:disabled,
#form-partecipanti-adifer-wrapper .inoltra-partecipante-btn:disabled {
    background-color: #aaa !important;
    border-color: #aaa !important;
    cursor: not-allowed;
}

/* --- Stili per i bottoni nel Riepilogo Dati --- */

/* Stile comune per bottoni piccoli nel riepilogo */
.summary-table .button-small { 
    font-size: 0.85em !important; 
    padding: 4px 8px !important; 
    line-height: 1.2 !important; 
    vertical-align: middle; 
    margin-right: 5px;
}

/* Bottone "Vedi Dettagli" (GRIGIO) */
.summary-table .view-details-btn {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: white !important;
}
.summary-table .view-details-btn:hover {
    background-color: #5a6268 !important;
    border-color: #5a6268 !important;
}

/* Bottone "Modifica Dati" (GIALLO) */
.summary-table .btn-modifica-riga {
    background-color: #ffc107 !important;
    border-color: #ffc107 !important;
    color: #212529 !important;
}
.summary-table .btn-modifica-riga:hover {
    background-color: #e0a800 !important;
    border-color: #d39e00 !important;
}

/* --- Stile per il bottone finale "Inoltra / Invia Richiesta" (ARANCIONE) --- */
#form-partecipanti-wrapper .btn-inoltra-attivazione,
#form-partecipanti-adifer-wrapper .btn-inoltra-attivazione {
    background-color: #f58420 !important; /* Arancione */
    border-color: #f58420 !important;
    color: white !important;
    padding: 10px 18px;
    border-radius: 6px;
}

#form-partecipanti-wrapper .btn-inoltra-attivazione:hover,
#form-partecipanti-adifer-wrapper .btn-inoltra-attivazione:hover {
    background-color: #d8731b !important; /* Arancione più scuro */
    border-color: #d8731b !important;
}

#form-partecipanti-wrapper .btn-inoltra-attivazione:disabled,
#form-partecipanti-adifer-wrapper .btn-inoltra-attivazione:disabled {
    background-color: #aaa !important;
    border-color: #aaa !important;
    cursor: not-allowed;
}


/* --- STILI RESPONSIVE --- */

@media (max-width: 600px) {
    .campi-partecipante { 
        grid-template-columns: 1fr; 
    }
    .summary-table th, .summary-table td { 
        font-size: 0.9em; 
        padding: 6px 5px; 
    }
    .summary-detail-grid { 
        grid-template-columns: 1fr; 
    }
    .summary-table .button-small { 
        width: calc(50% - 3px); 
        margin: 2px 0;
    }
    .summary-header-row td:last-child { 
        display: flex; 
        flex-wrap: wrap; 
        gap: 5px;
    }
}