/* Dietalybra Styles - Versione Corretta */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-green: #5cba9a;
    --navy-blue: #1e3d6f;
    --orange: #ed6a1e;
    --pink: #cf176e;
    --white: #ffffff;
    --light-gray: #f8f9fa;
    --text-dark: #2c3e50;
    --error-red: #dc3545;
}

body {
    font-family: 'Inter', 'Arial', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Header/Navigation */
.header {
    position: absolute;
    top: 0;
    width: 100%;
    background: transparent;
    z-index: 1000;
    padding: 1rem 0;
    transition: all 0.3s ease;
}

.header.scrolled {
    position: fixed;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(92, 186, 154, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    height: 80px;
    transition: transform 0.3s ease;
}

.logo-default {
    display: block;
}

.logo-scrolled {
    display: none;
    height: 50px;
}

.header.scrolled .logo-default {
    display: none;
}

.header.scrolled .logo-scrolled {
    display: block;
}

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

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    text-decoration: none;
    color: var(--white);
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    padding: 0.5rem 0;
}

.header.scrolled .nav-menu a {
    color: var(--navy-blue);
    text-shadow: none;
}

.nav-menu a:hover {
    color: var(--primary-green);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-green);
    transition: width 0.3s ease;
}

.nav-menu a:hover::after {
    width: 100%;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
    padding: 0.5rem;
    z-index: 1001;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--white);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.header.scrolled .hamburger span {
    background: var(--navy-blue);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    background: url('img/sfondo.jpg') center center/cover no-repeat;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
    position: relative;
    z-index: 3;
}

.hero-content {
    animation: slideInLeft 1s ease-out;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    color: var(--white);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    line-height: 1.5;
}

.cta-button {
    display: inline-block;
    background: var(--orange);
    color: var(--white);
    padding: 1rem 2rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(237, 106, 30, 0.3);
    position: relative;
    overflow: hidden;
    border: none;
    cursor: pointer;
    text-align: center;
    min-width: 220px;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.cta-button:hover::before {
    left: 100%;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(237, 106, 30, 0.4);
}

.hero-visual {
    animation: slideInRight 1s ease-out;
    display: flex;
    justify-content: center;
    align-items: center;
}

.dna-visual {
    width: min(300px, 80vw);
    height: min(300px, 80vw);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    animation: float 6s ease-in-out infinite;
}

.dna-helix {
    width: min(200px, 60vw);
    height: min(200px, 60vw);
    border: 3px solid var(--white);
    border-radius: 50%;
    position: relative;
    animation: rotate 10s linear infinite;
}

.dna-helix::before,
.dna-helix::after {
    content: '';
    position: absolute;
    width: 30%;
    height: 30%;
    background: var(--orange);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.dna-helix::after {
    background: var(--pink);
    animation: pulse 2s ease-in-out infinite;
}

/* Features Section */
.features {
    padding: 4rem 0;
    background: var(--light-gray);
    position: relative;
}

.features-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.section-title {
    text-align: center;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    color: var(--navy-blue);
    margin-bottom: 1rem;
    animation: fadeInUp 0.8s ease-out;
}

.section-subtitle {
    text-align: center;
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    color: var(--text-dark);
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    justify-items: center;
}

.feature-card {
    background: var(--white);
    padding: 2rem 1.5rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 350px;
    height: auto;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(45deg, var(--primary-green), var(--orange));
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(45deg, var(--primary-green), var(--navy-blue));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: var(--white);
    flex-shrink: 0;
}

.feature-title {
    font-size: 1.2rem;
    color: var(--navy-blue);
    margin-bottom: 1rem;
    font-weight: 600;
}

.feature-description {
    color: var(--text-dark);
    line-height: 1.6;
    flex-grow: 1;
}

/* Benefits Section */
.benefits {
    padding: 4rem 0;
    background: var(--white);
    position: relative;
}

.benefits-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.benefits-content h2 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    color: var(--navy-blue);
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

.benefits-list {
    list-style: none;
    margin-bottom: 2rem;
}

.benefits-list li {
    padding: 1rem 0;
    padding-left: 3rem;
    position: relative;
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(92, 186, 154, 0.1);
}

.benefits-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    background: var(--primary-green);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.benefits-visual {
    background: linear-gradient(135deg, var(--primary-green), var(--navy-blue));
    border-radius: 16px;
    padding: 2.5rem;
    text-align: center;
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.benefits-visual::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

/* Contact Form Section */
.contact-section {
    padding: 4rem 0;
    background: linear-gradient(135deg, var(--light-gray) 0%, rgba(92, 186, 154, 0.08) 100%);
    position: relative;
}

.contact-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
    position: relative;
    z-index: 2;
}

.contact-section h2 {
    text-align: center;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    color: var(--navy-blue);
    margin-bottom: 1rem;
}

.contact-section .section-subtitle {
    text-align: center;
    color: var(--text-dark);
    margin-bottom: 2rem;
}

.contact-form {
    background: var(--white);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.contact-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-green), var(--orange), var(--pink));
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--navy-blue);
    font-weight: 600;
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid rgba(92, 186, 154, 0.2);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--white);
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(92, 186, 154, 0.1);
}

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

