/* === COMPLIANCE STYLE - CORRECTED === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #1e3a8a;
    --secondary: #3b82f6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --light: #f8fafc;
    --dark: #1e293b;
    --gradient: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f0f4f8;
    min-height: 100vh;
    color: #1e293b;
    line-height: 1.6;
}

/* LANGUAGE SWITCHER */
.language-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999;
    display: flex;
    gap: 10px;
    background: white;
    padding: 8px 12px;
    border-radius: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.lang-btn {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.3s;
    padding: 5px;
    text-decoration: none;
}

.lang-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.lang-btn.active {
    opacity: 1;
}

/* CONTAINER */
.container {
    margin: 0;
    padding: 0;
    background: transparent;
}

/* LOGO HEADER - STILE COMPLIANCE */
.logo-header {
    background: var(--gradient);
    color: white;
    padding: 30px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin: 0;
    text-align: center;
}

.logo-header a {
    display: inline-block;
    transition: transform 0.3s;
}

.logo-header a:hover {
    transform: scale(1.05);
}

.logo {
    max-width: 300px;
    height: auto;
}

@media (max-width: 768px) {
    .logo {
        max-width: 200px;
    }
}

/* MATOMO DISCLAIMER */
.matomo-disclaimer {
    max-width: 1200px;
    margin: 30px auto;
    background: white;
    border: 2px solid var(--secondary);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.matomo-disclaimer h3 {
    color: var(--primary);
    margin-bottom: 15px;
}

.matomo-disclaimer p {
    color: #475569;
    line-height: 1.6;
}

.matomo-disclaimer a {
    color: var(--secondary);
}

#matomoStatus {
    background: #f1f5f9;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

/* HERO SECTION */
.hero-section {
    max-width: 1200px;
    margin: 30px auto;
    background: var(--gradient);
    color: white;
    padding: 50px 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.2);
}

.hero-title {
    font-size: 2.5em;
    font-weight: 700;
    margin-bottom: 20px;
}

.hero-subtitle {
    font-size: 1.2em;
    margin-bottom: 30px;
    opacity: 0.95;
}

.urgency-badge {
    display: inline-block;
    background: var(--danger);
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    margin: 20px 0;
}

.cta-primary {
    display: inline-block;
    background: var(--warning);
    color: #1e293b;
    padding: 18px 40px;
    font-size: 1.1em;
    font-weight: 700;
    text-decoration: none;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
    transition: all 0.3s;
}

.cta-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.4);
}

/* PRIVACY DISCLAIMER */
.privacy-disclaimer {
    max-width: 1200px;
    margin: 30px auto;
    background: white;
    border: 2px solid #e2e8f0;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.privacy-disclaimer h2 {
    color: var(--primary);
    margin-bottom: 20px;
}

.privacy-disclaimer ul {
    margin-left: 30px;
    color: #475569;
}

.privacy-disclaimer li {
    margin: 10px 0;
}

