.modal-layer,
.modal-layer * {
    box-sizing: border-box;
}

.modal-layer {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-family: "Plus Jakarta Sans", sans-serif;
}

.modal-layer.is-visible {
    display: flex;
}

.modal-layer a {
    color: inherit;
    text-decoration: none;
}

.modal-layer button,
.modal-layer input,
.modal-layer textarea {
    font: inherit;
}

.modal-layer button {
    cursor: pointer;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 12, 0.28);
    backdrop-filter: blur(8px);
}

.booking-modal {
    position: relative;
    z-index: 1;
    width: min(1200px, 100%);
    max-height: calc(100vh - 40px);
    overflow-x: hidden;
    overflow-y: auto;
    border-radius: 40px;
    background: #ffffff;
    border: 1px solid rgba(10, 10, 12, 0.08);
    box-shadow: 0 30px 80px rgba(20, 16, 30, 0.16);
    animation: booking-modal-in 240ms ease;
}

@keyframes booking-modal-in {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.985);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 1.4rem;
    right: 1.4rem;
    z-index: 3;
    width: 56px;
    height: 56px;
    border: 0;
    border-radius: 50%;
    background: rgba(10, 10, 12, 0.06);
}

.modal-close span {
    position: absolute;
    top: 27px;
    left: 16px;
    width: 24px;
    height: 2px;
    background: #0a0a0c;
}

.modal-close span:first-child {
    transform: rotate(45deg);
}

.modal-close span:last-child {
    transform: rotate(-45deg);
}

.booking-flow {
    padding: 2rem;
}

.booking-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    width: min(300px, 100%);
    margin: 0 0 1.5rem;
}

.progress-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(10, 10, 12, 0.1);
    transition: background 240ms ease, transform 240ms ease;
}

.progress-dot.is-active {
    background: #2b6170;
}

.progress-line {
    flex: 1;
    height: 3px;
    background: rgba(10, 10, 12, 0.08);
}

.booking-stage-viewport {
    overflow: hidden;
}

.booking-stage-track {
    display: flex;
    transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}

.booking-stage {
    width: 100%;
    flex: 0 0 100%;
}

.modal-form-head {
    max-width: 52rem;
    margin-bottom: 1.4rem;
}

.modal-form-head h2,
.confirmation-panel h2 {
    margin: 0;
    color: #0a0a0c;
    font-family: "Space Grotesk", sans-serif;
    font-weight: 700;
    letter-spacing: -0.06em;
    line-height: 0.98;
}

.modal-form-head h2 {
    font-size: clamp(1.15rem, 2.8vw, 1.7rem);
}

.details-summary,
.confirmation-copy,
.slot-empty,
.stage-summary,
.field span {
    color: #5f5a64;
}

.details-summary {
    margin: 0.8rem 0 0;
    font-size: 1rem;
    line-height: 1.7;
    font-weight: 500;
}

.form-alert {
    margin-bottom: 1rem;
    padding: 1rem 1.1rem;
    border-radius: 20px;
    background: rgba(181, 77, 71, 0.08);
    color: #b54d47;
    border: 1px solid rgba(181, 77, 71, 0.16);
}

.form-alert p {
    margin: 0.3rem 0 0;
}

.booking-form {
    display: grid;
    gap: 1.4rem;
}

.form-block {
    padding: 2rem;
    border-radius: 40px;
    background: #ffffff;
}

.block-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.block-head h3 {
    margin: 0;
    color: #0a0a0c;
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(0.95rem, 1.7vw, 1.2rem);
    letter-spacing: -0.05em;
}

.slot-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: 1.4rem;
    margin-top: 0.8rem;
    align-items: start;
}

.calendar-pane,
.workweek-calendar {
    display: flex;
    justify-content: center;
    width: 100%;
}

.slot-label,
.field span {
    display: block;
}

.slot-label {
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #5f5a64;
}

.stage-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.6rem;
}

.stage-footer-top {
    flex-shrink: 0;
    margin-top: 0;
    margin-left: auto;
}

.stage-summary {
    font-size: 0.88rem;
    line-height: 1.5;
    text-align: right;
    max-width: 18rem;
    font-weight: 700;
}

.booking-modal .primary-button,
.booking-modal .secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3.25rem;
    padding: 0.85rem 1.35rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    transition: transform 220ms ease, background-color 220ms ease, border-color 220ms ease, color 220ms ease;
}

.booking-modal .primary-button:hover,
.booking-modal .secondary-button:hover,
.booking-modal .primary-button:focus-visible,
.booking-modal .secondary-button:focus-visible {
    transform: translateY(-2px);
}

.booking-modal .primary-button {
    border: 1px solid transparent;
    background: #e2ff1b;
    color: #0a0a0c;
}

.booking-modal .primary-button:hover,
.booking-modal .primary-button:focus-visible {
    background: #cfe900;
}

.booking-modal .secondary-button {
    border: 1px solid rgba(10, 10, 12, 0.16);
    background: #ffffff;
    color: #0a0a0c;
}

.booking-modal .secondary-button:hover,
.booking-modal .secondary-button:focus-visible {
    border-color: #9c6bff;
    color: #9c6bff;
}

.calendar-shell {
    width: min(100%, 23rem);
}

.calendar-empty {
    width: min(100%, 23rem);
    padding: 1rem 1.2rem;
    border-radius: 18px;
    background: #f6f3f7;
    color: #5f5a64;
    text-align: center;
}

.calendar-head {
    display: flex;
    justify-content: center;
    margin-bottom: 0.45rem;
}