.form-submit {
    text-align: center;
    margin-top: 1.5rem;
}

.submit-button {
    background: linear-gradient(45deg, var(--primary-green), var(--navy-blue));
    color: var(--white);
    padding: 1rem 2.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(92, 186, 154, 0.3);
    position: relative;
    overflow: hidden;
    min-width: 250px;
}

.submit-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.submit-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.submit-button:hover:not(:disabled)::before {
    left: 100%;
}

.submit-button:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(92, 186, 154, 0.4);
}

/* Error Messages */
.error-message {
    color: var(--error-red);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: none;
    font-weight: 500;
}

.form-group.error input,
.form-group.error select,
.form-group.error textarea {
    border-color: var(--error-red);
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.form-group.error label {
    color: var(--error-red);
}

.form-group.error .error-message {
    display: block;
}

.checkbox-group.error {
    border-color: var(--error-red);
    background: rgba(220, 53, 69, 0.05);
}

.checkbox-group.error .checkmark {
    border-color: var(--error-red);
}

.checkbox-group.error .error-message {
    display: block;
}

/* Checkbox GDPR Styles */
.checkbox-group {
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: rgba(92, 186, 154, 0.05);
    border-radius: 12px;
    border: 2px solid rgba(92, 186, 154, 0.2);
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1.5;
    position: relative;
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: relative;
    top: 2px;
    height: 22px;
    width: 22px;
    background-color: #ffffff;
    border: 2px solid var(--primary-green);
    border-radius: 4px;
    margin-right: 12px;
    flex-shrink: 0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.checkbox-label:hover input ~ .checkmark {
    background-color: #f8f9fa;
    border-color: var(--navy-blue);
}

.checkbox-label input:checked ~ .checkmark {
    background-color: var(--primary-green);
    border-color: var(--primary-green);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-label input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-text {
    color: var(--text-dark);
    font-size: 0.9rem;
    font-weight: 500;
}

.checkbox-text a {
    color: var(--primary-green);
    text-decoration: none;
    font-weight: 700;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.checkbox-text a:hover {
    border-bottom-color: var(--primary-green);
}

/* Modal Styles - Versione Unificata */
.modal, .success-modal, .error-modal, .policy-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
    padding: 20px;
    box-sizing: border-box;
}

.policy-modal {
    z-index: 10005;
    background-color: rgba(0, 0, 0, 0.85);
}

.modal-content, .success-modal-content, .error-modal-content, .policy-modal-content {
    background: var(--white);
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    animation: slideUp 0.4s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.policy-modal-content {
    max-width: 800px;
    max-height: 90vh;
}

.modal-header, .success-modal-header, .error-modal-header, .policy-modal-header {
    background: linear-gradient(135deg, var(--primary-green), var(--navy-blue));
    color: var(--white);
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.success-modal-header {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

.error-modal-header {
    background: linear-gradient(135deg, #dc3545, #c82333);
}

.modal-header h2, .success-modal-header h3, .error-modal-header h3, .policy-modal-header h2 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 600;
}

.modal-close, .policy-modal-close {
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.modal-close:hover, .policy-modal-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.modal-body, .success-modal-body, .error-modal-body, .policy-modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
    max-height: calc(85vh - 180px);
    line-height: 1.7;
    font-size: 1rem;
}

.policy-modal-body {
    padding: 2.5rem;
    max-height: calc(90vh - 200px);
}

.modal-footer, .success-modal-footer, .error-modal-footer, .policy-modal-footer {
    background: var(--light-gray);
    padding: 1.5rem 2rem;
    text-align: center;
    border-top: 1px solid rgba(92, 186, 154, 0.15);
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.modal-btn-close, .success-close-btn, .error-close-btn, .policy-btn-close, .policy-button {
    background: linear-gradient(45deg, var(--primary-green), var(--navy-blue));
    color: var(--white);
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 160px;
    box-shadow: 0 4px 15px rgba(92, 186, 154, 0.3);
}

.success-close-btn {
    background: linear-gradient(45deg, #22c55e, #16a34a);
}

.error-close-btn {
    background: linear-gradient(45deg, #dc3545, #c82333);
}

.modal-btn-close:hover, .success-close-btn:hover, .error-close-btn:hover, .policy-btn-close:hover, .policy-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(92, 186, 154, 0.4);
}

.success-highlight, .error-highlight {
    padding: 1.5rem;
    border-radius: 12px;
    margin: 1.5rem 0;
}

.success-highlight {
    background: rgba(92, 186, 154, 0.1);
    border-left: 4px solid var(--primary-green);
}

.error-highlight {
    background: rgba(220, 53, 69, 0.1);
    border-left: 4px solid #dc3545;
}

.title-with-icon {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.success-icon, .error-icon {
    font-size: 1.5rem;
}

/* Policy Modal Specific Styles */
.policy-last-updated {
    text-align: center;
    font-style: italic;
    color: #666;
    margin-bottom: 2rem;
    padding: 1.25rem;
    background: #f0f8ff;
    border-radius: 12px;
    font-size: 0.95rem;
    border: 1px solid rgba(92, 186, 154, 0.2);
}

.policy-toc {
    background: linear-gradient(135deg, #f8f9fa, #e8f5e8);
    padding: 2rem;
    border-radius: 16px;
    margin-bottom: 2.5rem;
    border: 1px solid rgba(92, 186, 154, 0.2);
}

.policy-toc h3 {
    margin-bottom: 1.5rem;
    color: var(--navy-blue);
    font-size: 1.3rem;
    text-align: center;
}

.policy-toc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.policy-toc a {
    color: var(--navy-blue);
    text-decoration: none;
    padding: 0.875rem 1rem;
    display: block;
    transition: all 0.3s;
    border-radius: 10px;
    font-size: 0.95rem;
    border: 2px solid transparent;
    background: white;
    font-weight: 500;
}

.policy-toc a:hover {
    color: var(--primary-green);
    background: white;
    border-color: var(--primary-green);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(92, 186, 154, 0.2);
}

.policy-section {
    margin-bottom: 2.5rem;
    padding: 2rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border-left: 5px solid var(--primary-green);
}

.policy-section h3 {
    color: var(--navy-blue);
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
}

.policy-section h4 {
    color: var(--navy-blue);
    margin: 1.5rem 0 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.policy-section p {
    margin-bottom: 1rem;
    color: var(--text-dark);
    line-height: 1.7;
}

.policy-section ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.policy-section li {
    margin-bottom: 0.75rem;
    line-height: 1.6;
    color: var(--text-dark);
}

.policy-highlight {
    background: rgba(92, 186, 154, 0.12);
    padding: 1.5rem;
    border-radius: 12px;
    border: 2px solid rgba(92, 186, 154, 0.25);
    margin: 1.5rem 0;
}

.policy-alert {
    background: rgba(237, 106, 30, 0.12);
    padding: 1.5rem;
    border-radius: 12px;
    border: 2px solid rgba(237, 106, 30, 0.25);
    margin: 1.5rem 0;
    color: var(--text-dark);
}

.policy-contacts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.policy-contact-item {
    background: var(--light-gray);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    border: 2px solid rgba(92, 186, 154, 0.2);
    transition: all 0.3s ease;
}

.policy-contact-item:hover {
    border-color: var(--primary-green);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(92, 186, 154, 0.15);
}

.policy-footer-note {
    text-align: center;
    font-style: italic;
    color: #666;
    margin-top: 2.5rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    font-size: 0.9rem;
    border: 1px solid #e9ecef;
}

/* Cookie Policy Specific Styles */
.cookie-category-detail {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px solid rgba(92, 186, 154, 0.2);
}

.cookie-table {
    display: grid;
    grid-template-columns: 1.5fr 2.5fr 1fr;
    gap: 0.75rem;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}

.cookie-row {
    display: contents;
}

.cookie-header {
    font-weight: 600;
    color: white;
}

.cookie-row > div {
    padding: 1rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    word-wrap: break-word;
}

.cookie-header > div {
    background: var(--navy-blue);
    color: white;
    font-weight: 600;
}

.cookie-table code {
    background: #e9ecef;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    font-weight: 600;
}

.browser-instructions {
    display: grid;
    gap: 1rem;
    margin: 1.5rem 0;
}

.browser-item {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid var(--primary-green);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.browser-item:hover {
    background: #f0f8ff;
    transform: translateX(5px);
}

.third-party-services {
    display: grid;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.service-item {
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px solid rgba(92, 186, 154, 0.2);
    transition: all 0.3s ease;
}

.service-item:hover {
    border-color: var(--primary-green);
    box-shadow: 0 4px 15px rgba(92, 186, 154, 0.15);
}

.service-item h4 {
    margin-bottom: 0.75rem;
    color: var(--navy-blue);
    font-size: 1.1rem;
}

.service-item p {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.service-item a {
    color: var(--primary-green);
    text-decoration: none;
    font-weight: 600;
}

.service-item a:hover {
    text-decoration: underline;
}

.effects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.effect-item {
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px solid rgba(92, 186, 154, 0.2);
    text-align: center;
    transition: all 0.3s ease;
}

.effect-item:hover {
    border-color: var(--primary-green);
    transform: translateY(-3px);
}

.effect-item h4 {
    margin-bottom: 0.75rem;
    color: var(--navy-blue);
    font-size: 1.1rem;
}

.effect-item p {
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.5;
}

/* Legal boxes in modal */
.modal-body .legal-box {
    background: var(--light-gray);
    padding: 1.25rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary-green);
}

.modal-body .legal-box h4 {
    color: var(--navy-blue);
    font-size: 1rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-body .legal-box p {
    margin-bottom: 0.75rem;
    line-height: 1.5;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.modal-body .legal-box ul {
    margin: 0.75rem 0;
    padding-left: 1.25rem;
}

.modal-body .legal-box li {
    margin-bottom: 0.25rem;
    color: var(--text-dark);
    font-size: 0.85rem;
}

/* CTA Section */
.cta-section {
    padding: 4rem 0;
    background: linear-gradient(135deg, var(--pink) 0%, var(--orange) 100%);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
    position: relative;
    z-index: 2;
}

.cta-section h2 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    color: var(--white);
    margin-bottom: 1.5rem;
}

.cta-section p {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
}

.cta-button-white {
    background: var(--white);
    color: var(--navy-blue);
}

.cta-button-white:hover {
    background: var(--light-gray);
    color: var(--navy-blue);
}

/* Footer */
.footer {
    background: var(--navy-blue);
    color: var(--white);
    padding: 3rem 0 1rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.footer-links {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-section h4 {
    color: var(--primary-green);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.footer-section p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.footer-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-menu li {
    margin-bottom: 0.5rem;
}

.footer-menu a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.9rem;
}

.footer-menu a:hover {
    color: var(--primary-green);
}

.footer-bottom {
    text-align: center;
}

.footer-bottom p {
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.9);
}

.footer-disclaimer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-disclaimer p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    line-height: 1.4;
    margin: 0;
}

/* Animations */
@keyframes slideInLeft {
    from {
        transform: translateX(-50px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(50px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.1); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Scroll reveal animation */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile Styles */
@media (max-width: 768px) {
    .header {
        padding: 0.5rem 0;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100vh;
        background: rgba(30, 61, 111, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: left 0.3s ease;
        z-index: 999;
    }

    .nav-menu a {
        color: var(--white) !important;
        font-size: 1.25rem;
        margin: 1rem 0;
        text-shadow: none;
    }

    .nav-menu.active {
        left: 0;
    }

    .hamburger {
        display: flex;
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
        background: var(--white);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
        background: var(--white);
    }

    .hero-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
        padding-top: 2rem;
    }

    .benefits-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .contact-form {
        padding: 1.5rem;
    }

    .logo {
        height: 60px;
    }

    .header.scrolled .logo-scrolled {
        height: 40px;
    }

    .features {
        padding: 3rem 0;
    }

    .benefits {
        padding: 3rem 0;
    }

    .contact-section {
        padding: 3rem 0;
    }

    .cta-section {
        padding: 3rem 0;
    }

    /* Modal Mobile Responsive */
    .modal-content, .success-modal-content, .error-modal-content, .policy-modal-content {
        width: 95%;
        margin: 1rem;
        max-height: 95vh;
        border-radius: 16px;
    }

    .modal-header, .success-modal-header, .error-modal-header, .policy-modal-header {
        padding: 1.5rem;
        text-align: center;
    }

    .policy-modal-header h2 {
        font-size: 1.5rem;
    }

    .modal-close, .policy-modal-close {
        position: absolute;
        top: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    .modal-body, .success-modal-body, .error-modal-body, .policy-modal-body {
        padding: 1.5rem;
        max-height: calc(95vh - 160px);
        font-size: 0.95rem;
        line-height: 1.6;
    }

    .modal-footer, .success-modal-footer, .error-modal-footer, .policy-modal-footer {
        padding: 1rem 1.5rem;
        flex-direction: column;
        gap: 1rem;
    }

    .modal-btn-close, .success-close-btn, .error-close-btn, .policy-btn-close, .policy-button {
        width: 100%;
        padding: 1rem;
        font-size: 1rem;
    }

    .policy-toc {
        padding: 1.5rem;
    }

    .policy-toc-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .policy-toc a {
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    .policy-section {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .policy-section h3 {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }

    .policy-section h4 {
        font-size: 1rem;
    }

    .policy-contacts {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .policy-contact-item {
        padding: 1.25rem;
    }

    .policy-highlight, .policy-alert {
        padding: 1.25rem;
        margin: 1rem 0;
    }

    /* Cookie Table Mobile */
    .cookie-table {
        display: block;
        margin: 1rem 0;
    }

    .cookie-row {
        display: block;
        margin-bottom: 1.5rem;
        padding: 1rem;
        background: white;
        border-radius: 10px;
        border: 2px solid #e9ecef;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }

    .cookie-header {
        display: none;
    }

    .cookie-row > div {
        padding: 0.5rem 0;
        background: transparent;
        border: none;
        border-radius: 0;
    }

    .cookie-row > div:first-child {
        font-weight: 600;
        color: var(--navy-blue);
        border-bottom: 1px solid #e9ecef;
        padding-bottom: 0.75rem;
        margin-bottom: 0.75rem;
        font-size: 1rem;
    }

    .cookie-row > div:nth-child(2) {
        margin-bottom: 0.5rem;
    }

    .cookie-row > div:last-child {
        font-size: 0.9rem;
        color: #666;
        font-style: italic;
    }

    .effects-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .browser-instructions {
        gap: 0.75rem;
    }

    .browser-item {
        padding: 1rem;
        font-size: 0.9rem;
    }

    .service-item {
        padding: 1.25rem;
    }

    .cookie-category-detail {
        padding: 1.25rem;
        margin: 1.5rem 0;
    }

    .checkbox-group {
        padding: 1rem;
    }

    .checkbox-label {
        font-size: 0.85rem;
    }

    .checkmark {
        height: 20px;
        width: 20px;
        margin-right: 10px;
    }

    /* Footer responsive */
    .footer-links {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }

    .footer-section {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 1rem;
    }

    .hero-container,
    .features-container,
    .benefits-container,
    .contact-container,
    .cta-container,
    .footer-container {
        padding: 0 1rem;
    }

    .feature-card {
        padding: 1.5rem;
        min-height: 250px;
    }

    .feature-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    .logo {
        height: 50px;
    }

    .header.scrolled .logo-scrolled {
        height: 35px;
    }

    .submit-button {
        padding: 0.875rem 1.5rem;
        min-width: 200px;
        font-size: 1rem;
    }

    .cta-button {
        padding: 0.875rem 1.5rem;
        min-width: 200px;
        font-size: 1rem;
    }

    .benefits-visual {
        padding: 1.5rem;
    }

    .benefits-list li {
        font-size: 1rem;
        padding-left: 2.5rem;
    }

    .benefits-list li::before {
        width: 25px;
        height: 25px;
        font-size: 0.75rem;
    }

    /* Policy Modal Extra Small */
    .policy-modal {
        padding: 5px;
    }
    
    .policy-modal-content {
        border-radius: 12px;
        max-height: 95vh;
    }

    .policy-modal-header {
        padding: 1rem;
    }

    .policy-modal-header h2 {
        font-size: 1.3rem;
        padding-right: 3rem;
    }

    .policy-modal-close {
        top: 0.75rem;
        right: 0.75rem;
        width: 35px;
        height: 35px;
        font-size: 1.25rem;
    }

    .policy-modal-body {
        padding: 1rem;
        font-size: 0.9rem;
    }

    .policy-modal-footer {
        padding: 1rem;
    }

    .policy-section {
        padding: 1rem;
    }

    .policy-section h3 {
        font-size: 1.1rem;
    }

    .policy-toc {
        padding: 1rem;
    }

    .policy-toc h3 {
        font-size: 1.1rem;
    }

    .policy-toc a {
        padding: 0.6rem;
        font-size: 0.85rem;
    }

    .cookie-row {
        padding: 0.75rem;
    }

    .browser-item {
        padding: 0.75rem;
        font-size: 0.85rem;
    }

    .service-item {
        padding: 1rem;
    }

    .policy-contact-item {
        padding: 1rem;
    }
}

/* Scroll personalizzato per i modal */
.policy-modal-body::-webkit-scrollbar,
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.policy-modal-body::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.policy-modal-body::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb {
    background: var(--primary-green);
    border-radius: 4px;
}

.policy-modal-body::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--navy-blue);
}

/* Miglioramenti tipografici */
.policy-section strong {
    color: var(--navy-blue);
    font-weight: 600;
}

.policy-section em {
    color: var(--primary-green);
    font-style: normal;
    font-weight: 500;
}

/* Focus states migliorati */
.policy-toc a:focus,
.policy-btn-close:focus,
.policy-button:focus,
.modal-btn-close:focus,
.success-close-btn:focus,
.error-close-btn:focus {
    outline: 3px solid rgba(92, 186, 154, 0.4);
    outline-offset: 2px;
}

/* Animazioni più fluide */
.policy-section {
    transition: all 0.3s ease;
}

.policy-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

/* Spacing migliorato per leggibilità */
.policy-modal-body h3 + p {
    margin-top: 0.5rem;
}

.policy-modal-body p + ul {
    margin-top: -0.5rem;
}

.policy-modal-body ul + p {
    margin-top: 1rem;
}

/* Touch improvements for mobile */
@media (hover: none) and (pointer: coarse) {
    .cta-button:hover,
    .submit-button:hover,
    .nav-menu a:hover,
    .feature-card:hover,
    .policy-section:hover {
        transform: none;
    }

    .cta-button:active,
    .submit-button:active {
        transform: scale(0.98);
    }

    .feature-card:active {
        transform: translateY(-5px);
    }

    .policy-section:active {
        transform: translateY(-1px);
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .reveal {
        opacity: 1;
        transform: none;
    }

    .hero-content,
    .hero-visual {
        animation: none;
    }

    .dna-visual,
    .dna-helix,
    .dna-helix::after,
    .benefits-visual::before {
        animation: none;
    }
}

/* Print styles */
@media print {
    .header,
    .nav-menu,
    .hamburger,
    .modal,
    .success-modal,
    .error-modal,
    .policy-modal,
    .footer {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.4;
        color: black;
    }

    .hero,
    .features,
    .benefits,
    .contact-section,
    .cta-section {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .feature-card,
    .policy-section {
        page-break-inside: avoid;
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }

    a {
        text-decoration: underline;
        color: black;
    }

    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --primary-green: #047857;
        --navy-blue: #1e293b;
        --text-dark: #000000;
        --light-gray: #ffffff;
        --error-red: #b91c1c;
    }

    .feature-card,
    .policy-section,
    .contact-form {
        border: 2px solid var(--navy-blue);
    }

    .cta-button,
    .submit-button {
        border: 2px solid currentColor;
    }
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip to content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--navy-blue);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 10001;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 6px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --white: #1a1a1a;
        --light-gray: #2d2d2d;
        --text-dark: #e5e5e5;
    }

    body {
        background-color: var(--white);
        color: var(--text-dark);
    }

    .feature-card,
    .contact-form,
    .policy-section {
        background: #2d2d2d;
        color: var(--text-dark);
    }

    .modal-content,
    .success-modal-content,
    .error-modal-content,
    .policy-modal-content {
        background: #2d2d2d;
        color: var(--text-dark);
    }

    .policy-modal-body,
    .modal-body {
        background: #2d2d2d;
    }
}

/* Performance optimizations */
.hero-visual,
.dna-visual,
.dna-helix {
    will-change: transform;
}

.feature-card,
.policy-section {
    contain: layout style paint;
}

/* Ensure proper stacking context */
.header {
    isolation: isolate;
}

.modal,
.success-modal,
.error-modal,
.policy-modal {
    isolation: isolate;
}

/* Smooth scrolling for supported browsers */
@supports (scroll-behavior: smooth) {
    html {
        scroll-behavior: smooth;
    }
}
/* ===== CHECKBOX FIX - AGGIUNGI ALLA FINE DEL CSS ===== */

/* Forza la visibilità della checkbox e risolve conflitti */
.checkbox-group {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 10 !important;
}

.checkbox-label {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    align-items: flex-start !important;
    cursor: pointer !important;
}

.checkbox-label input[type="checkbox"] {
    position: absolute !important;
    opacity: 0 !important;
    cursor: pointer !important;
    height: 0 !important;
    width: 0 !important;
    z-index: -1 !important;
}

.checkmark {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    top: 2px !important;
    height: 22px !important;
    width: 22px !important;
    background-color: #ffffff !important;
    border: 2px solid var(--primary-green) !important;
    border-radius: 4px !important;
    margin-right: 12px !important;
    flex-shrink: 0 !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    z-index: 5 !important;
}

.checkbox-text {
    flex: 1 !important;
    color: var(--text-dark) !important;
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    line-height: 1.5 !important;
}

/* Stati hover e checked - con !important per sicurezza */
.checkbox-label:hover input ~ .checkmark {
    background-color: #f8f9fa !important;
    border-color: var(--navy-blue) !important;
}

.checkbox-label input:checked ~ .checkmark {
    background-color: var(--primary-green) !important;
    border-color: var(--primary-green) !important;
}

.checkmark:after {
    content: "" !important;
    position: absolute !important;
    display: none !important;
    left: 6px !important;
    top: 2px !important;
    width: 6px !important;
    height: 10px !important;
    border: solid white !important;
    border-width: 0 2px 2px 0 !important;
    transform: rotate(45deg) !important;
}

.checkbox-label input:checked ~ .checkmark:after {
    display: block !important;
}

/* Stili errore */
.checkbox-group.error {
    border-color: var(--error-red) !important;
    background: rgba(220, 53, 69, 0.05) !important;
}

.checkbox-group.error .checkmark {
    border-color: var(--error-red) !important;
}

.checkbox-group.error .error-message {
    display: block !important;
    color: var(--error-red) !important;
    font-size: 0.875rem !important;
    margin-top: 0.5rem !important;
}

/* Debug: contorno rosso temporaneo per vedere la checkbox */
.debug-checkbox .checkbox-group {
    outline: 2px solid red !important;
    outline-offset: 2px !important;
}

.debug-checkbox .checkmark {
    outline: 2px solid blue !important;
    outline-offset: 2px !important;
}

/* Responsive fix per mobile */
@media (max-width: 768px) {
    .checkbox-group {
        padding: 1rem !important;
    }
    
    .checkmark {
        height: 20px !important;
        width: 20px !important;
        margin-right: 10px !important;
    }
    
    .checkbox-text {
        font-size: 0.85rem !important;
    }
    
    .checkmark:after {
        left: 5px !important;
        top: 1px !important;
        width: 5px !important;
        height: 9px !important;
    }
}

/* Fix z-index conflicts */
.contact-form {
    position: relative !important;
    z-index: 1 !important;
}

.contact-form .checkbox-group {
    position: relative !important;
    z-index: 10 !important;
}

/* Accessibility improvements */
.checkbox-label:focus-within .checkmark {
    outline: 3px solid rgba(92, 186, 154, 0.4) !important;
    outline-offset: 2px !important;
}

/* Print styles */
@media print {
    .checkmark:after {
        display: block !important;
        border-color: black !important;
    }
    
    .checkbox-label input:checked ~ .checkmark {
        background-color: white !important;
        border-color: black !important;
    }
}
/* Nascondi DNA visual su mobile */
@media (max-width: 768px) {
    .dna-visual {
        display: none !important;
    }
}