/* ============================================= */
/* STILI PRINCIPALI PER IL SISTEMA PRENOTAZIONI */
/* ============================================= */

/* Container principale */
.prenotazione-form-plugin {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 20px;
}

@media (max-width: 768px) {
    .prenotazione-form-plugin {
        padding: 60px 15px;
    }
}

@media (max-width: 576px) {
    .prenotazione-form-plugin {
        padding: 50px 15px;
    }
}

/* Griglia contatti e form */
.contatti-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 40px;
}

@media (max-width: 992px) {
    .contatti-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

/* Form di prenotazione */
.prenotazione-form {
    background: #fff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 1px solid #e1e1e1;
}

@media (max-width: 768px) {
    .prenotazione-form {
        padding: 30px 25px;
    }
}

/* SEZIONE CONTATTI */
.contatti-info {
    background: #fff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 1px solid #e1e1e1;
}

@media (max-width: 768px) {
    .contatti-info {
        padding: 30px 25px;
    }
}

/* Animazioni */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* ============================================= */
/* STILI PER I CAMPI DEL FORM */
/* ============================================= */

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-input, 
.form-select, 
.form-textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e1e1e1;
    border-radius: 5px;
    font-size: 16px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background: #fff;
    color: #333;
}

.form-input:focus, 
.form-select:focus, 
.form-textarea:focus {
    outline: none;
    border-color: #1A5276;
    box-shadow: 0 0 0 3px rgba(26, 82, 118, 0.1);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.5;
}

.form-select {
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232C3E50' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    padding-right: 45px;
}

/* ============================================= */
/* BOTTONI */
/* ============================================= */