/* HEADER */
header {
    max-width: 1200px;
    margin: 30px auto;
    background: white;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

header h1 {
    color: var(--primary);
    font-size: 2.2em;
    margin-bottom: 15px;
}

header h3 {
    color: #475569;
    font-weight: 400;
    margin: 10px 0;
}

header a {
    color: var(--secondary);
    text-decoration: none;
}

header a:hover {
    text-decoration: underline;
}

/* LAW REFERENCE */
.law-reference {
    max-width: 1200px;
    margin: 30px auto;
    background: white;
    border-left: 5px solid var(--secondary);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.law-reference h3 {
    color: var(--primary);
    font-size: 1.4em;
}

.law-reference-toggle {
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.collapse-arrow {
    font-size: 1.5em;
    color: var(--secondary);
    transition: transform 0.3s;
}

.collapse-arrow.collapsed {
    transform: rotate(-90deg);
}

.law-text {
    margin-top: 20px;
    color: #1e293b;
    line-height: 1.8;
}

.law-text-collapsible {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.5s, opacity 0.5s;
    opacity: 1;
}

.law-text-collapsible.collapsed {
    max-height: 0;
    opacity: 0;
}

/* DISCLAIMER BOX */
.disclaimer-box {
    background: #fef2f2;
    border: 2px solid #fca5a5;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
}

.disclaimer-box h3 {
    color: var(--danger);
    margin-top: 0;
}

/* FORM SECTIONS */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

.form-section {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 15px;
    padding: 35px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.form-section h2 {
    color: var(--primary);
    font-size: 1.6em;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid #e2e8f0;
}

/* FORM ELEMENTS */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
}

.form-group input:not([type="checkbox"]):not([type="radio"]),
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* RADIO/CHECKBOX */
.radio-group,
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-label,
.checkbox-label {
    display: flex;
    align-items: flex-start;
    padding: 15px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.radio-label:hover,
.checkbox-label:hover {
    background: white;
    border-color: var(--secondary);
}

/* Stili specifici per input checkbox e radio */
.checkbox-label input[type="checkbox"],
.radio-label input[type="radio"] {
    width: auto !important;
    min-width: 16px !important;
    height: 16px !important;
    margin-right: 12px;
    margin-top: 2px;
    flex-shrink: 0;
    cursor: pointer;
}

.radio-label-detailed {
    display: flex;
    align-items: center;   /* ✅ centra il radio col titolo */
    gap: 12px;
    padding: 20px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    margin-bottom: 15px;
}

.radio-label-detailed input[type="radio"] {
    flex-shrink: 0;
    margin-top: 2px;         /* micro offset per correggere */
    cursor: pointer;
}

.radio-content {
    display: flex;
    flex-direction: column;   /* titolo sopra, descrizione sotto */
}

.radio-content strong {
    display: inline-block;
    margin-bottom: 4px;
    color: var(--primary);
}

.radio-content span {
    color: #64748b;
    font-size: 0.9em;
}

/* QUICK ADD */
.quick-add-section {
    background: #f8fafc;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
}

.quick-add-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.quick-add-btn {
    padding: 12px 24px;
    background: var(--secondary);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.quick-add-btn:hover {
    background: var(--primary);
    transform: translateY(-2px);
}

/* AI SYSTEM ENTRY */
.ai-system-entry {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
}

/* BUTTONS */
.btn-primary,
.btn-secondary,
.btn-outline {
    padding: 12px 18px;
    font-size: 1em;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: flex-start;
    gap: 8px;
}

.btn-primary {
    background: var(--secondary);
    color: white;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.btn-primary:hover {
    background: var(--primary);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--success);
    color: white;
}

.btn-secondary:hover {
    background: #059669;
}

.btn-outline {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

/* FORM ACTIONS */
.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 3px solid #e2e8f0;
}

/* MODAL */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
    overflow-y: auto;
}

.modal-content {
    background: white;
    margin: 50px auto;
    max-width: 900px;
    width: 90%;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    overflow: hidden;
}

.modal-header {
    background: var(--gradient);
    color: white;
    padding: 25px 30px;
    display: flex;
    justify-content: space-between;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 2em;
    cursor: pointer;
}

.modal-body {
    padding: 30px;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 20px 30px;
    background: #f8fafc;
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: center;
}

.modal-footer button {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 10px 12
  }

@media (max-width: 1400px) {
    .modal-footer button {
        padding: 10px 14px;
        font-size: 0.8em;
    }
}

/* FOOTER */
.footer-copyright {
    max-width: 1200px;
    margin: 40px auto;
    background: white;
    padding: 30px;
    text-align: center;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.footer-copyright a {
    color: var(--secondary);
}

/* FIELD HELP */
.field-help {
    display: inline-block;
    width: 20px;
    height: 20px;
    background: var(--secondary);
    color: white;
    border-radius: 50%;
    text-align: center;
    font-size: 13px;
    line-height: 20px;
    cursor: help;
    margin-left: 6px;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .hero-title {
        font-size: 1.8em;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions button {
        width: 100%;
    }
}

@media print {
    .language-switcher,
    .form-actions,
    .modal {
        display: none !important;
    }
}

/* === HEADER LAYOUT COMPLIANCE STYLE === */
/* .logo-header > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo-header .logo {
    max-width: 200px;
}

.logo-header h1,
.logo-header p {
    text-align: center;
    flex: 1;
} */

.logo-header {
    background: var(--gradient);
    color: white;
    padding: 40px 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.logo-header h1 {
    font-size: 2.5em;
    font-weight: 700;
    margin: 0;
}

/* Pulsante rimozione sistema AI */
.ai-system-entry {
    position: relative;
    padding: 20px;
    margin-bottom: 30px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
}

.remove-system {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10;
}

.remove-system:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* Sezione Interesse - Benefit */
.benefits-section {
    max-width: 1200px;
    margin: 50px auto;
    padding: 0 20px;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.benefit-card {
    text-align: center;
    padding: 30px 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.benefit-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}

.benefit-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.benefit-title {
    font-size: 1.3em;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.benefit-description {
    color: #666;
    font-size: 0.95em;
    line-height: 1.6;
}

/* Sezione Desiderio - Trust */
.trust-section {
    max-width: 1200px;
    margin: 50px auto;
    padding: 40px;
    background: linear-gradient(135deg, #f8fafc 0%, #e8f4f8 100%);
    border-radius: 15px;
    border-left: 5px solid var(--primary-color);
}

.trust-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 25px;
}

.trust-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.trust-icon {
    font-size: 2em;
    flex-shrink: 0;
}

.trust-text {
    flex: 1;
}

.trust-text strong {
    display: block;
    color: var(--primary-color);
    font-size: 1.1em;
    margin-bottom: 5px;
}

.trust-text p {
    color: #666;
    font-size: 0.95em;
    margin: 0;
}

/* CTA Box allineato */
.cta-box-aligned {
    max-width: 1200px;
    margin: 40px auto;
    padding: 30px;
    background: linear-gradient(135deg, #fff9e6 0%, #ffe6b3 100%);
    border-radius: 15px;
    border: 3px solid #ffd700;
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.3);
    text-align: center;
}

@media (max-width: 768px) {
    .benefits-grid,
    .trust-grid {
        grid-template-columns: 1fr;
    }
}

/* Header unificato */
.main-header {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: var(--gradient);
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.2);
}

.header-logo {
    flex: 0 0 auto;
}

.header-logo img {
    height: 80px;
    width: auto;
}

.header-title {
    flex: 1;
    text-align: center;
}

.header-title h1 {
    font-size: 1.8em;
    color: white;
    margin: 0;
    font-weight: 700;
}

.header-title .subtitle {
    font-size: 0.9em;
    color: #666;
    margin-top: 5px;
}

.lang-switcher {
    flex: 0 0 auto;
    display: flex;
    gap: 5px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 5px;
}

.lang-btn {
    padding: 8px 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 5px;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.lang-btn:hover {
    background: #f1f5f9;
}

.lang-btn.active {
    background: var(--primary-color);
    color: white;
}

/* Pulsanti scroll */
.scroll-buttons {
    position: fixed;
    right: 20px;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 100;
}

.scroll-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
}

.scroll-btn.hidden {
    opacity: 0;
    pointer-events: none;
}

@media (max-width: 768px) {
    .main-header {
        flex-direction: column;
        text-align: center;
    }
    
    .header-title h1 {
        font-size: 1.4em;
    }
    
    .scroll-buttons {
        right: 10px;
        bottom: 10px;
    }
    
    .scroll-btn {
        width: 45px;
        height: 45px;
    }
}

/* Header Guida (bianco, centrato, senza logo) */
.guide-header {
    text-align: center;
    padding: 40px 20px;
    background: white;
    border-bottom: 3px solid var(--primary-color);
    margin-bottom: 30px;
}

.guide-header h1 {
    color: var(--primary-color);
    font-size: 2.5em;
    margin-bottom: 10px;
}

.guide-header h2 {
    color: #666;
    font-size: 1.3em;
    font-weight: 400;
    margin-bottom: 20px;
}

.btn-back {
    display: inline-block;
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-back:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}
