/*
 * Agendamento rápido — interface inspirada no WhatsApp.
 * Arquivo isolado para impedir que versões antigas do tema quebrem o modal.
 */
body.booking-open {
    overflow: hidden;
}

.booking-dialog[hidden],
.booking-dialog__step[hidden],
.booking-service[hidden],
.booking-dialog__error[hidden] {
    display: none !important;
}

.booking-dialog,
.booking-dialog * {
    box-sizing: border-box;
}

.booking-dialog {
    position: fixed;
    z-index: 1400;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
    font-family: inherit;
}

.booking-dialog__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 18, 34, .76);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.booking-dialog__panel {
    position: relative;
    z-index: 1;
    width: min(530px, 100%);
    max-height: min(92vh, 820px);
    max-height: min(92dvh, 820px);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .42);
    border-radius: 18px;
    background: #efeae2;
    box-shadow: 0 28px 90px rgba(0, 0, 0, .4);
    animation: booking-dialog-in .2s ease-out;
}

@keyframes booking-dialog-in {
    from { opacity: 0; transform: translateY(12px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.booking-dialog__heading {
    display: flex;
    min-height: 72px;
    align-items: center;
    gap: 11px;
    padding: 10px 13px;
    color: #fff;
    background: #075e54;
}

.booking-dialog__avatar {
    position: relative;
    display: block;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
}

.booking-dialog__avatar img {
    display: block;
    width: 48px;
    height: 48px;
    object-fit: contain;
    padding: 5px;
    border-radius: 50%;
    background: #fff;
}

.booking-dialog__avatar > i {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 12px;
    height: 12px;
    border: 2px solid #075e54;
    border-radius: 50%;
    background: #25d366;
}

.booking-dialog__heading > div {
    min-width: 0;
    flex: 1;
}

.booking-dialog__heading h2 {
    overflow: hidden;
    margin: 0 0 3px;
    color: #fff;
    font-size: 1rem;
    font-weight: 750;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.booking-dialog__heading div > span {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #d8eee9;
    font-size: .73rem;
}

.booking-dialog__heading div > span i {
    color: #38dc7b;
    font-size: .42rem;
}

.booking-dialog__close {
    display: grid;
    width: 39px;
    height: 39px;
    flex: 0 0 39px;
    place-items: center;
    padding: 0;
    color: #fff;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .1);
    font-size: 1rem;
    cursor: pointer;
}

.booking-dialog__close:hover,
.booking-dialog__close:focus-visible {
    background: rgba(255, 255, 255, .2);
    outline: none;
}

.booking-dialog__progress {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    align-items: center;
    min-height: 35px;
    padding: 9px 52px 9px 13px;
    background: #f7f9f8;
}

.booking-dialog__progress > span {
    height: 4px;
    border-radius: 10px;
    background: #d7e0dd;
    transition: background .18s ease;
}

.booking-dialog__progress > span.is-active {
    background: #20aa7d;
}

.booking-dialog__progress strong {
    position: absolute;
    right: 13px;
    color: #63726f;
    font-size: .69rem;
    font-weight: 800;
}

.booking-dialog__form {
    max-height: calc(min(92vh, 820px) - 107px);
    max-height: calc(min(92dvh, 820px) - 107px);
    overflow-x: hidden;
    overflow-y: auto;
    background-color: #efeae2;
    background-image:
        radial-gradient(circle at 18% 25%, rgba(7, 94, 84, .04) 0 2px, transparent 2.5px),
        radial-gradient(circle at 78% 68%, rgba(7, 94, 84, .035) 0 2px, transparent 2.5px);
    background-size: 35px 35px, 43px 43px;
    scrollbar-color: #aebdb8 transparent;
    scrollbar-width: thin;
}

.booking-dialog__step {
    padding: 18px 18px 20px;
}

.booking-chat__bubble {
    position: relative;
    width: fit-content;
    max-width: 88%;
    margin: 0 0 12px;
    padding: 9px 11px 6px;
    color: #253d38;
    border-radius: 4px 12px 12px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .14);
}

.booking-chat__bubble::before {
    position: absolute;
    top: 0;
    left: -7px;
    width: 0;
    height: 0;
    content: "";
    border-top: 8px solid #fff;
    border-left: 8px solid transparent;
}

.booking-chat__bubble p {
    margin: 0;
    color: inherit;
    font-size: .88rem;
    line-height: 1.45;
    white-space: pre-line;
}

.booking-chat__bubble small {
    display: block;
    margin-top: 2px;
    color: #82928e;
    font-size: .59rem;
    text-align: right;
}

.booking-chat__bubble--sent {
    margin-left: auto;
    border-radius: 12px 4px 12px 12px;
    background: #d9fdd3;
}

.booking-chat__bubble--sent::before {
    right: -7px;
    left: auto;
    border-top-color: #d9fdd3;
    border-right: 8px solid transparent;
    border-left: 0;
}

.booking-chat__bubble--sent small i {
    color: #43a2e4;
}

.booking-chat__bubble--preview {
    width: min(94%, 445px);
}

.booking-choices,
.booking-periods {
    margin: 16px 0 13px;
    padding: 0;
    border: 0;
}

.booking-choices legend,
.booking-periods legend,
.booking-service > label {
    display: block;
    width: 100%;
    margin-bottom: 8px;
    color: #40534f;
    font-size: .76rem;
    font-weight: 800;
}

.booking-choices {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 7px;
}

.booking-choices legend {
    grid-column: 1 / -1;
}

.booking-choices label,
.booking-periods label {
    position: relative;
    cursor: pointer;
}

.booking-choices input,
.booking-periods input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.booking-choices span {
    display: flex;
    min-height: 72px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-direction: column;
    padding: 8px 5px;
    color: #36504a;
    border: 1px solid #cfdbd7;
    border-radius: 11px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 2px 6px rgba(20, 58, 50, .06);
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.booking-choices span i {
    color: #128c7e;
    font-size: 1.15rem;
}

.booking-choices span b {
    font-size: .72rem;
}

.booking-choices input:checked + span {
    color: #075e54;
    border-color: #128c7e;
    background: #e5f8f0;
    box-shadow: 0 0 0 3px rgba(18, 140, 126, .12);
}

.booking-choices input:focus-visible + span,
.booking-periods input:focus-visible + span {
    outline: 3px solid rgba(18, 140, 126, .22);
    outline-offset: 2px;
}

.booking-service {
    margin: 13px 0;
}

.booking-select,
.booking-input {
    position: relative;
}

.booking-select > i,
.booking-input > i {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 13px;
    color: #128c7e;
    transform: translateY(-50%);
}

.booking-dialog__form .form-input {
    width: 100%;
    min-height: 47px;
    padding: 10px 12px;
    color: #233b35;
    border: 1px solid #c4d3ce;
    border-radius: 10px;
    background: #fff;
    font: inherit;
    font-size: .84rem;
}

.booking-select .form-input,
.booking-input .form-input {
    padding-left: 40px;
}

.booking-dialog__form .form-input:focus {
    border-color: #128c7e;
    outline: 0;
    box-shadow: 0 0 0 4px rgba(18, 140, 126, .12);
}

.booking-service > small {
    display: block;
    margin-top: 5px;
    color: #61736e;
    font-size: .66rem;
}

.booking-fields {
    margin-top: 13px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, .82);
    border-radius: 14px;
    background: rgba(255, 255, 255, .79);
    box-shadow: 0 4px 16px rgba(22, 65, 55, .07);
}

.booking-fields .form-group {
    margin-bottom: 12px;
}

.booking-fields .form-group > label {
    display: block;
    margin-bottom: 5px;
    color: #40534f;
    font-size: .76rem;
    font-weight: 800;
}

.booking-periods {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.booking-periods legend {
    flex: 0 0 100%;
}

.booking-periods legend small {
    font-weight: 600;
}

.booking-periods span {
    display: block;
    padding: 7px 9px;
    color: #49605a;
    border: 1px solid #cad8d3;
    border-radius: 999px;
    background: #fff;
    font-size: .67rem;
    font-weight: 750;
}

.booking-periods input:checked + span {
    color: #fff;
    border-color: #128c7e;
    background: #128c7e;
}

.booking-observation {
    margin: 8px 0 12px;
}

.booking-observation summary {
    color: #075e54;
    font-size: .74rem;
    font-weight: 800;
    cursor: pointer;
    list-style: none;
}

.booking-observation summary::-webkit-details-marker {
    display: none;
}

.booking-observation summary small {
    color: #667872;
    font-weight: 600;
}

.booking-observation textarea {
    min-height: 72px !important;
    margin-top: 8px;
    resize: vertical;
}

.booking-dialog__consent {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 9px 0 0;
    color: #526660;
    font-size: .67rem;
    line-height: 1.4;
}

.booking-dialog__consent input {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    margin-top: 1px;
    accent-color: #128c7e;
}

.booking-dialog__consent a {
    color: #075e54;
    font-weight: 700;
}

.booking-dialog__error {
    margin: 11px 0 0 !important;
    padding: 9px 11px;
    color: #991e29 !important;
    border: 1px solid #efbbc0;
    border-radius: 9px;
    background: #fff1f2;
    font-size: .75rem;
}

.booking-dialog__next,
.booking-dialog__send,
.booking-dialog__back {
    display: inline-flex;
    min-height: 47px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 10px;
    font: inherit;
    font-size: .82rem;
    font-weight: 850;
    cursor: pointer;
    transition: background .16s ease, transform .16s ease;
}

.booking-dialog__next,
.booking-dialog__send {
    margin-top: 13px;
    color: #fff;
    border: 1px solid #128c7e;
    background: #128c7e;
    box-shadow: 0 7px 16px rgba(18, 140, 126, .2);
}

.booking-dialog__step > .booking-dialog__next {
    width: 100%;
}

.booking-dialog__next:hover,
.booking-dialog__send:hover {
    background: #075e54;
    transform: translateY(-1px);
}

.booking-dialog__back {
    margin-top: 13px;
    color: #36504a;
    border: 1px solid #c5d3ce;
    background: rgba(255, 255, 255, .94);
}

.booking-dialog__actions {
    display: grid;
    grid-template-columns: .8fr 1.2fr;
    gap: 8px;
}

.booking-dialog__actions > * {
    width: 100%;
}

.booking-dialog__notice {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin: 15px 0 0;
    padding: 9px 11px;
    color: #506861;
    border-radius: 9px;
    background: rgba(255, 255, 255, .76);
    font-size: .69rem;
    line-height: 1.4;
}

.booking-dialog__notice i {
    margin-top: 2px;
    color: #128c7e;
}

@media (max-width: 620px) {
    .booking-dialog {
        place-items: end center;
        padding: 7px;
    }

    .booking-dialog__panel {
        width: 100%;
        max-height: calc(100vh - 14px);
        max-height: calc(100dvh - 14px);
        border-radius: 17px;
    }

    .booking-dialog__heading {
        min-height: 68px;
        padding: 9px 11px;
    }

    .booking-dialog__avatar,
    .booking-dialog__avatar img {
        width: 44px;
        height: 44px;
    }

    .booking-dialog__avatar {
        flex-basis: 44px;
    }

    .booking-dialog__form {
        max-height: calc(100vh - 117px);
        max-height: calc(100dvh - 117px);
    }

    .booking-dialog__step {
        padding: 15px 12px calc(17px + env(safe-area-inset-bottom));
    }

    .booking-chat__bubble {
        max-width: 94%;
    }

    .booking-choices {
        grid-template-columns: repeat(2, 1fr);
    }

    .booking-choices span {
        min-height: 59px;
        flex-direction: row;
    }

    .booking-fields {
        padding: 13px 11px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .booking-dialog__panel {
        animation: none;
    }
}