.btn-aqv {
    background: linear-gradient(135deg, #1A5276 0%, #2E86C1 100%);
    border: none;
    color: white;
    padding: 15px 30px;
    border-radius: 5px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
    min-height: 44px;
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.btn-aqv:hover {
    background: linear-gradient(135deg, #2E86C1 0%, #1A5276 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.btn-aqv:active {
    transform: translateY(-1px);
}

.btn-aqv:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-aqv.btn-secondary {
    background: transparent;
    color: #1A5276;
    border: 2px solid #1A5276;
}

.btn-aqv.btn-secondary:hover {
    background: #1A5276;
    color: white;
}

#btnCalcolaPrezzo,
#btnInviaRichiestaAvanzato {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    margin-top: 10px;
}

.contatti-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.contatti-buttons .btn-aqv {
    flex: 1;
    min-width: 140px;
    text-align: center;
}

@media (max-width: 768px) {
    .contatti-buttons {
        flex-direction: column;
    }
    
    .contatti-buttons .btn-aqv {
        width: 100%;
        margin: 5px 0;
    }
}

/* ============================================= */
/* RIEPILOGO PREZZO */
/* ============================================= */

.riepilogo-prezzo-avanzato {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 8px;
    margin: 25px 0;
    border-left: 4px solid #1A5276;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.riepilogo-riga {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    font-size: 15px;
}

.riepilogo-totale {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    font-size: 1.2em;
    margin: 20px 0 10px 0;
    padding-top: 15px;
    border-top: 2px solid #1A5276;
}

.sconto-applicato {
    color: #28a745;
    font-weight: bold;
}

/* ============================================= */
/* MESSAGGI DI STATO */
/* ============================================= */

.messaggio-aqv {
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: center;
    animation: slideDown 0.3s ease-out;
    font-size: 15px;
}

.messaggio-aqv.successo {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.messaggio-aqv.errore {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.messaggio-aqv.info {
    background: #cce7ff;
    color: #004085;
    border: 1px solid #b3d7ff;
}

.messaggio-aqv.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* ============================================= */
/* MODALE DI CONFERMA */
/* ============================================= */

.modale-overlay-aqv {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.modale-overlay-aqv.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modale-content-aqv {
    background-color: #fff;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: modaleAppear 0.3s ease-out;
}

@keyframes modaleAppear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modale-header-aqv {
    background-color: #1A5276;
    color: #fff;
    padding: 25px 30px;
    position: relative;
}

.modale-close-aqv {
    position: absolute;
    top: 20px;
    right: 25px;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.modale-close-aqv:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.modale-body-aqv {
    padding: 30px;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
}

.modale-body-aqv .riepilogo-prezzo {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid #1A5276;
}

/* Previeni lo scroll del body quando il modale è aperto */
body.modale-open {
    overflow: hidden;
}

/* ============================================= */
/* CONTATTI ITEMS */
/* ============================================= */

.contatti-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid #eee;
}

.contatti-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.contatti-item h3 {
    margin: 0 0 8px 0;
    color: #1A5276;
    font-size: 1.2em;
}

.contatti-item p {
    margin: 0;
    color: #333;
    font-weight: 500;
}

.contatti-item small {
    color: #666;
    font-size: 0.9em;
}

/* ============================================= */
/* FORM OSPITI AVANZATO */
/* ============================================= */

.form-ospiti-avanzato {
    margin-top: 20px;
}

.selezione-appartamento {
    margin-bottom: 20px;
}

.gruppo-ospiti {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .gruppo-ospiti {
        grid-template-columns: 1fr;
    }
}

#contatoreOspiti {
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
}

/* ============================================= */
/* RESPONSIVE IMPROVEMENTS */
/* ============================================= */

@media (max-width: 768px) {
    .form-input, 
    .form-select, 
    .form-textarea {
        font-size: 16px !important;
        padding: 12px 14px !important;
    }
    
    .btn-aqv {
        padding: 14px 20px !important;
        font-size: 15px !important;
        min-height: 50px !important;
    }
    
    .modale-content-aqv {
        width: 95vw !important;
        margin: 20px 10px !important;
    }
    
    .modale-body-aqv {
        padding: 20px !important;
    }
    
    .riepilogo-prezzo-avanzato {
        padding: 20px !important;
    }
    
    .riepilogo-riga {
        flex-direction: column;
        gap: 5px;
        align-items: flex-start;
    }
}

/* Fix per iOS */
@supports (-webkit-touch-callout: none) {
    .form-input, 
    .form-select, 
    .form-textarea {
        font-size: 16px !important;
    }
}

/* Migliora l'area cliccabile su mobile */
@media (max-width: 768px) {
    .btn-aqv,
    .form-input,
    .form-select {
        min-height: 48px;
    }
}


/* STILI PER IL MODALE - MIGLIORATI */
.modale-overlay-aqv {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.85) !important;
    z-index: 999999 !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
    opacity: 0;
    transition: opacity 0.3s ease !important;
}

.modale-overlay-aqv.active {
    display: flex !important;
    opacity: 1 !important;
}

.modale-content-aqv {
    background: white !important;
    border-radius: 12px !important;
    max-width: 600px !important;
    width: 100% !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4) !important;
    animation: modaleAppear 0.3s ease !important;
    position: relative !important;
}

@keyframes modaleAppear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modale-header-aqv {
    background-color: #1A5276;
    color: white;
    padding: 25px 30px;
    position: relative;
    border-radius: 12px 12px 0 0;
}

.modale-close-aqv {
    position: absolute !important;
    top: 20px !important;
    right: 25px !important;
    background: none !important;
    border: none !important;
    color: white !important;
    font-size: 1.8rem !important;
    cursor: pointer !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    transition: background-color 0.3s !important;
    z-index: 1000000 !important;
}

.modale-close-aqv:hover {
    background-color: rgba(255, 255, 255, 0.3) !important;
}

.modale-body-aqv {
    padding: 30px;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
}

/* Previeni lo scroll del body quando il modale è aperto */
body.modale-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
}

/* Migliora il bottone di chiusura */
#btnChiudiModaleAQV {
    background: #1A5276;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
    margin-top: 20px;
}

#btnChiudiModaleAQV:hover {
    background: #2E86C1;
}