/* ============================================================
   Bookings - landing, quote form, follow-up, estimate result.
   Oak-brown ground, white cards with an oak-accent heading rule
   (matches Contact us / "What we do").
   ============================================================ */

.page-bookings {
    background-color: #6b4423;   /* oak brown */
}

.bookings-page {
    max-width: 1080px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
}
.bookings-page--narrow {
    max-width: 680px;
}

.bookings-page__head {
    text-align: center;
    color: #fff;
    margin-bottom: 2rem;
}
.bookings-page__head h1 {
    margin: 0 0 0.5rem;
    font-size: clamp(1.7rem, 3.5vw, 2.2rem);
}
.bookings-page__head p {
    margin: 0 auto;
    max-width: 54ch;
    color: #f0e4d6;
}
.bookings-page__back {
    text-align: center;
    margin-top: 1.75rem;
}
.bookings-page__back a { color: #f0e4d6; }

/* ---------- Cards ---------- */
.bookings-card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 1.6rem 1.5rem 1.8rem;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}
.bookings-page > * + * { margin-top: 1.5rem; }

.bookings-card h2 {
    margin: 0 0 0.85rem;
    padding-bottom: 0.6rem;
    font-size: 1.15rem;
    color: #5a3b28;
    border-bottom: 2px solid #c8a27c;
}
.bookings-card p {
    color: #3f3a35;
    line-height: 1.6;
    margin: 0 0 1rem;
}
.bookings-card p:last-child { margin-bottom: 0; }

.bookings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}
.bookings-grid .bookings-card { margin-top: 0; display: flex; flex-direction: column; }
.bookings-grid .bookings-card p { flex: 1; }
.bookings-card--soon { opacity: 0.72; }