.calendar-nav {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.calendar-title {
    min-width: 10rem;
    text-align: center;
    color: #0a0a0c;
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.04em;
}

.calendar-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 999px;
    background: rgba(10, 10, 12, 0.06);
    color: #0a0a0c;
    font-size: 1.5rem;
    line-height: 1;
    transition: background-color 220ms ease, transform 220ms ease, opacity 220ms ease;
}

.calendar-arrow:hover,
.calendar-arrow:focus-visible {
    background: rgba(10, 10, 12, 0.12);
    transform: translateY(-1px);
}

.calendar-arrow:disabled {
    opacity: 0.35;
    cursor: default;
    transform: none;
}

.calendar-weekdays,
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.65rem 0.55rem;
}

.calendar-weekdays {
    margin-bottom: 0.75rem;
}

.calendar-weekday {
    text-align: center;
    color: #5f5a64;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
}

.calendar-spacer {
    min-height: 2.75rem;
}

.calendar-day {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: #0a0a0c;
    font-size: 1rem;
    font-weight: 500;
}

.calendar-day:hover,
.calendar-day:focus-visible {
    background: rgba(156, 107, 255, 0.08);
    border-color: rgba(156, 107, 255, 0.16);
}

.calendar-day.is-disabled {
    color: rgba(10, 10, 12, 0.15);
    cursor: default;
}

.calendar-day.is-disabled:hover,
.calendar-day.is-disabled:focus-visible {
    background: transparent;
    border-color: transparent;
}

.calendar-day.is-selected {
    background: #5a9af0;
    color: #ffffff;
}

.time-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
}

.option-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 4.1rem;
    padding: 0 1rem;
    border-radius: 20px;
    border: 1px solid rgba(10, 10, 12, 0.08);
    background: #ffffff;
    color: #0a0a0c;
    font-size: 0.92rem;
    font-weight: 700;
    transition: transform 220ms ease, border-color 220ms ease, background-color 220ms ease;
}

.option-chip:hover,
.option-chip:focus-visible,
.option-chip.is-active {
    transform: translateY(-2px);
    border-color: rgba(90, 154, 240, 0.5);
    background: rgba(90, 154, 240, 0.1);
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.field {
    display: grid;
    gap: 0.45rem;
}

.field span {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.field input,
.field textarea {
    width: 100%;
    padding: 0.95rem 1rem;
    border-radius: 18px;
    border: 1px solid rgba(10, 10, 12, 0.16);
    background: #fbfafc;
    color: #0a0a0c;
}

.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: rgba(156, 107, 255, 0.5);
    box-shadow: 0 0 0 4px rgba(156, 107, 255, 0.12);
}

.field-notes {
    grid-column: 1 / -1;
}

.confirmation-panel h2 {
    font-size: clamp(2rem, 4vw, 3rem);
}

.eyebrow {
    margin: 0 0 0.6rem;
    color: #9c6bff;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.confirmation-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1.6rem;
}

.confirmation-grid article {
    padding: 1.2rem;
    border-radius: 22px;
    background: #f6f3f7;
    border: 1px solid rgba(10, 10, 12, 0.08);
}

.confirmation-grid span {
    display: block;
    color: #5f5a64;
    font-size: 0.76rem;
}

.confirmation-grid strong {
    display: block;
    margin-top: 0.25rem;
    font-size: 1rem;
    line-height: 1.3;
}

.confirmation-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.8rem;
}

@media (max-width: 1100px) {
    .slot-layout,
    .confirmation-grid {
        grid-template-columns: 1fr;
    }

    .block-head {
        flex-direction: column;
        align-items: stretch;
    }

    .stage-footer-top {
        margin-left: 0;
    }

    .stage-summary {
        max-width: none;
        text-align: left;
    }
}

@media (max-width: 760px) {
    .modal-layer {
        padding: 0;
        align-items: flex-end;
    }

    .booking-flow {
        padding: 1rem 1rem 1.35rem;
    }

    .booking-modal {
        min-height: calc(100svh - 8px);
        max-height: calc(100svh - 8px);
        width: 100%;
        border-radius: 28px 28px 0 0;
        align-self: end;
    }

    .booking-progress {
        position: sticky;
        top: 0;
        z-index: 2;
        margin-bottom: 0.85rem;
        padding: 0.2rem 0 0.85rem;
        background: linear-gradient(180deg, #ffffff 0 72%, rgba(255, 255, 255, 0) 100%);
    }

    .modal-close {
        top: 1rem;
        right: 1rem;
        width: 50px;
        height: 50px;
    }

    .modal-close span {
        top: 24px;
        left: 14px;
    }

    .form-block {
        padding: 1.15rem;
        border-radius: 24px;
    }

    .modal-form-head {
        margin-bottom: 1rem;
        padding-right: 3.4rem;
    }

    .slot-layout {
        gap: 1rem;
    }

    .calendar-shell,
    .calendar-empty {
        width: min(100%, 20rem);
    }

    .time-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .field-grid,
    .confirmation-grid {
        grid-template-columns: 1fr;
    }

    .block-head,
    .stage-footer,
    .confirmation-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .booking-modal .primary-button,
    .booking-modal .secondary-button {
        width: 100%;
    }

    .option-chip {
        min-height: 3.7rem;
    }

    .stage-summary {
        max-width: none;
        font-size: 0.84rem;
    }
}

@media (max-width: 420px) {
    .time-grid {
        grid-template-columns: 1fr;
    }
}
