/* --- TEMA DARK PER DARK BARBER BOOKING --- */
#dbb-booking-container {
    max-width: 600px;
    margin: 20px auto;
    padding: 25px;
    background-color: #282b30;
    border: 1px solid #424549;
    border-radius: 8px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    position: relative;
    overflow: hidden;
    color: #e0e0e0;
}
.dbb-step h2 {
    text-align: center;
    color: #ffffff;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #424549;
    font-weight: 600;
}

/* --- Stili generali per elementi del form --- */
#dbb-booking-form select,
#dbb-booking-form input[type="text"],
#dbb-booking-form input[type="email"],
#dbb-booking-form input[type="tel"],
#dbb-booking-form textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #424549;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 16px;
    background-color: #36393f;
    color: #e0e0e0;
    transition: all 0.2s ease-in-out;
}
#dbb-booking-form input:focus,
#dbb-booking-form select:focus,
#dbb-booking-form textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 8px rgba(0, 123, 255, 0.5);
}
#dbb-booking-form ::-webkit-input-placeholder { color: #8a8d90; }
#dbb-booking-form ::-moz-placeholder { color: #8a8d90; }
#dbb-booking-form :-ms-input-placeholder { color: #8a8d90; }
#dbb-booking-form :-moz-placeholder { color: #8a8d90; }

#dbb-booking-form select {
    appearance: none; -webkit-appearance: none; -moz-appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23FFFFFF%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 10px;
}

/* --- Pulsanti --- */
.dbb-button {
    width: 100%;
    background-color: #007bff;
    color: white;
    padding: 14px 20px;
    margin-top: 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    transition: background-color 0.3s, transform 0.1s;
}
.dbb-button:hover:not(:disabled) {
    background-color: #0056b3;
    transform: translateY(-1px);
}
.dbb-button:active:not(:disabled) {
    transform: translateY(0);
}
.dbb-button:disabled {
    background-color: #424549;
    color: #8a8d90;
    cursor: not-allowed;
}
.dbb-prev-step {
    background-color: #5a6268;
    float: left;
    width: 48%;
}
.dbb-prev-step:hover:not(:disabled) {
    background-color: #4a4f54;
}
.dbb-next-step, #dbb-submit-booking {
    float: right;
    width: 48%;
}
.dbb-step:after {
    content: ""; display: table; clear: both;
}

/* --- Step Servizi --- */
.dbb-service-list { display: flex; flex-direction: column; gap: 10px; }
.dbb-service-button {
    background-color: #36393f;
    border: 1px solid #424549;
    border-radius: 4px;
    padding: 15px;
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: all 0.2s;
    color: #e0e0e0;
}
.dbb-service-button:hover { border-color: #007bff; background-color: #424549; }
.dbb-service-button .service-name { font-weight: bold; font-size: 16px; display: block; color: #ffffff; }
.dbb-service-button .service-details { font-size: 14px; color: #b0b0b0; }

/* --- Step Data e Ora --- */
.dbb-date-time-wrapper { display: flex; flex-wrap: wrap; gap: 20px; }
#dbb-datepicker { flex: 1; min-width: 250px; }
#dbb-time-slots {
    flex: 1; min-width: 250px; max-height: 280px; overflow-y: auto; padding-right: 10px;
    display: flex; flex-wrap: wrap; gap: 8px;
}
#dbb-time-slots .dbb-time-slot {
    flex-basis: calc(33.33% - 6px);
    margin: 0; padding: 12px 5px; border: 1px solid #424549;
    border-radius: 4px; text-align: center; cursor: pointer;
    background-color: #36393f; color: #e0e0e0; transition: all 0.2s;
}
#dbb-time-slots .dbb-time-slot:hover { background-color: #424549; border-color: #555; }
#dbb-time-slots .dbb-time-slot.selected {
    background-color: #007bff; color: white;
    border-color: #007bff; font-weight: bold;
}
#dbb-time-slots p { margin-top: 0; color: #b0b0b0; width: 100%; }

/* --- Step Dati Cliente --- */
.dbb-summary {
    background-color: #1e2124; padding: 15px; border-radius: 4px;
    margin-bottom: 20px; border-left: 4px solid #007bff;
}
.dbb-summary p { margin: 0; color: #e0e0e0; line-height: 1.6; }
.dbb-privacy { margin: 15px 0; display: flex; align-items: center; }
#dbb-privacy-check { width: auto; margin-right: 10px; }
#dbb-privacy-check + label { cursor: pointer; }

/* --- Step Conferma e Loader --- */
#dbb-step-5 { text-align: center; color: #e0e0e0; }
#dbb-step-5 h2 { color: #28a745; }
#dbb-loader {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex; justify-content: center; align-items: center; z-index: 1001;
}
.dbb-spinner {
    border: 5px solid #424549; border-top: 5px solid #007bff;
    border-radius: 50%; width: 50px; height: 50px;
    animation: spin 1s linear infinite;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* --- Stili Responsive --- */
@media (max-width: 640px) {
    #dbb-booking-container { padding: 15px; margin: 10px auto; }
    .dbb-step h2 { font-size: 1.5em; }
    .dbb-prev-step, .dbb-next-step, #dbb-submit-booking {
        width: 100%; float: none; margin-bottom: 10px;
    }
    #dbb-time-slots .dbb-time-slot { flex-basis: calc(50% - 5px); font-size: 15px; }
    .dbb-date-time-wrapper { flex-direction: column; }
    #dbb-time-slots { max-height: 200px; }
}

/* --- Stili per reCAPTCHA Responsive --- */
.dbb-recaptcha-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
}
@media (max-width: 320px) {
    .g-recaptcha {
        transform: scale(0.77);
        transform-origin: center; 
    }
}
/* --- FIX CALENDARIO RESPONSIVE SU MOBILE --- */

/* Applica queste regole solo quando lo schermo è più piccolo di 640px */
@media (max-width: 640px) {
    
    /* Seleziona il calendario SOLO dentro al form delle prenotazioni */
    #dbb-booking-container .ui-datepicker {
        width: 100% !important; /* Forza la larghezza al 100% del contenitore */
        margin-top: 15px;      /* Aggiunge un po' di spazio sopra */
        box-sizing: border-box;  /* Assicura che padding e bordi non creino overflow */
    }

    /* Rende le celle dei giorni più piccole per stare nello spazio */
    #dbb-booking-container .ui-datepicker td {
        padding: 1px;
    }

    /* Rimpicciolisce leggermente il testo dei giorni */
    #dbb-booking-container .ui-datepicker td a,
    #dbb-booking-container .ui-datepicker td span {
        font-size: 12px;
        padding: 5px !important;
    }

    /* Centra il titolo del mese (es. "Agosto 2025") */
    #dbb-booking-container .ui-datepicker .ui-datepicker-title {
        text-align: center;
    }
}