@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700;900&display=swap');

/* --- Stili Generali --- */
body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    color: #333;
    background-color: #fff;
}

body.popup-open {
    overflow: hidden;
}

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

/* --- Header & Hero (invariati) --- */
header {
    background-color: #fff;
    border-bottom: 1px solid #eee;
}

header .logo {
    height: 45px;
}

.header-content {
    display: flex;
    padding: 15px 20px;
    justify-content: center;
}

.hero {
    background: linear-gradient(100deg, rgba(0, 0, 0, 1) 0%, rgba(0, 44, 93, 1) 100%);
    color: white;
}

.hero-content {
    display: flex;
    align-items: stretch;
    padding: 0;
}

.hero-text {
    max-width: 50%;
    padding: 20px;
    box-sizing: border-box;
}

.hero-text h1 {
    font-size: 2.5rem;
    font-weight: 900;
    margin: 0;
}

.hero-text p {
    font-size: 1.6rem;
    line-height: 1.8rem;
    margin: 20px 0;
}

.hero-text ul li {
    font-size: 1.2rem;
    line-height: 1.6rem;

}

.hero-image {
    width: 45%;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-image: linear-gradient(to bottom, #e20613, #b00040, #6d0d49, #2e1633, #010101);
}

.consegna-banner {
    text-align: center;
    background-color: #00000029;
    font-size: 2rem;
    margin: 0px;
    width: 100%;
    box-sizing: border-box;
}



.hero-image img {
    max-width: 400px;
    width: 100%;
    margin-top: 0;
}

@media (max-width: 992px) {
    .hero-content {
        flex-direction: column;
    }

    .hero-text,
    .hero-image {
        width: 100%;
    }
}


/* --- Sezione Annunci Auto --- */
.car-listings {
    padding: 30px 20px;
    background-color: #ffffff;
}

.car-grid {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

/* --- NUOVO STILE CARD AUTO --- */
.car-card {
    background: #ffffff;
    background: linear-gradient(0deg, rgba(255, 255, 255, 1) 60%, rgba(161, 190, 214, 1) 100%);

    width: 380px;
    max-width: 100%;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.car-card-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 900;
    color: #003061;
}

.car-card-header p {
    margin: 4px 0 0;
    font-size: 0.8rem;
    color: #555;
}

.car-card-badge {

    margin-bottom: -40px;

    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    text-align: center;
    line-height: 1.2;
}

.car-card-title {
    padding: 0px 20px;
}

.car-card-image {
    padding: 20px 50px;
    text-align: center;
}

.car-card-image img {
    max-width: 100%;
    height: 200px;
    object-fit: contain;
}

.car-card-body {
    padding: 24px;
    border-top: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.car-price-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.car-price-section .price {
    font-size: 2.5rem;
    font-weight: 900;
    color: #d9232d;
    line-height: 1;
}

.car-price-section .details {
    font-size: 1rem;
    color: #666;
    line-height: 1.4;
}

.car-card-terms {
    font-size: 1rem;
    color: #949494;
    margin-top: 8px;
    margin-bottom: 24px;
}

.btn-preventivo {
    display: inline-block;
    background-color: #fff;
    color: #d9232d;
    padding: 8px 16px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    border: 1px solid #d9232d;
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
}

.btn-preventivo:hover {
    background-color: #d9232d;
    color: #fff;
}

/* --- Stili Popup Laterale --- */
.form-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.form-overlay.active {
    opacity: 1;
    visibility: visible;
}

.side-popup {
    position: fixed;
    top: 0;
    right: 0;
    max-width: 700px;
    width: 100%;
    height: 100%;
    background-color: #002d5a;
    color: white;
    z-index: 1001;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
    transform: translateX(100%);
    transition: transform 0.4s ease-in-out;
    display: flex;
    flex-direction: column;
}

.side-popup.active {
    transform: translateX(0);
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background-color: rgba(0, 0, 0, 0.2);
}

.popup-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 900;
}

.close-popup-btn {
    background: none;
    border: none;
    color: white;
    font-size: 2.5rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.8;
}

.close-popup-btn:hover {
    opacity: 1;
}

.popup-content {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
}

.selected-car-summary {
    background-color: rgba(255, 255, 255, 0.1);
    border-left: 4px solid #fff;
    border-radius: 4px;
    padding: 15px;
    margin: 20px 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

#contactForm input,
#contactForm textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border-radius: 5px;
    border: 1px solid #5a7b9c;
    background-color: #001f3d;
    color: white;
    box-sizing: border-box;
}

#contactForm .form-row {
    display: flex;
    gap: 15px;
}

#contactForm .privacy-policy {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

#contactForm .privacy-policy input {
    width: auto;
    margin-right: 10px;
}

