/* === IMPOSTAZIONI GLOBALI E VARIABILI === */
:root {
    --primary-color: #1a1a2e;
    --secondary-color: #16213e;
    --accent-color: #03dac6;
    --accent-hover: #01b8a2;
    --text-color: #e0e0e0;
    --light-text-color: #a0a0a0;
    --card-bg: #1f2a40;
    --font-family: 'Poppins', sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--primary-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* === SEZIONE HERO === */
.hero-section {
    text-align: center;
    padding: 80px 20px 60px;
}

.hero-section h1 {
    font-size: 2.8rem;
    margin-bottom: 1rem;
    background: linear-gradient(90deg, #ffffff, var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-section p {
    font-size: 1.2rem;
    color: var(--light-text-color);
    max-width: 700px;
    margin: 0 auto;
}

/* === LAYOUT PRINCIPALE === */
.preventivatore-container {
    display: flex;
    align-items: flex-start;
    gap: 40px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px 60px;
}

.configuratore {
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.riepilogo-preventivo {
    flex: 1;
    position: sticky;
    top: 40px;
    background-color: var(--secondary-color);
    border-radius: 12px;
    padding: 30px;
    border: 1px solid #2a3b5e;
}

/* === STILE DELLE CARD === */
.card {
    background-color: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.card.active {
    border-color: var(--accent-color);
    box-shadow: 0 0 25px rgba(3, 218, 198, 0.1);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px 25px;
    cursor: pointer;
}

.card-header i {
    font-size: 1.5rem;
    color: var(--accent-color);
    width: 30px;
    text-align: center;
}

.card-header h2 {
    font-size: 1.4rem;
    margin-right: auto;
}

.card-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.25, 0.1, 0.25, 1), padding 0.5s ease;
    padding: 0 25px;
    background-color: rgba(0,0,0,0.1);
}

.card.active .card-body {
    max-height: 600px; /* Valore alto per permettere l'espansione */
    padding: 25px;
    border-top: 1px solid #2a3b5e;
}

/* === STILE DEGLI ELEMENTI DEL FORM === */
.option-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #2a3b5e;
}
.option-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.option-group label {
    font-size: 1rem;
    color: var(--light-text-color);
    flex-basis: 50%;
}
.checkbox-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}
.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}
.slider-group {
    flex-direction: column;
    align-items: flex-start;
}
.slider-wrapper {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
}
.slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: #334a70;
    outline: none;
    border-radius: 5px;
    transition: opacity .2s;
}
.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--accent-color);
    cursor: pointer;
    border-radius: 50%;
}
.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--accent-color);
    cursor: pointer;
    border-radius: 50%;
}
.slider-value, #ad_fee_display {
    font-weight: 600;
    color: var(--text-color);
    min-width: 50px;
    text-align: right;
}
select {
    padding: 8px 12px;
    background: #334a70;
    color: var(--text-color);
    border: 1px solid #4a6291;
    border-radius: 5px;
}

/* Stile per gli interruttori (toggle switch) */
.switch { position: relative; display: inline-block; width: 60px; height: 34px; }
.switch-small { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input, .switch-small input { opacity: 0; width: 0; height: 0; }
.slider-round { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #334a70; transition: .4s; border-radius: 34px; }
.slider-round:before {
    position: absolute;
    content: "";
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
.switch .slider-round:before { height: 26px; width: 26px; left: 4px; bottom: 4px; }
.switch-small .slider-round:before { height: 18px; width: 18px; left: 3px; bottom: 3px; }
input:checked + .slider-round { background-color: var(--accent-color); }
input:checked + .slider-round:before {
    -webkit-transform: translateX(26px);
    -ms-transform: translateX(26px);
    transform: translateX(26px);
}
.switch-small input:checked + .slider-round:before { transform: translateX(20px); }

/* === STILE DEL RIEPILOGO PREVENTIVO === */
.riepilogo-preventivo h3 {
    text-align: center;
    font-size: 1.6rem;
    margin-bottom: 25px;
}
.lista-servizi {
    min-height: 150px;
    margin-bottom: 20px;
}
.lista-servizi .empty-state {
    color: var(--light-text-color);
    text-align: center;
    padding-top: 40px;
}
.service-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 0.95rem;
}
.service-item span:first-child { color: var(--light-text-color); }
.service-item span:last-child { font-weight: 500; }
.riepilogo-preventivo hr {
    border: none;
    height: 1px;
    background-color: #2a3b5e;
    margin: 20px 0;
}
.totale-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}
.totale-item { display: flex; justify-content: space-between; font-size: 1rem; }
.totale-finale {
    display: flex;
    justify-content: space-between;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-top: 10px;
}
.prezzo-finale {
    font-size: 1.8rem;
}
.cta-button {
    width: 100%;
    padding: 15px;
    background-color: var(--accent-color);
    color: var(--primary-color);
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.cta-button:hover {
    background-color: var(--accent-hover);
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 1024px) {
    .preventivatore-container {
        flex-direction: column;
        padding: 0 20px 40px;
    }
    .riepilogo-preventivo {
        position: static;
        width: 100%;
    }
    .hero-section h1 {
        font-size: 2.2rem;
    }
}