﻿
    * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }

    .contact-form-container {
        font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
        background: #DDD6BE;
        min-height: 100vh;
        padding: 20px;
        color: #000000;
        display: flex;
        justify-content: center;
        align-items: center;
        position: relative;
        overflow-x: hidden;
    }

    .contact-form-container #form_map {
        width: 100%;
        max-width: 1400px;
        margin: 0 auto;
        background: rgba(255, 255, 255, 0.9);
        border-radius: 24px;
        border: 1px solid rgba(0, 0, 0, 0.1);
        overflow: hidden;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        position: relative;
        z-index: 0;
    }

    .contact-form-container .form-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        min-height: 600px;
    }

    .contact-form-container .crm-form {
        padding: 50px;
        background: rgba(255, 255, 255, 0.8);
    }

    .contact-form-container .map-group {
        padding: 50px;
        background: rgba(240, 240, 240, 0.8);
        border-left: 1px solid rgba(0, 0, 0, 0.1);
        display: flex;
        flex-direction: column;
    }

    .contact-form-container .form-header {
        text-align: center;
        margin-bottom: 40px;
    }

    .contact-form-container .form-header h1 {
        color: #056839;
        font-size: 3rem;
        font-weight: 700;
        margin-bottom: 12px;
        text-shadow: 0 2px 4px rgba(34, 139, 34, 0.2);
    }

    .contact-form-container .form-header p {
        color: #056839;
        font-size: 1.1rem;
        font-weight: 500;
        opacity: 0.9;
    }

    .contact-form-container .form-row {
        margin-bottom: 25px;
    }

    .contact-form-container .form-label label {
        display: block;
        color: #000000;
        font-size: 0.95rem;
        font-weight: 600;
        margin-bottom: 8px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .contact-form-container .form-field input,
    .contact-form-container .form-field textarea,
    .contact-form-container .form-field select {
        width: 100%;
        padding: 16px 20px;
        background: rgba(255, 255, 255, 0.9);
        border: 2px solid rgba(0, 0, 0, 0.2);
        border-radius: 12px;
        color: #000000;
        font-size: 1rem;
        transition: all 0.3s ease;
        font-family: inherit;
    }

    .contact-form-container .form-field input:focus,
    .contact-form-container .form-field textarea:focus,
    .contact-form-container .form-field select:focus {
        outline: none;
        border-color: #056839;
        box-shadow: 0 0 0 3px rgba(34, 139, 34, 0.2);
        background: rgba(255, 255, 255, 1);
    }

    .contact-form-container .form-field input::placeholder,
    .contact-form-container .form-field textarea::placeholder {
        color: #666666;
    }

    .contact-form-container .form-field textarea {
        resize: vertical;
        min-height: 120px;
    }

    .contact-form-container .captcha-container {
        display: flex;
        align-items: center;
        gap: 15px;
        background: rgba(255, 255, 255, 0.9);
        padding: 20px;
        border-radius: 12px;
        border: 2px solid rgba(0, 0, 0, 0.2);
        margin-bottom: 25px;
        flex-wrap: wrap;
    }

    .contact-form-container .captcha-image-container {
        display: flex;
        align-items: center;
        gap: 15px;
        flex: 1;
        min-width: 200px;
    }

    .contact-form-container .captcha-image {
        background: #f8f9fa;
        border: 2px solid #dee2e6;
        border-radius: 8px;
        padding: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 120px;
        height: auto;
        overflow: hidden;
    }

    .contact-form-container .captcha-image img {
        max-width: 100%;
        height: auto;
        display: block;
        border-radius: 4px;
    }

    .contact-form-container .captcha-input {
        width: 140px !important;
        padding: 12px 16px !important;
        text-align: center;
        font-weight: 700;
        font-size: 1.2rem;
        background: rgba(255, 255, 255, 1) !important;
        text-transform: uppercase;
        letter-spacing: 1px;
    }

    .contact-form-container .captcha-refresh {
        background: #056839;
        color: white;
        border: none;
        border-radius: 50%;
        width: 44px;
        height: 44px;
        cursor: pointer;
        font-size: 1.2rem;
        transition: transform 0.3s ease; 
        display: flex;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        padding: 0;
        min-width: unset;
    }

    .contact-form-container .captcha-refresh:hover {
        transform: rotate(180deg);
    }

    .contact-form-container .captcha-label {
        font-weight: 600;
        color: #056839;
        font-size: 0.95rem;
        margin-bottom: 8px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .contact-form-container .form-actions {
        display: flex;
        gap: 16px;
        margin-top: 35px;
    }

    .contact-form-container .form-button {
        padding: 16px 32px;
        border: none;
        border-radius: 12px;
        font-size: 1rem;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        position: relative;
        overflow: hidden;
        font-family: inherit;
    }

    .contact-form-container input[type="reset"] {
        background: #ffffff;
        color: #666666;
        border: 2px solid #cccccc;
        flex: 0.7;
        transition: all 0.3s ease;
    }

    .contact-form-container input[type="reset"]:hover {
        border-color: #056839;
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(5, 104, 57, 0.3);
    }

    .contact-form-container .form-submit {
        background: #056839;
        color: white; 
        border: 2px solid #056839;
        flex: 1; 
        transition: all 0.3s ease;
        transform: scale(1);
    }

    .contact-form-container .form-submit:hover {
        background: #056839;
        color: white;
        transform: scale(1.08) translateY(-3px); 
        box-shadow: 0 10px 30px rgba(5, 104, 57, 0.4), 0 0 25px rgba(5, 104, 57, 0.3);
        border-color: #056839;
        
    }

    .contact-form-container .form-submit:active {
        transform: scale(1.02) translateY(-1px);
        box-shadow: 0 6px 20px rgba(5, 104, 57, 0.4);
    }

    .contact-form-container .form-submit:focus {
        outline: 3px solid rgba(5, 104, 57, 0.5);
        outline-offset: 2px;
    }

    .contact-form-container .form-submit:disabled {
        background: #cccccc;
        color: #666666;
        transform: scale(1);
        box-shadow: none;
        cursor: not-allowed;
        border-color: #cccccc;
    }

    .contact-form-container .form-submit:disabled:hover {
        background: #cccccc;
        color: #666666;
        transform: scale(1);
        box-shadow: none;
        border-color: #cccccc;
    }

    .contact-form-container .map-description {
        color: #000000;
        font-size: 1.1rem;
        line-height: 1.6;
        margin-bottom: 30px;
        text-align: center;
        font-weight: 500;
    }

    .contact-form-container .map-container {
        flex: 1;
        border-radius: 16px;
        overflow: hidden;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
        border: 2px solid rgba(0, 0, 0, 0.1);
        margin-bottom: 25px;
    }

    .contact-form-container .map-container iframe {
        width: 100%;
        height: 100%;
        min-height: 350px;
        border: none;
        filter: contrast(1.1);
    }

    .contact-form-container .map-link {
        text-align: center;
    }

    .contact-form-container .map-link a {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        color: #056839;
        text-decoration: none;
        font-weight: 600;
        font-size: 1rem;
        padding: 12px 24px;
        border: 2px solid #056839;
        border-radius: 8px;
        transition: all 0.3s ease;
        background: rgba(34, 139, 34, 0.1);
    }

    .contact-form-container .map-link a:hover {
        background: #056839;
        color: white;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(34, 139, 34, 0.3);
    }

    .contact-form-container .required {
        color: #dc2626;
    }

    .contact-form-container .form-checkbox {
        transform: scale(1.2);
        margin-right: 6px; /* Ridotto per meno spazio */
    }

    .contact-form-container .checkbox-row {
        display: flex;
        align-items: center;
        gap: 3px; /* Ridotto ulteriormente lo spazio tra checkbox e testo */
    }

    /* Popup Notification Styles */
    .popup-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(5px);
        display: flex;
        justify-content: center;
        align-items: center;
        z-index: 100; /* Abbassato da 10000 */
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .popup-overlay.show {
        opacity: 1;
        visibility: visible;
    }

    .popup-content {
        background: white;
        border-radius: 20px;
        padding: 40px;
        max-width: 500px;
        width: 90%;
        max-height: 80vh;
        overflow-y: auto;
        position: relative;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
        transform: scale(0.8) translateY(50px);
        transition: all 0.3s ease;
        text-align: center;
    }

    .popup-overlay.show .popup-content {
        transform: scale(1) translateY(0);
    }

    .popup-close {
        position: absolute;
        top: 15px;
        right: 20px;
        background: none;
        border: none;
        font-size: 24px;
        cursor: pointer;
        color: #666;
        width: 30px;
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        transition: all 0.3s ease;
        z-index: 101; /* Abbassato da 10001 */
    }

    .popup-close:hover {
        background: #f0f0f0;
        color: #333;
    }

    .popup-icon {
        width: 80px;
        height: 80px;
        margin: 0 auto 20px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 40px;
        color: white;
        position: relative;
    }

    .popup-icon.success {
        background: linear-gradient(135deg, #10b981, #059669);
        animation: successPulse 2s ease-in-out;
    }

    .popup-icon.error {
        background: linear-gradient(135deg, #ef4444, #dc2626);
        animation: errorShake 0.6s ease-in-out;
    }

    .popup-title {
        font-size: 24px;
        font-weight: 700;
        margin-bottom: 15px;
        color: #333;
    }

    .popup-title.success {
        color: #059669;
    }

    .popup-title.error {
        color: #dc2626;
    }

    .popup-message {
        font-size: 16px;
        line-height: 1.6;
        color: #666;
        margin-bottom: 30px;
    }

    .popup-button {
        background: #056839;
        color: white;
        border: none;
        padding: 12px 30px;
        border-radius: 8px;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .popup-button:hover {
        background: #1F7A1F;
        transform: translateY(-2px);
        box-shadow: 0 4px 15px rgba(34, 139, 34, 0.3);
    }

    .popup-button.error {
        background: #dc2626;
    }

    .popup-button.error:hover {
        background: #b91c1c;
        box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
    }

    @keyframes successPulse {
        0%, 100% { transform: scale(1); }
        50% { transform: scale(1.1); }
    }

    @keyframes errorShake {
        0%, 100% { transform: translateX(0); }
        25% { transform: translateX(-5px); }
        75% { transform: translateX(5px); }
    }

    /* Loading spinner for form submission */
    .form-loading {
        display: none;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        z-index: 50; /* Abbassato da 1000 */
    }

    .spinner {
        width: 40px;
        height: 40px;
        border: 4px solid #f3f3f3;
        border-top: 4px solid #056839;
        border-radius: 50%;
        animation: spin 1s linear infinite;
    }

    @keyframes spin {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
    }

    /* Responsive Design */
    @media (max-width: 1200px) {
        .contact-form-container #form_map {
            max-width: 95%;
        }
    }

    @media (max-width: 1024px) {
        .contact-form-container .form-container {
            grid-template-columns: 1fr;
        }
        
        .contact-form-container .map-group {
            border-left: none;
            border-top: 1px solid rgba(0, 0, 0, 0.1);
            min-height: 400px;
        }

        .contact-form-container .form-header h1 {
            font-size: 2.5rem;
        }

        .contact-form-container .crm-form,
        .contact-form-container .map-group {
            padding: 40px;
        }
    }

    @media (max-width: 768px) {
        .contact-form-container {
            padding: 15px;
        }

        .contact-form-container .form-header h1 {
            font-size: 2.2rem;
        }

        .contact-form-container .crm-form,
        .contact-form-container .map-group {
            padding: 30px;
        }

        .contact-form-container .form-actions {
            flex-direction: column;
        }

        .contact-form-container .form-button {
            width: 100%;
            padding: 18px 24px;
        }

        /* Reset flex values for mobile */
        .contact-form-container input[type="reset"],
        .contact-form-container .form-submit {
            flex: 1;
        }

        .contact-form-container .captcha-container {
            flex-direction: column;
            gap: 12px;
            align-items: stretch;
        }

        .contact-form-container .captcha-image-container {
            flex-direction: column;
            align-items: center;
            gap: 12px;
        }

        .contact-form-container .captcha-input {
            width: 160px !important;
        }

        .contact-form-container .captcha-image {
            min-width: 100px;
        }

        .popup-content {
            padding: 30px 25px;
            margin: 20px;
        }

        .popup-icon {
            width: 60px;
            height: 60px;
            font-size: 30px;
        }

        .popup-title {
            font-size: 20px;
        }
    }

    @media (max-width: 640px) {
        .contact-form-container {
            padding: 10px;
        }

        .contact-form-container .form-header h1 {
            font-size: 2rem;
        }

        .contact-form-container .form-header p {
            font-size: 1rem;
        }

        .contact-form-container .crm-form,
        .contact-form-container .map-group {
            padding: 25px;
        }

        .contact-form-container .form-field input,
        .contact-form-container .form-field textarea,
        .contact-form-container .form-field select {
            padding: 14px 16px;
        }

        .contact-form-container .map-container iframe {
            min-height: 300px;
        }
    }

    @media (max-width: 480px) {
        .contact-form-container .crm-form,
        .contact-form-container .map-group {
            padding: 20px;
        }

        .contact-form-container .form-header h1 {
            font-size: 1.8rem;
        }

        .contact-form-container .form-button {
            padding: 16px 20px;
            font-size: 0.9rem;
        }

        .popup-content {
            padding: 25px 20px;
        }
    }

    @media (max-width: 360px) {
        .contact-form-container {
            padding: 8px;
        }

        .contact-form-container .crm-form,
        .contact-form-container .map-group {
            padding: 15px;
        }

        .contact-form-container .form-header h1 {
            font-size: 1.6rem;
        }
    }


.contact-form-container .hp-field {
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
