/* Terminmanagement: public booking form and the customer's manage page. Built on rb tokens. */

.rb-appt {
    min-width: 0;
    font-family: var(--rb-font-sans);
    color: var(--rb-text);
}

.rb-appt [hidden] {
    display: none;
}

.rb-appt__inner {
    display: grid;
    gap: 24px;
    max-width: 760px;
}

.rb-appt__head {
    display: grid;
    gap: 6px;
}

.rb-appt h2,
.rb-appt h3,
.rb-appt p {
    margin: 0;
}

.rb-appt h2 {
    font-size: clamp(1.35rem, 2vw, 1.65rem);
    font-weight: 650;
    letter-spacing: -.03em;
    line-height: 1.25;
}

.rb-appt h3 {
    font-size: 1.15rem;
    font-weight: 650;
    letter-spacing: -.02em;
}

.rb-appt__lead,
.rb-appt__hint,
.rb-appt__notice {
    color: var(--rb-muted);
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.rb-appt__form {
    display: grid;
    gap: 28px;
}

.rb-appt__step {
    display: grid;
    gap: 14px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.rb-appt__step legend {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    margin-bottom: 14px;
    font-size: 1rem;
    font-weight: 650;
}

.rb-appt__index {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1.5px solid var(--rb-text);
    font-size: .8125rem;
    font-variant-numeric: tabular-nums;
}

.rb-appt__choices {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
}

.rb-appt__choices--staff {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr));
}

.rb-appt__choice {
    position: relative;
    display: flex;
    min-width: 0;
    cursor: pointer;
}

.rb-appt__choice input {
    position: absolute;
    opacity: 0;
    inset: 0;
    margin: 0;
    cursor: pointer;
}

.rb-appt__choice-body {
    display: grid;
    gap: 2px;
    width: 100%;
    min-height: 44px;
    padding: 12px 14px;
    border: 1px solid var(--rb-border);
    border-radius: var(--rb-radius-md);
    background: var(--rb-surface);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.rb-appt__choice-title {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.rb-appt__choice-meta {
    color: var(--rb-muted);
    font-size: .875rem;
    font-variant-numeric: tabular-nums;
}

.rb-appt__choice:hover .rb-appt__choice-body {
    border-color: var(--rb-border-input);
}

.rb-appt__choice input:checked + .rb-appt__choice-body {
    border-color: var(--rb-text);
    box-shadow: inset 0 0 0 1px var(--rb-text);
}

.rb-appt__choice input:focus-visible + .rb-appt__choice-body {
    outline: 2px solid var(--rb-focus);
    outline-offset: 2px;
}

.rb-appt__day {
    display: grid;
    grid-template-columns: 44px minmax(0, 240px) 44px;
    align-items: end;
    gap: 8px;
}

.rb-appt__day .rb-icon-button {
    width: 44px;
}

.rb-appt__date {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.rb-appt__slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
    gap: 8px;
}

.rb-appt__slots[aria-busy="true"] {
    opacity: .5;
}

.rb-appt__slot {
    min-height: 44px;
    padding: 0 8px;
    border: 1px solid var(--rb-border);
    border-radius: var(--rb-radius-sm);
    background: var(--rb-surface);
    color: inherit;
    font: inherit;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
}

.rb-appt__slot:hover {
    border-color: var(--rb-border-input);
}

.rb-appt__slot[aria-checked="true"] {
    background: var(--rb-text);
    border-color: var(--rb-text);
    color: var(--rb-bg);
}

.rb-appt__slot:focus-visible {
    outline: 2px solid var(--rb-focus);
    outline-offset: 2px;
}

.rb-appt__waitlist {
    display: grid;
    gap: 10px;
    justify-items: start;
    padding: 14px 16px;
    border-radius: var(--rb-radius-md);
    background: var(--rb-surface-soft);
    line-height: 1.5;
}

.rb-appt__fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: 16px 20px;
}

.rb-appt__fields .rb-field {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.rb-appt__full {
    grid-column: 1 / -1;
}

.rb-appt textarea {
    resize: vertical;
}

.rb-appt__summary {
    padding: 16px;
    border-radius: var(--rb-radius-md);
    background: var(--rb-surface-soft);
}

.rb-appt__facts {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 6px 18px;
    margin: 0;
}

.rb-appt__facts dt {
    color: var(--rb-muted);
}

.rb-appt__facts dd {
    margin: 0;
    font-weight: 600;
    overflow-wrap: anywhere;
    font-variant-numeric: tabular-nums;
}

.rb-appt__error {
    padding: 12px 14px;
    border-left: 3px solid var(--rb-danger);
    background: var(--rb-surface-muted);
    line-height: 1.5;
}

.rb-appt__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.rb-appt [data-appt-next-free] {
    min-height: 44px;
}

.rb-appt [data-appt-next-free] {
    justify-self: start;
}

.rb-appt__done {
    display: grid;
    gap: 14px;
    justify-items: start;
    outline: none;
    line-height: 1.55;
}

.rb-appt__status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--rb-border);
    font-size: .875rem;
    font-weight: 600;
}

.rb-appt__status--cancelled {
    text-decoration: line-through;
    color: var(--rb-muted);
}

.rb-appt-manage {
    box-sizing: border-box;
    width: min(100%, 760px);
    margin: 0 auto;
    padding: 48px 16px 72px;
}

@media (max-width: 640px) {
    .rb-appt__actions .rb-btn,
    .rb-appt__done .rb-btn {
        width: 100%;
    }

    .rb-appt__day {
        grid-template-columns: 44px minmax(0, 1fr) 44px;
    }

    .rb-appt-manage {
        padding-top: 28px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rb-appt__choice-body {
        transition: none;
    }
}