#contactForm .privacy-policy a {
    color: #fff;
    text-decoration: underline;
}

.btn-contact {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    font-weight: 700;
    background-color: #e53935;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

/* --- Footer --- */
footer {
    background-color: #222;
    color: #aaa;
    text-align: center;
    padding: 20px 0;
    font-size: 0.9rem;
}

footer a,
.custom-control-label a,
.form-check-label a {
    color: white !important;
    text-decoration: underline;
}

.form-check-label {
    color: white !important;
}

/* --- Sezione Servizi --- */
.services-section {
    padding: 80px 20px;
    background-color: #fff;
    /* Sfondo bianco come nell'immagine */
    text-align: center;
}

.services-title {
    font-size: 2.5rem;

    color: #212529;
    margin-bottom: 50px;
}

.services-grid {
    display: grid;
    /* Crea 3 colonne su schermi grandi */
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.service-card {
    background-color: #F6F8F9;
    /* Grigio chiaro per le card */
    padding: 20px;
    border-radius: 8px;
    text-align: left;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.service-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #212529;
    margin-top: 0;
    margin-bottom: 15px;
}

/* Linea divisoria sottile */
.service-card .divider {
    width: 50px;
    height: 2px;
    background-color: #007bff;
    /* Colore blu o uno a tua scelta */
    margin-bottom: 15px;
}

.service-card p {
    font-size: 1rem;
    line-height: 1.6;
    color: #495057;
    margin-bottom: 0;
}

.service-card p strong {
    color: #212529;
    /* Rende il testo in grassetto più scuro e leggibile */
}

/* --- Media Queries per il Responsive Design --- */

/* Per tablet (sotto i 992px) */
@media (max-width: 992px) {
    .services-grid {
        /* Passa a 2 colonne */
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Per smartphone (sotto i 768px) */
@media (max-width: 768px) {
    .services-title {
        font-size: 2rem;
    }

    .services-grid {
        /* Passa a 1 colonna */
        grid-template-columns: 1fr;
    }

    .hero-text {
        padding: 20px 20px;
        max-width: 100%;
    }

    .hero-text h1 {
        font-size: 1.6em;

    }

    .hero-text p {
        font-size: 1.2rem;
        line-height: 1.8rem;
        margin: 20px 0;
    }

    .hero-text ul li {
        font-size: 1rem;
        line-height: 1.6rem;

    }

    .hero-image {
        padding: 20px;
    }

    .consegna-banner {
        font-size: 1.4em;
    }

    .car-listings {
        padding: 10px;
    }

}

/* --- Sezione Call to Action (CTA) --- */
.cta-section {
    padding: 60px 20px;
    background-color: #f0f2f5;
    /* Sfondo generale della pagina */
}

.cta-banner {
    display: flex;
    background-color: #1a1a1a;
    /* Colore di base scuro */

    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.cta-content {
    width: 50%;
    padding: 50px 60px;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cta-title {
    font-size: 1.8rem;
    font-weight: 900;
    margin: 0 0 15px 0;
    line-height: 1.2;
}

.cta-text {
    font-size: 1.1rem;
    color: #e0e0e0;
    margin: 0 0 30px 0;
    line-height: 1.6;
}

.cta-button {
    display: inline-block;
    background-color: #d9232d;
    color: #fff;
    padding: 12px 25px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
    align-self: flex-start;
    /* Allinea il bottone a sinistra */
}

.cta-button:hover {
    background-color: #b01c24;
}

.cta-image {
    width: 50%;
    background-image: linear-gradient(to right, #1a1a1a 0%, rgba(26, 26, 26, 0) 40%), url('img/giulianoleggiolungotermine.png');
    background-size: cover;
    background-position: center;
}

/* --- Media Queries per il Responsive Design --- */

/* Per tablet e schermi più piccoli (sotto i 992px) */
@media (max-width: 992px) {
    .cta-content {
        padding: 40px;
    }

    .cta-title {
        font-size: 1.8rem;
    }
}

/* Per smartphone (sotto i 768px) */
@media (max-width: 768px) {
    .cta-banner {
        flex-direction: column;
        /* Impila gli elementi verticalmente */
    }

    .cta-content,
    .cta-image {
        width: 100%;
    }

    .cta-image {
        min-height: 300px;
        /* Dà un'altezza all'immagine */
        /* Cambia il gradiente per funzionare verticalmente */
        background-image: linear-gradient(to bottom, #1a1a1a 0%, rgba(26, 26, 26, 0) 50%), url('img/giulianoleggiolungotermine.png');
    }
}


/* --- Stili Definitivi per il Popup Laterale --- */

/* Blocca lo scroll della pagina quando il popup è aperto */
body.popup-open {
    overflow: hidden;
}

/* Sfondo scuro semi-trasparente */
.form-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.form-overlay.active {
    opacity: 1;
    visibility: visible;
}



.side-popup.active {
    transform: translateX(0);
}

/* Header del popup (titolo e pulsante chiudi) */
.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background-color: rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.popup-title {
    margin: 0;
    font-size: 1.5rem;
}

.close-popup-btn {
    background: none;
    border: none;
    color: white;
    font-size: 2.5rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.8;
}

.close-popup-btn:hover {
    opacity: 1;
}

/* Contenuto del popup (form, ecc.) */

.selected-car-summary {
    background-color: rgba(255, 255, 255, 0.1);
    border-left: 4px solid #fff;
    border-radius: 4px;
    padding: 15px;
    margin: 20px 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Stili per il Form all'interno del popup */
#contactForm input,
#contactForm textarea,
#contactForm select,
#genericContactForm input,
#genericContactForm textarea,
#genericContactForm select {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border-radius: 5px;
    border: 1px solid #5a7b9c;
    background-color: #001f3d;
    color: white;
    box-sizing: border-box;
}


.form-check-input {
    width: auto !important;
    margin: 0;
}

.tipoCliente {
    margin: 0 !important;
}

#contactForm .form-row {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 15px;
}

#contactForm .form-row-group {
    display: flex;
    flex-direction: column;
    width: 100%;
}

#contactForm select.form-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
}

.form-error-message {
    background-color: #d9232d;
    color: white;
    text-align: center;
    padding: 10px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 0.9em;
    width: 100%;
}

#contactForm .privacy-policy {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

#contactForm .privacy-policy input {
    width: auto;
    margin-right: 10px;
}

#contactForm .privacy-policy a {
    color: #fff;
    text-decoration: underline;
}

.btn-contact {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    font-weight: 700;
    background-color: #e53935;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.btn-contact.disabled-button {
    background-color: #555 !important;
    cursor: not-allowed;
    opacity: 0.7;
}


.summary-car-image {
    display: block;
    max-width: 340px;
    width: 100%;
    margin: 0 auto 15px;
    /* Centra l'immagine e aggiunge spazio sotto */
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 20px;
    margin-top: 20px;
}

.summary-car-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
    margin: 0;
}

.summary-car-subtitle {
    font-size: 1rem;
    font-weight: 600;
    color: #dedede;
    margin: 0;
}

.summary-car-terms {
    font-size: 0.8rem;
    color: #cacaca;
    margin: 0;
}

/* --- Stili per il Toggle Cliente (Business/Privato) --- */
.customer-toggle-container {
    text-align: center;
    background: linear-gradient(0deg, rgba(255, 255, 255, 1) 0%, rgba(161, 190, 214, 1) 100%);
    padding-top: 20px;
    padding-bottom: 20px;
}

.customer-toggle-container p {
    margin-bottom: 10px;
    font-weight: 700;
    color: #1b003a;
    font-size: 1.1rem;
}

/* Stile per il contenitore dei pulsanti */
.customer-toggle-container .btn-group {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* Stile per i singoli pulsanti */
.btn-toggle {
    background-color: #fff;
    color: #495057;
    border: none;
    font-weight: 700;
    padding: 6px 25px;
    transition: all 0.3s ease;
    border-radius: 0;
    /* Il raggio lo gestisce il contenitore */
}

/* Stile per il pulsante attivo */
.btn-toggle.active {
    background-color: #002d5a;
    color: #fff;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Effetto al passaggio del mouse per i pulsanti non attivi */
.btn-toggle:not(.active):hover {
    background-color: #f8f9fa;
}

.invalid-feedback {
    margin-top: -16px;
    margin-bottom: 1em;
}

.was-validated .form-control:invalid~.invalid-feedback,
.was-validated .form-select:invalid~.invalid-feedback {
    display: block;
}

.was-validated .form-control:valid~.invalid-feedback,
.was-validated .form-select:valid~.invalid-feedback {
    display: none;
}

.tipoClienteGeneric {
    margin-bottom: 15px;
}

#genericContactForm .form-row {
    margin-bottom: 15px;
}