/* Colours follow the Pahuwayan application theme. */
:root {
    --primary: #0f6b62;
    --primary-deep: #0b332f;
    --gold: #d9a441;
    --secondary: #9a6a32;
    --background: #faf8f4;
    --surface: #ffffff;
    --mint: #e3f2ef;
    --ink: #263330;
    --muted: #55625f;
    --line: #dfe4e1;
    --danger: #9b1c1c;
    --radius: 14px;
    --view-height: 100dvh;
    --view-top: 0px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    background: var(--background);
    color: var(--ink);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.45;
    -webkit-text-size-adjust: 100%;
}

h1, h2, h3, p, ul, dl { margin: 0; }
h1, h2, h3 { color: var(--primary-deep); line-height: 1.25; }

.chat {
    position: fixed;
    left: 0;
    right: 0;
    top: var(--view-top);
    height: var(--view-height);
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
    background: var(--primary-deep);
    border-bottom: 3px solid var(--gold);
}

.chat-header img { border-radius: 10px; flex: none; }
.chat-title { flex: 1; min-width: 0; }
.chat-title h1 { color: #fff; font-size: 1.05rem; overflow-wrap: anywhere; }
.chat-title p { color: #cfe3df; font-size: .8rem; }

.language { display: flex; flex: none; }

.language button {
    min-width: 48px;
    min-height: 48px;
    border: 1px solid #5f8a83;
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: .85rem;
    font-weight: 600;
}

.language button:first-child { border-radius: 10px 0 0 10px; }
.language button:last-child { border-radius: 0 10px 10px 0; border-left: 0; }
.language button[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--primary-deep); }

.chat-scroll {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 12px;
}

.chat-log { display: flex; flex-direction: column; gap: 10px; }

.bubble {
    max-width: 88%;
    padding: 10px 14px;
    border-radius: var(--radius);
    overflow-wrap: anywhere;
}

.bubble > * + * { margin-top: 6px; }
.bubble ul { padding-left: 20px; }
.bubble.inn { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble.guest { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.bubble.busy { display: flex; align-items: center; gap: 8px; }
.bubble.failure { border-color: var(--danger); }

.fine { color: var(--muted); font-size: .85rem; }

.result {
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-top: 4px solid var(--primary);
    border-radius: var(--radius);
    overflow-wrap: anywhere;
}

.result > * + * { margin-top: 10px; }
.result h2 { font-size: 1.1rem; }
.result.unavailable { border-top-color: var(--secondary); }
.result.unconfirmed { border-top-color: var(--gold); }
.result.suggestion { border-top-color: var(--gold); }
.shortfall { font-weight: 600; }
.offer { padding: 10px 12px; background: var(--mint); border-radius: 10px; }
.offer > * + * { margin-top: 10px; }
.offer .choose { width: 100%; }
.approved { font-weight: 600; }

.schedule { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; }
.schedule dt { color: var(--muted); }
.schedule dd { margin: 0; font-weight: 600; }
.schedule dd.fine { grid-column: 1 / -1; font-weight: 400; }

.options { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.options li { padding: 10px 12px; background: var(--mint); border-radius: 10px; }
.options h3 { font-size: .95rem; }
.rate { font-size: 1.5rem; font-weight: 700; color: var(--primary-deep); }
.no-rate { margin-top: 4px; }

.button {
    min-height: 48px;
    min-width: 48px;
    padding: 10px 18px;
    border: 1px solid var(--primary);
    border-radius: 10px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.button.primary { background: var(--primary); color: #fff; }
.button:disabled { opacity: .55; cursor: default; }

.composer {
    padding: 2px 10px calc(8px + env(safe-area-inset-bottom));
    background: var(--surface);
    border-top: 1px solid var(--line);
}

.composer form { display: flex; gap: 8px; }
.composer input { flex: 1; min-width: 0; }

.link {
    min-height: 44px;
    padding: 0 4px;
    border: 0;
    background: none;
    color: var(--primary);
    font: inherit;
    font-size: .9rem;
    text-decoration: underline;
}

/* 16px or larger, so that iPhone Safari does not zoom the page when a field is focused. */
input, select {
    min-height: 48px;
    padding: 10px 12px;
    border: 1px solid #b9c4c0;
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: 16px;
}

.stay-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 12px;
    padding: 14px;
    background: var(--mint);
    border-radius: var(--radius);
}

.stay-form h2 { font-size: 1.05rem; }
.stay-form label { margin-top: 6px; font-weight: 600; font-size: .9rem; }
.stay-form input, .stay-form select { width: 100%; min-width: 0; -webkit-appearance: none; appearance: none; }
.stay-form select { -webkit-appearance: auto; appearance: auto; }
.stay-form .button { margin-top: 12px; }
.form-error { color: var(--danger); font-weight: 600; }
.form-review { padding: 10px 12px; border-left: 4px solid var(--gold); background: var(--mint); font-weight: 600; }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.message-page {
    max-width: 480px;
    margin: 0 auto;
    padding: 20vh 24px 24px;
    text-align: center;
}

.message-page > * + * { margin-top: 12px; }

.spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 4px solid var(--mint);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .9s linear infinite;
}

.spinner.small { width: 18px; height: 18px; border-width: 3px; }

@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

#blazor-error-ui {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    z-index: 1000;
    padding: 12px;
    background: #fff4d6;
    text-align: center;
}

.access-form { width: 100%; max-width: 320px; margin-inline: auto; display: flex; flex-direction: column; gap: 10px; text-align: left; }
.access-form input { width: 100%; }
.access-form .refused { color: var(--danger); }

/* Booking */
.booking { margin: 12px 0; padding: 14px; border: 1px solid var(--primary); border-radius: 12px; background: #fff; }
.booking > * + * { margin-top: 10px; }
.booking h2 { font-size: 1.1rem; }
.booking form { display: flex; flex-direction: column; gap: 6px; }
.booking label { margin-top: 6px; font-weight: 600; font-size: .9rem; }
.booking input { width: 100%; min-width: 0; }
.booking .button { margin-top: 10px; }
.booking dd { overflow-wrap: anywhere; }
.booking .reference, .booking .deadline { font-weight: 700; }
.booking .instructions { padding-left: 18px; overflow-wrap: anywhere; }
.booking-problem { padding: 10px 12px; border-left: 4px solid var(--gold); background: var(--mint); font-weight: 600; }
.options .book { margin-top: 8px; }
