/*
 * Zeitfenster guest pages, design C ("Dialog"): the booking reads as a
 * conversation. Colors are fixed, tenants cannot change them.
 */

/* Bricolage Grotesque (SIL Open Font License 1.1), self-hosted variable font */
@font-face {
    font-family: "Bricolage Grotesque";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/bricolage-grotesque-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Bricolage Grotesque";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/bricolage-grotesque-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --accent: #5b3fa8;
    --accent-soft: color-mix(in srgb, var(--accent) 12%, #fff);
    --accent-softer: color-mix(in srgb, var(--accent) 22%, #fff);
    --accent-line: color-mix(in srgb, var(--accent) 35%, #fff);
    --ink: #221b33;
    --ink-soft: #574f69;
    --ink-legal: #3a3150;
    --muted: #9c95ac;
    --canvas: #f1eef7;
    --canvas-hover: #e4dff0;
    --field: #f4f2f9;
    --line: #dcd6e8;
    --surface: #fff;
    --danger: #a3231b;
    --danger-soft: #fdf1f0;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--canvas);
    color: var(--ink);
    font-family: "Bricolage Grotesque", system-ui, sans-serif;
    font-size: 17px;
    line-height: 1.5;
}

a {
    color: var(--accent);
}

a:hover {
    color: var(--ink);
}

:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

.page {
    max-width: 640px;
    margin: 0 auto;
    padding: 40px 18px 0;
}

.page-footer {
    margin: 12px 0 0;
    padding: 0 18px 28px;
    color: var(--ink-soft);
    font-size: 14px;
    text-align: center;
}

.page-footer a {
    color: inherit;
}

/* Header: avatar, name and subtitle of the tenant */
.head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}

.head__avatar {
    display: grid;
    flex: none;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    object-fit: cover;
}

.head__title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.head__subtitle {
    margin: 0;
    color: var(--ink-soft);
    font-size: 15px;
}

/* The conversation so far */
.thread {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bubble {
    align-self: flex-start;
    max-width: 85%;
    margin: 0;
    padding: 12px 18px;
    border-radius: 22px 22px 22px 6px;
    background: var(--surface);
}

.reply {
    display: flex;
    flex-direction: column;
    align-self: flex-end;
    align-items: flex-end;
    max-width: 85%;
    margin-bottom: 6px;
}

.reply__text {
    margin: 0;
    padding: 12px 18px;
    border-radius: 22px 22px 6px 22px;
    background: var(--accent);
    color: #fff;
    text-align: right;
}

.reply__text strong {
    display: block;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
}

.reply__text span {
    display: block;
    font-size: 15px;
    opacity: 0.92;
}

.reply__change,
.link {
    min-height: 44px;
    padding: 8px 6px;
    border: 0;
    background: none;
    color: var(--accent);
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.reply__change {
    font-size: 14px;
}

.link {
    display: inline-flex;
    align-items: center;
}

/* The current question */
.ask {
    max-width: 15ch;
    margin: 22px 0 18px;
    font-size: clamp(30px, 5vw, 44px);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.03em;
    animation: ask-in 0.35s ease-out both;
}

@keyframes ask-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* Locations and services */
.options,
.times {
    margin: 0;
    padding: 0;
    list-style: none;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    width: 100%;
    padding: 18px 22px;
    border: 2px solid transparent;
    border-radius: 22px;
    background: var(--surface);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s;
}

.option:hover {
    border-color: var(--accent);
    transform: translateX(4px);
}

.option__title {
    display: block;
    font-size: 19px;
    font-weight: 600;
    line-height: 1.3;
}

.option__detail {
    display: block;
    color: var(--ink-soft);
    font-size: 15px;
}

.option__aside {
    color: var(--ink-soft);
    font-size: 14px;
    text-align: right;
    white-space: nowrap;
}

.option__aside strong {
    display: block;
    color: var(--accent);
    font-size: 18px;
    font-weight: 700;
}

/* White panel around calendar, form and confirmation */
.panel {
    padding: 22px;
    border-radius: 28px;
    background: var(--surface);
}

.panel p {
    margin: 0 0 12px;
}

.panel__subheading {
    margin: 26px 0 12px;
    font-size: 18px;
    font-weight: 600;
}

/* Month calendar */
.calendar__nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.calendar__month {
    font-size: 19px;
    font-weight: 700;
}

.calendar__arrow {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--canvas);
    color: var(--ink);
    cursor: pointer;
}

.calendar__arrow:hover {
    background: var(--canvas-hover);
}

.calendar__arrow:disabled {
    opacity: 0.35;
    cursor: default;
}

.calendar__grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
    justify-items: center;
}

.calendar__weekday {
    padding: 4px 0;
    color: var(--ink-soft);
    font-size: 14px;
}

.calendar__day {
    display: grid;
    place-items: center;
    width: 100%;
    max-width: 48px;
    min-height: 40px;
    aspect-ratio: 1;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: inherit;
    font: inherit;
    font-size: 17px;
}

.calendar__day.is-off {
    color: var(--muted);
}

.calendar__day.is-free {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 700;
    cursor: pointer;
}

.calendar__day.is-free:hover {
    background: var(--accent-softer);
}

.calendar__day.is-selected {
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.calendar__empty {
    margin: 12px 0 0;
    color: var(--ink-soft);
}

/* Start times of a day */
.times {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.time {
    min-height: 48px;
    padding: 0 20px;
    border: 2px solid var(--accent-line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--accent);
    font: inherit;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
}

.time:hover {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

/* Contact form */
.fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field--full,
.field--check,
.cf-turnstile {
    grid-column: 1 / -1;
}

.field__label {
    font-size: 15px;
    font-weight: 600;
}

.field__optional {
    color: var(--ink-soft);
    font-weight: 400;
}

.field__hint {
    color: var(--ink-soft);
    font-size: 14px;
}

.field input,
.field textarea {
    width: 100%;
    padding: 13px 16px;
    border: 2px solid transparent;
    border-radius: 16px;
    background: var(--field);
    color: inherit;
    font: inherit;
}

.field input:focus,
.field textarea:focus {
    border-color: var(--accent);
    outline: none;
    background: var(--surface);
}

.field--check {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 16px;
    cursor: pointer;
}

.field--check input {
    flex: none;
    width: 22px;
    height: 22px;
    margin-top: 2px;
    accent-color: var(--accent);
}

.field--trap {
    position: absolute;
    left: -9999px;
}

.field__required {
    color: var(--danger);
    font-weight: 700;
}

.field__legend {
    margin: 0;
    color: var(--ink-soft);
    font-size: 14px;
}

.field--invalid input,
.field--invalid textarea {
    border-color: var(--danger);
    background: var(--danger-soft);
}

.field--invalid input:focus,
.field--invalid textarea:focus {
    border-color: var(--danger);
}

.field--check.field--invalid {
    padding: 10px 12px;
    border: 2px solid var(--danger);
    border-radius: 16px;
    background: var(--danger-soft);
}

/* Buttons */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    padding: 0 30px;
    border: 2px solid var(--accent);
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.button:hover {
    color: #fff;
    filter: brightness(0.92);
}

.button--block {
    width: 100%;
}

.button--secondary {
    background: var(--surface);
    color: var(--accent);
}

.button--secondary:hover {
    background: var(--field);
    color: var(--accent);
    filter: none;
}

.button--danger {
    border-color: var(--danger);
    background: var(--surface);
    color: var(--danger);
}

.button--danger:hover {
    background: var(--danger-soft);
    color: var(--danger);
    filter: none;
}

.button:disabled {
    opacity: 0.6;
    cursor: progress;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-top: 18px;
}

/* Notices */
.notice {
    margin: 0 0 16px;
    padding: 12px 16px;
    border-radius: 16px;
    background: var(--surface);
}

.notice--success {
    background: var(--accent-soft);
    color: var(--ink);
}

.notice--error,
.panel .notice--error {
    margin: 0 0 16px;
    background: var(--danger-soft);
    color: var(--danger);
}

.fields .notice--error {
    margin: 0;
}

/* The framework also reveals the list after a successful request without
   messages; booking.js empties it then, so an empty list stays hidden */
[data-validate-error]:not(:has([data-message])) {
    display: none;
}

.notice__title {
    margin: 0 0 6px;
    font-weight: 700;
}

.notice__list {
    margin: 0;
    padding-left: 20px;
}

/* Tenant login pages */
.panel--recover {
    margin-top: 16px;
}

.panel--recover summary {
    color: var(--accent);
    font-weight: 600;
    cursor: pointer;
}

.panel--recover[open] summary {
    margin-bottom: 14px;
}

.aside {
    margin: 22px 0 0;
    color: var(--ink-soft);
    text-align: center;
}

/* Appointment as a ticket on confirmation and manage pages */
.ticket {
    display: grid;
    gap: 4px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 2px dashed var(--line);
    color: var(--ink-soft);
}

.ticket__when {
    color: var(--ink);
    font-size: 26px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.ticket.is-cancelled {
    text-decoration: line-through;
}

.ticket.is-cancelled .ticket__when {
    color: var(--ink-soft);
}

/* Legal texts of the tenant */
.legal {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 22px;
    margin-top: 44px;
    font-size: 15px;
}

.legal a,
.legal__text summary {
    color: var(--ink-legal);
}

.legal__text {
    flex-basis: 100%;
}

.legal__text summary {
    text-align: center;
    text-decoration: underline;
    cursor: pointer;
}

.legal__text div {
    margin-top: 12px;
    padding: 16px 22px;
    border-radius: 22px;
    background: var(--surface);
}

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

    .option {
        transition: none;
    }

    .option:hover {
        transform: none;
    }
}
