/**
 * RevisioneOK - Stili frontend (da rinnovo_booking)
 */
:root {
    --bg-time-slot-libero: #d0ffb7;
    --bg-time-slot-selezionato: lightgreen;
    --bg-time-slot-disabilitato: lightgray;
    --bg-time-slot-occupato: #ff686b;
    --bg-time-slot-libero-hover: #bbfc99;

    --txt-time-slot-libero: black;
    --txt-time-slot-selezionato: black;
    --txt-time-slot-disabilitato: white;
    --txt-time-slot-occupato: black;
    --txt-time-slot-libero-hover: black;

    --medico-days-color: black;
}

/* Container principale */
#ro-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.ro-form-error {
    background: #fff3f3;
    color: #9f1d1d;
    border: 1px solid #ffd1d1;
    border-radius: 8px;
    padding: 12px 14px;
    margin: 0 0 16px;
    font-weight: 600;
}

/* Box medico / orari */
#ro-medico-days {
    padding-bottom: 50px;
    color: var(--medico-days-color);
}

/* Titoli */
.ro-h3 {
    font-size: 24px !important;
    line-height: 1.4;
    font-weight: 700 !important;
    color: #343434 !important;
    margin: 0 0 15px;
}

.ro-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* Container calendario + slot */
#ro-calendar-slot-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: nowrap;
}

/* Box calendario */
#ro-calendar-box {
    width: 50%;
    margin-right: 20px;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 0 20px 0 rgba(0, 0, 0, .1) !important;
}

/* Box orari */
#ro-slot-box {
    width: 50%;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 10px 10px 10px 10px;
    box-shadow: 0 0 20px 0 rgba(0, 0, 0, .1) !important;
}

/* Barra mese */
#ro-current-month {
    width: 100%;
    text-align: center;
    font-size: 18pt;
    padding-bottom: 10px;
}

#ro-calendar-controls a {
    color: black;
    cursor: pointer;
    width: 30px;
}

#ro-calendar-controls a:hover {
    color: grey;
}

#ro-calendar-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
}

#ro-calendar-controls span {
    margin: 0 10px;
    font-weight: bold;
    color: black;
}

/* Giorni settimana e calendario */
#ro-calendar-weekdays,
#ro-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    padding: 1px;
    height: 100% !important;
}

#ro-calendar-weekdays div,
#ro-calendar div {
    text-align: center;
    height: 40px;
    font-weight: bold;
    margin: 10px;
}

#ro-calendar .available {
    background-color: white;
    color: black;
    font-weight: bold;
    cursor: pointer;
    border: 1px solid #eee;
    line-height: 40px;
    border-radius: 10px;
}

#ro-calendar .available:hover {
    background-color: #d0ffb7;
}

#ro-calendar .available.selected {
    background-color: lightgreen;
    color: black;
    font-weight: bold;
    cursor: not-allowed;
    border: 1px solid #eee;
    line-height: 40px;
    border-radius: 10px;
}

#ro-calendar .disabled {
    color: #ccc;
    background-color: white;
    border: 1px solid #eee;
    line-height: 40px;
    border-radius: 10px;
}

/* Box slot orari */
#ro-selected-day {
    margin-top: 1px;
    padding: 10px;
}

.ro-placeholder {
    color: #999;
    font-weight: normal;
}

/* Lista slot orari (allineato a rinnovo_booking #time-slot-list; gap esplicito per temi che resettano grid) */
#ro-time-slot-list {
    display: grid !important;
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 10px !important;
    row-gap: 10px !important;
    column-gap: 10px !important;
    width: 100%;
    box-sizing: border-box;
}

/* Separatore visivo tra due fasce orarie nella stessa giornata */
.ro-slot-band-spacer {
    grid-column: 1 / -1;
    min-height: 20px;
    height: 20px;
    pointer-events: none;
}

/* Pulsanti slot (ro-slot-btn = time-slot) */
.ro-slot-btn {
    display: block;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    background-color: var(--bg-time-slot-libero);
    color: var(--txt-time-slot-libero);
    text-align: center;
    border-radius: 5px;
    cursor: pointer;
    border: 1px solid #ddd;
    padding: 3px;
}