.bookings-gate { text-align: center; }
.bookings-gate__actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ---------- Buttons ---------- */
.bk-btn {
    display: inline-block;
    align-self: flex-start;
    padding: 0.65rem 1.4rem;
    border-radius: 7px;
    border: 1px solid transparent;
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}
.bk-btn--primary { background: #8b4b07; border-color: #8b4b07; color: #fff; }
.bk-btn--primary:hover { background: #733d05; }
.bk-btn--ghost { background: transparent; border-color: #6f4a30; color: #5a3b28; }
.bk-btn--ghost:hover { background: rgba(111, 74, 48, 0.08); }
.bk-btn--disabled {
    background: #e7ded3; border-color: #e7ded3; color: #8a7c6c; cursor: default;
}
.bk-btn:focus-visible { outline: 3px solid #ffd8a8; outline-offset: 2px; }

/* ---------- Form ---------- */
.bk-form__group {
    border: 0;
    padding: 0;
    margin: 0 0 1.75rem;
}
.bk-form__group legend {
    font-weight: 700;
    color: #5a3b28;
    font-size: 1rem;
    margin-bottom: 0.75rem;
    padding: 0;
}

.bk-field {
    margin-bottom: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.bk-field > label {
    font-weight: 600;
    font-size: 0.92rem;
    color: #3f3a35;
}
.bk-field input[type="text"],
.bk-field input[type="number"],
.bk-field input[type="tel"],
.bk-field select,
.bk-field textarea {
    font: inherit;
    padding: 0.55rem 0.7rem;
    border: 1px solid #c7bdb1;
    border-radius: 6px;
    background: #fdfbf9;
    width: 100%;
}
.bk-field textarea { resize: vertical; }

/* radio group (service option) */
.bk-field ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.bk-field ul li label {
    font-weight: 500;
    color: #3f3a35;
    display: flex;
    gap: 0.5rem;
    align-items: baseline;
}

/* single checkbox ("not sure of the area") */
.bk-field--check {
    flex-direction: row-reverse;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
}
.bk-field--check > label { font-weight: 500; }
.bk-field--check input { width: auto; }

/* live address suggestions (book a job) */
.address-suggest {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 20;
    margin-top: 2px;
    background: #fdfbf9;
    border: 1px solid #c7bdb1;
    border-radius: 6px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    max-height: 220px;
    overflow-y: auto;
}
.address-suggest__item {
    display: block;
    width: 100%;
    text-align: left;
    font: inherit;
    font-size: 0.92rem;
    padding: 0.5rem 0.7rem;
    border: none;
    background: none;
    color: #3f3a35;
    cursor: pointer;
}
.address-suggest__item + .address-suggest__item { border-top: 1px solid #ece4d9; }
.address-suggest__item:hover,
.address-suggest__item.is-active { background: #f3ece1; }

.bk-field__help { font-size: 0.83rem; color: #6b6b6b; }
.bk-field__error { font-size: 0.83rem; color: #a4291f; }
.bk-field--invalid input,
.bk-field--invalid select,
.bk-field--invalid textarea { border-color: #a4291f; }

.bk-form__errors {
    background: #fbe6e6;
    border: 1px solid #e0b1b1;
    color: #8a1f1f;
    border-radius: 6px;
    padding: 0.7rem 1rem;
    margin-bottom: 1.25rem;
}
.bk-form__disclaimer {
    font-size: 0.85rem;
    color: #6b6b6b;
    background: #f6f1ea;
    border-radius: 6px;
    padding: 0.7rem 0.9rem;
    margin: 0 0 1.25rem;
}

/* honeypot */
.hp {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------- Estimate result ---------- */
.quote-result__range {
    font-size: clamp(1.8rem, 5vw, 2.6rem);
    font-weight: 800;
    color: #5a3b28;
    margin: 0 0 0.75rem;
    text-align: center;
}
.quote-result__message { font-size: 1rem; }
.quote-result__breakdown {
    width: 100%;
    border-collapse: collapse;
    margin: 1.25rem 0;
}
.quote-result__breakdown th,
.quote-result__breakdown td {
    text-align: left;
    padding: 0.55rem 0;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    font-size: 0.95rem;
    color: #3f3a35;
}
.quote-result__breakdown td { text-align: right; white-space: nowrap; font-weight: 600; }
.quote-result__label {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #8a6b4f;
    margin: 1rem 0 0.4rem;
}
.quote-result__assumptions {
    margin: 0 0 1.25rem;
    padding-left: 1.25rem;
    color: #3f3a35;
    line-height: 1.5;
    font-size: 0.95rem;
}
.quote-result__ref {
    background: #f6f1ea;
    border: 1px dashed #c8a27c;
    border-radius: 6px;
    padding: 0.7rem 0.9rem;
    text-align: center;
    font-size: 0.95rem;
    margin: 0 0 1rem;
}
.quote-result__ref strong {
    font-size: 1.1rem;
    letter-spacing: 0.04em;
    color: #5a3b28;
}
.quote-result__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.quote-result__ref-note {
    font-size: 0.85rem;
    color: #6b6b6b;
    margin: 0.75rem 0 0;
}

/* ---------- Your projects (portal) ---------- */
.bk-btn--sm { padding: 0.4rem 0.9rem; font-size: 0.85rem; }

.job-staffbar {
    background: #3f2a1c;
    color: #f0e4d6;
    border-radius: 8px;
    padding: 0.7rem 1rem;
    font-size: 0.9rem;
    margin-top: 0;
}
.job-staffbar a { color: #ffd8a8; white-space: nowrap; }

.job-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}
.job-list .bookings-card { margin-top: 0; }
.job-card {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    text-decoration: none;
    color: inherit;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.job-card:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(0, 0, 0, 0.28); }
.job-card__ref {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #8a6b4f;
}
.job-card__title { font-size: 1.1rem; font-weight: 700; color: #5a3b28; }
.job-card__meta { font-size: 0.85rem; color: #6b6b6b; }

/* status pill */
.job-status {
    display: inline-block;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    align-self: flex-start;
}
.job-status--requested,
.job-status--awaiting_deposit { background: #f4e2c4; color: #7a541c; }
.job-status--not_started { background: #dfe7d5; color: #4a5a34; }
.job-status--underway { background: #cfe0ef; color: #274a63; }
.job-status--complete { background: #cde8d3; color: #1f5a34; }
.job-status--cancelled { background: #ece0dd; color: #7a3b31; }

/* unread-messages badge on a manage-dashboard job card */
.job-card__unread {
    display: inline-block;
    align-self: flex-start;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    background: #8a1f1f;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
}

/* progress bar */
.job-progress {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0;
    display: flex;
    gap: 0.5rem;
    counter-reset: step;
}
.job-progress li {
    flex: 1;
    text-align: center;
    font-size: 0.82rem;
    font-weight: 600;
    color: #9a8c7c;
    padding-top: 1.9rem;
    position: relative;
}
.job-progress li::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1.6rem;
    height: 1.6rem;
    line-height: 1.6rem;
    border-radius: 50%;
    background: #e7ded3;
    color: #8a7c6c;
}
.job-progress li::after {
    content: "";
    position: absolute;
    top: 0.8rem;
    left: -50%;
    width: 100%;
    height: 2px;
    background: #e7ded3;
    z-index: -1;
}
.job-progress li:first-child::after { display: none; }
.job-progress li.is-done { color: #5a3b28; }
.job-progress li.is-done::before { background: #8b4b07; color: #fff; }
.job-progress li.is-done::after { background: #8b4b07; }

.job-startline { margin-top: 1rem; }

/* costs table, payments table, invoices list (project detail page) */
.job-money th { font-weight: 500; }
.job-money__due th, .job-money__due td {
    font-weight: 800;
    color: #5a3b28;
    border-top-width: 2px;
}
.job-payments thead th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #8a6b4f;
    border-top: 0;
}
.job-payments td { text-align: left; white-space: normal; font-weight: 400; }
.job-payments td:last-child { text-align: right; white-space: nowrap; font-weight: 700; }
.job-payments__refund td:last-child { color: #8a1f1f; }

.job-invoices { list-style: none; margin: 0; padding: 0; }
.job-invoices li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.7rem 0;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}
.job-invoices li:first-child { border-top: 0; }
.job-invoices small { color: #6b6b6b; }

/* work photos grid */
.job-photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.9rem;
}
.job-photos figure { margin: 0; }
.job-photos img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}
.job-photos figcaption {
    font-size: 0.8rem;
    color: #6b6b6b;
    margin-top: 0.35rem;
}

/* job chat - the customer<->staff message thread on a booked job */
.job-chat__lead {
    font-size: 0.85rem;
    color: #6b6b6b;
    margin-top: -0.3rem;
}
.job-chat {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-height: 420px;
    overflow-y: auto;
    padding: 0.25rem;
    margin-bottom: 1rem;
}
.job-chat__msg { display: flex; }
.job-chat__msg.is-mine { justify-content: flex-end; }
.job-chat__bubble {
    max-width: 80%;
    padding: 0.6rem 0.85rem;
    border-radius: 12px;
    background: #f4ede4;
}
.is-mine .job-chat__bubble { background: #f4e2c4; }
.job-chat__meta {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: #8a6b4f;
    margin: 0 0 0.25rem;
}
.job-chat__body { margin: 0; white-space: pre-wrap; }
.job-chat__photo {
    margin-top: 0.5rem;
    max-width: 220px;
    border-radius: 8px;
    display: block;
}
.job-chat__empty { color: #6b6b6b; font-size: 0.9rem; }
.job-chat__closed {
    font-size: 0.85rem;
    color: #6b6b6b;
    font-style: italic;
}
.job-chat__form textarea { min-height: 2.5rem; }

/* ---------- Staff: manage bookings + on-portal controls ---------- */
.bookings-card--staff { border-left: 4px solid #8b4b07; }

.manage-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.manage-chip {
    display: inline-block;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #f0e4d6;
    text-decoration: none;
    font-size: 0.85rem;
}
.manage-chip:hover { background: rgba(255, 255, 255, 0.24); }
.manage-chip.is-on { background: #fff; color: #5a3b28; font-weight: 700; }

.staff-panel { border: 2px solid #8b4b07; }
.staff-panel h3 {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    color: #5a3b28;
}
.staff-panel__status { font-size: 0.95rem; }
.staff-panel__note {
    font-size: 0.85rem;
    color: #6b6b6b;
    background: #f6f1ea;
    border-radius: 6px;
    padding: 0.6rem 0.8rem;
}
.staff-panel__rule {
    border: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    margin: 1.4rem 0;
}
.staff-panel__admin { font-size: 0.9rem; margin: 0; }
.staff-panel__buttons { display: flex; flex-wrap: wrap; gap: 0.6rem; }

/* the "from quote" briefing box */
.staff-panel__brief {
    background: #f6f1ea;
    border: 1px solid #e4d6c4;
    border-radius: 8px;
    padding: 0.9rem 1rem;
    margin: 0 0 1rem;
}
.staff-panel__brief h3 {
    margin: 0 0 0.4rem;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #8a6b4f;
}
.staff-panel__brief p { margin: 0 0 0.4rem; font-size: 0.9rem; }
.staff-panel__brief p:last-child { margin-bottom: 0; }
.staff-panel__brief-price strong { font-size: 1.05rem; color: #5a3b28; }
.staff-panel__brief-muted { color: #6b6b6b; font-size: 0.85rem; }
.staff-panel__brief-what { color: #3f3a35; }
.staff-panel__brief-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.5rem 0;
    font-size: 0.85rem;
}
.staff-panel__brief-table td {
    padding: 0.3rem 0;
    border-top: 1px solid #e4d6c4;
    color: #3f3a35;
}
.staff-panel__brief-table td:last-child { text-align: right; white-space: nowrap; font-weight: 600; }
.staff-panel__brief-table tr:first-child td { border-top: 0; }

/* the "refund requested" banner - same shape as the quote brief box, but
   flagged red since it's something waiting on you */
.staff-panel__refund {
    background: #fbe6e6;
    border: 1px solid #e0b1b1;
    border-radius: 8px;
    padding: 0.9rem 1rem;
    margin: 0 0 1rem;
}
.staff-panel__refund h3 { margin: 0 0 0.4rem; font-size: 1rem; color: #8a1f1f; }
.staff-panel__refund p { margin: 0 0 0.5rem; font-size: 0.9rem; }
.staff-panel__refund-reason { font-style: italic; color: #3f3a35; }

.staff-form { margin-bottom: 1rem; }
.staff-form__actions { margin-top: 0.5rem; }
.staff-form--inline {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin: 0 0.6rem 0.6rem 0;
}
.staff-form--inline select {
    font: inherit;
    padding: 0.4rem 0.5rem;
    border: 1px solid #c7bdb1;
    border-radius: 6px;
    background: #fdfbf9;
}

/* ---------- "Please wait" overlay (quote calculation) ---------- */
.bk-loading {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(43, 26, 16, 0.74);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}
.bk-loading.is-active { display: flex; }

.bk-loading__box {
    background: #fff;
    border-radius: 14px;
    padding: 2rem 1.75rem;
    max-width: 360px;
    width: 100%;
    text-align: center;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}
.bk-loading__spinner {
    width: 46px;
    height: 46px;
    margin: 0 auto 1.15rem;
    border-radius: 50%;
    border: 4px solid #e7ded3;
    border-top-color: #8b4b07;
    animation: bk-spin 0.9s linear infinite;
}
@keyframes bk-spin { to { transform: rotate(360deg); } }

.bk-loading__title {
    margin: 0 0 0.4rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #5a3b28;
}
.bk-loading__note {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #6b6b6b;
}

/* respect the OS "reduce motion" setting: slow the spin right down instead
   of stopping it, so it still reads as "loading" */
@media (prefers-reduced-motion: reduce) {
    .bk-loading__spinner { animation-duration: 2.6s; }
}

/* ---------- Card checkout (Stripe) ---------- */
.checkout__summary {
    text-align: center;
    padding-bottom: 1.1rem;
    margin-bottom: 1.4rem;
    border-bottom: 2px solid #c8a27c;
}
.checkout__for { color: #3f3a35; margin: 0 0 0.3rem; }
.checkout__amount {
    font-size: clamp(1.9rem, 6vw, 2.6rem);
    font-weight: 800;
    color: #5a3b28;
    margin: 0;
}
.checkout__form .checkout__row {
    display: flex;
    gap: 0.9rem;
}
.checkout__form .checkout__row .bk-field { flex: 1; }
.checkout__jobaddr {
    margin: 0;
    padding: 0.55rem 0.7rem;
    background: #f6f1ea;
    border-radius: 6px;
    font-size: 0.92rem;
    color: #3f3a35;
}
#address-element, #payment-element { margin-top: 0.15rem; }
.checkout__authorise { margin: 1.4rem 0 0.4rem; }
.checkout__authorise > label { font-weight: 400; font-size: 0.9rem; }
#pay-button { align-self: stretch; text-align: center; margin-top: 1.1rem; padding: 0.8rem 1.4rem; }
#pay-button[disabled] { opacity: 0.7; cursor: default; }
.checkout__spinner {
    display: inline-block;
    width: 1.05rem; height: 1.05rem;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-top-color: #fff;
    border-radius: 50%;
    animation: bk-spin 0.8s linear infinite;
    vertical-align: -2px;
}
.checkout__spinner[hidden] { display: none; }

.pay-choose__opt { margin-bottom: 1rem; }
.pay-choose__opt > label { font-weight: 500; display: block; }
.pay-choose__amount { display: flex; align-items: center; gap: 0.4rem; margin: 0.5rem 0 0.2rem; }
.pay-choose__amount[hidden] { display: none; }
.pay-choose__amount input { max-width: 10rem; }

/* small phones (< 520px): stretch buttons full-width and stack anything
   that was side-by-side, so nothing gets cramped */
@media (max-width: 520px) {
    .bk-btn { align-self: stretch; text-align: center; }
    .bookings-gate__actions .bk-btn { flex: 1; }
    .quote-result__actions { flex-direction: column; }
    .job-invoices li { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
    .checkout__form .checkout__row { flex-direction: column; gap: 0; }
}