.ro-slot-btn.selected {
    background-color: var(--bg-time-slot-selezionato);
    color: var(--txt-time-slot-selezionato);
    cursor: pointer;
    font-weight: bold;
}

.ro-slot-btn.busy {
    background-color: var(--bg-time-slot-occupato);
    color: var(--txt-time-slot-occupato);
    cursor: not-allowed;
    pointer-events: none;
}

.ro-slot-btn.disabled {
    background-color: var(--bg-time-slot-disabilitato);
    color: var(--txt-time-slot-disabilitato);
    cursor: default;
    pointer-events: none;
}

.ro-slot-btn:hover:not(.busy):not(.disabled) {
    background-color: var(--bg-time-slot-libero-hover);
    color: var(--txt-time-slot-libero-hover);
}

.ro-slot-count {
    font-size: 0.75em;
    opacity: 0.9;
}

/* Form utente */
#ro-user-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    width: 100%;
    border-radius: 10px;
    margin-bottom: 50px;
    padding: 30px;
    box-sizing: border-box;
    box-shadow: 0 0 20px 0 rgba(0, 0, 0, .1) !important;
}

#ro-user-container div {
    display: flex;
    flex-direction: column;
}

#ro-user-container input[type="text"],
#ro-user-container input[type="email"],
#ro-user-container input[type="tel"] {
    padding: 10px;
    font-size: 16px;
    border: 1px solid #d8d8d8;
    border-radius: 8px;
    width: 95%;
    line-height: 2;
}

#ro-user-container select {
    padding: 10px;
    font-size: 16px;
    border: 1px solid #d8d8d8;
    border-radius: 8px;
    width: 99%;
    line-height: 2;
    appearance: none;
    background-color: white;
    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='currentColor' 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 10px center;
    background-size: 1em;
    padding-right: 30px;
}

/* GDPR (allineato a rinnovo_booking) */
#ro-gdpr-container {
    margin-bottom: 20px;
}

#ro-gdpr-container p {
    margin: 0 0 14px 0;
}

.ro-custom-checkbox {
    appearance: none;
    width: 32px;
    height: 32px;
    border: 2px solid #ccc;
    border-radius: 3px;
    margin-right: 10px;
    position: relative;
    cursor: pointer;
    vertical-align: middle;
}

.ro-custom-checkbox:checked {
    background-color: #75e282;
    border-color: #75e282;
}

.ro-custom-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 9px;
    top: 2px;
    width: 8px;
    height: 16px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.ro-checkbox-label {
    cursor: pointer;
    vertical-align: middle;
    font-size: 1.1rem;
    line-height: 1.3;
}

/* Submit */
#ro-submit {
    text-align: center;
    width: 100%;
    padding: 20px;
    font-size: 18px;
    cursor: pointer;
}

.ro-btn,
.button-submit {
    background-color: #adf7b6;
    color: black;
    border: 0px solid #ddd;
    border-radius: 10px;
    padding: 20px 80px;
    font-size: 18px;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
}

.ro-btn:hover,
.button-submit:hover {
    background-color: lightgreen;
}

.ro-btn-paypal {
    background: #0070ba;
}

.ro-btn-paypal:hover {
    background: #005ea6;
}

.ro-btn-stripe {
    background: #635bff;
}

.ro-btn-stripe:hover {
    background: #5248e5;
}

/* Conferma */
#ro-conferma {
    max-width: 900px;
    margin: 0 auto;
}

#ro-conferma .ro-conferma-title {
    text-align: center;
    font-size: 3rem;
    line-height: 1.2;
    margin-bottom: 24px;
}

#ro-conferma .ro-summary-card {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 26px;
    border-radius: 12px;
    border: 1px solid #f1f1f1;
    box-shadow: 0 0 20px 0 rgba(0, 0, 0, .1);
    background: #fff;
    padding: 18px;
    margin-bottom: 28px;
}

#ro-conferma .ro-summary-main {
    padding: 6px 0;
}

#ro-conferma .ro-summary-row {
    border-bottom: 1px solid #efefef;
    padding: 15px 0;
    color: #222;
}

#ro-conferma .ro-summary-row:last-child {
    border-bottom: 0;
}

#ro-conferma .ro-summary-side {
    background: #f7f7f7;
    border-radius: 10px;
    padding: 26px 20px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

#ro-conferma .ro-side-label {
    margin: 0;
    font-size: 1rem;
    color: #444;
}

#ro-conferma .ro-side-datetime {
    margin: 0;
    font-size: 3rem;
    line-height: 1.05;
    font-weight: 700;
    color: #0f2141;
}

#ro-conferma .ro-side-datetime span {
    display: block;
}

#ro-conferma .ro-side-tipologia {
    margin: 0;
    font-size: 1rem;
    color: #222;
}

#ro-conferma .ro-tipologia-badge {
    display: inline-block;
    margin-left: 8px;
    background: #a9f2a9;
    color: #0e7a0e;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
    text-transform: uppercase;
}

#ro-conferma .ro-payment-options {
    text-align: center;
}

#ro-conferma .ro-payment-options p {
    margin-bottom: 14px;
}

#ro-conferma .ro-payment-options .ro-btn {
    min-width: 320px;
}

#ro-conferma .ro-summary {
    margin: 20px 0;
}

#ro-conferma .ro-summary dt {
    font-weight: 600;
    margin-top: 10px;
}

#ro-conferma .ro-summary dd {
    margin: 0;
}

/* Risposta */
#ro-risposta.success {
    color: #32d296;
    font-weight: 700;
}

#ro-risposta.error {
    color: #e74c3c;
    font-weight: 700;
}

.ro-link {
    color: #1976d2;
}

/* Riepilogo conferma */
.rb-box-conferma,
.ro-box-conferma {
    border-radius: 10px;
    box-sizing: border-box;
    border: 1px solid #f1f1f1;
    padding: 20px;
    margin: 15px 0;
    box-shadow: 0 0 20px 0 rgba(0, 0, 0, .1);
}

.rb-risposta-success,
.ro-risposta-success {
    color: #32d296;
    font-weight: 700;
    font-size: 1.7rem;
    line-height: 1.2;
    margin: 0 0 20px 0;
}

.rb-risposta-danger,
.ro-risposta-danger {
    color: #ff0000;
    font-weight: 700;
    font-size: 1.7rem;
    line-height: 1.2;
    margin: 0 0 20px 0;
}

/* Media query mobile */
@media (max-width: 600px) {
    #ro-calendar-slot-container {
        flex-wrap: wrap;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding-right: 20px;
    }

    #ro-calendar-box,
    #ro-slot-box {
        display: flex;
        flex-direction: column;
        width: 100%;
        margin: 0px;
    }

    #ro-slot-box {
        margin-top: 20px;
    }

    #ro-time-slot-list {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        row-gap: 10px !important;
        column-gap: 10px !important;
    }

    .ro-slot-btn {
        padding: 5px;
        font-size: 12px;
    }

    .ro-btn,
    .button-submit {
        padding: 20px 50px;
        font-size: 18px;
        box-shadow: 0 0 20px 0 rgba(0, 0, 0, .1) !important;
    }

    #ro-user-container {
        display: flex;
        flex-direction: column;
        gap: 20px;
        width: 100%;
    }

    #ro-calendar-weekdays div,
    #ro-calendar div {
        margin: 5px;
    }

    #ro-conferma .ro-conferma-title {
        font-size: 2rem;
    }

    #ro-conferma .ro-summary-card {
        grid-template-columns: 1fr;
        padding: 14px;
        gap: 16px;
    }

    #ro-conferma .ro-summary-side {
        padding: 18px 14px;
    }

    #ro-conferma .ro-side-datetime {
        font-size: 2.1rem;
    }

    #ro-conferma .ro-payment-options .ro-btn {
        min-width: auto;
        width: 100%;
    }
}
