@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700&family=Playfair+Display:wght@400&display=swap');

/* Ray White Brand in brief: yellow #FFE512, dark grey #595959, light grey #EBEBEC, white.
   Lato for UI and body, Playfair Display for the one major heading. Sentence case throughout. */
:root {
    --rw-yellow: #FFE512;
    --rw-yellow-hover: #F2D800;
    --rw-grey: #595959;
    --rw-light: #EBEBEC;
    --rw-line: #D3D3D5;
}

/* ---------- Overlay ---------- */
#cover {
    display: block;
    background: var(--rw-light);
    color: var(--rw-grey);
    font-family: 'Lato', Arial, sans-serif;
    font-weight: 300;
    font-size: 18px;
    padding: 0;
}
#cover #form-container {
    position: relative;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 40px 64px;
    font-family: inherit;
}

/* ---------- Header ---------- */
/* Sticky header bar: title left, Close setup and the logo right. Stays put while the page scrolls. */
.sm-bar { position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 4px solid var(--rw-yellow); }
/* Logo hangs from the top edge with clear space beneath it before the yellow line */
.sm-bar-inner { display: flex; align-items: center; gap: 32px; max-width: 1100px; height: 112px; margin: 0 auto; padding: 0 40px; }
.sm-bar h1 { margin: 0; font-family: 'Playfair Display', Georgia, serif; font-weight: 400; font-size: 52px; line-height: 1; color: var(--rw-grey); }
.sm-bar-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
/* The holding slide upload is now a single collapsible card */
.sm-card > .sm-collapse { margin: 0; padding: 0; border: 0; }
.sm-card > .sm-collapse summary { font-size: 20px; }
.sm-logo { display: block; align-self: flex-start; width: 80px; height: 80px; }

/* ---------- Cards ---------- */
.sm-card { background: #fff; padding: 32px; margin-bottom: 24px; }
.sm-card h2 { font-size: 20px; font-weight: 700; margin: 0 0 24px; color: var(--rw-grey); }
.sm-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.sm-card-head h2 { margin: 0; }
.sm-head-actions { display: flex; gap: 8px; }

/* ---------- Form ---------- */
.sm-row { display: grid; gap: 24px; margin-bottom: 24px; align-items: end; }
.sm-row-4 { grid-template-columns: 1fr 2fr 160px 96px; }   /* block and lot stay compact; office and property take the rest */
.sm-row-3 { grid-template-columns: 1fr 2fr 96px; }
.sm-row-2 { grid-template-columns: 2fr 1fr; }
#cover .form-group label { font-family: 'Lato', Arial, sans-serif; font-size: 15px; font-weight: 700; margin-bottom: 8px; }
#cover .form-group { position: relative; }
/* Hint text floats below the field so it never pushes the buttons out of line with the inputs */
#cover .form-group small { position: absolute; top: 100%; left: 0; margin-top: 6px; font-size: 14px; color: var(--rw-grey); }
.sm-row:has(small) { margin-bottom: 40px; }
#cover input, #cover select {
    font-family: 'Lato', Arial, sans-serif;
    font-size: 18px;
    font-weight: 400;
    color: var(--rw-grey);
    background: #fff;
    height: 52px;
    padding: 0 14px;
    border: 1px solid #A5A5A7;
    border-radius: 2px;
}
#cover input[type="file"] { padding: 9px 12px; font-size: 16px; height: auto; min-height: 52px; }
#cover input[type="file"]::file-selector-button {
    font: 700 15px 'Lato', Arial, sans-serif; color: var(--rw-grey); background: var(--rw-light);
    border: 0; border-radius: 2px; padding: 8px 14px; margin-right: 12px; cursor: pointer;
}
#cover select:disabled { background: var(--rw-light); color: #8a8a8c; }
#cover input:focus, #cover select:focus { outline: none; border-color: var(--rw-grey); box-shadow: 0 0 0 3px var(--rw-yellow); }
#cover .spinner { border-color: rgba(89,89,89,.2); border-top-color: var(--rw-grey); }
.sm-loading { display: block; margin-top: 16px; font-weight: 700; }
.sm-actions { display: flex; gap: 16px; }
.sm-collapse summary { display: flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 700; font-size: 16px; list-style: none; }
.sm-collapse summary::-webkit-details-marker { display: none; }
.sm-collapse summary::before { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--rw-grey); border-bottom: 2px solid var(--rw-grey); transform: rotate(-45deg); transition: transform .15s; }
.sm-collapse[open] summary::before { transform: rotate(45deg); }
.sm-collapse summary span { font-weight: 300; font-size: 14px; }
.sm-collapse summary:focus-visible { outline: 3px solid var(--rw-grey); outline-offset: 4px; }
.sm-collapse .sm-row { margin-top: 20px; }
.test-state { font-size: 14px; font-weight: 300; margin-left: 8px; }
.sm-adv h3 { margin: 28px 0 0; font-size: 17px; font-weight: 700; }
.sm-adv h3:first-child { margin-top: 24px; }
.sm-adv p { margin: 8px 0 0; font-size: 16px; max-width: 60ch; }
.sm-adv .sm-actions { margin-top: 16px; }
.sm-row-slide { grid-template-columns: 176px 1fr 200px; }
.sm-stack { display: flex; flex-direction: column; gap: 8px; }
/* Slide thumbnails sit inline with their upload controls */
.slide-thumb { position: relative; width: 176px; aspect-ratio: 16 / 9; background: var(--rw-light); outline: 1px solid var(--rw-line); overflow: hidden; }
.slide-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.slide-thumb span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 8px; text-align: center; font-size: 13px; font-weight: 700; color: var(--rw-grey); border: 1px dashed #A5A5A7; }
.sm-actions .btn { flex: 1; }

/* ---------- Buttons (override the dashboard's large global button style) ---------- */
#cover .btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: auto; margin: 0; height: 52px; padding: 0 28px;
    font: 700 17px 'Lato', Arial, sans-serif;
    border: 1px solid transparent; border-radius: 2px;
    transition: background-color .15s;
}
#cover .btn-sm { height: 40px; padding: 0 18px; font-size: 15px; }
#cover .btn-primary { background: var(--rw-yellow); color: var(--rw-grey); }
#cover .btn-primary:hover { background: var(--rw-yellow-hover); }
#cover .btn-secondary { background: #fff; color: var(--rw-grey); border-color: var(--rw-grey); }
#cover .btn-secondary:hover { background: var(--rw-light); }
#cover .btn:active { background: var(--rw-line); }
#cover .btn:focus-visible { outline: 3px solid var(--rw-grey); outline-offset: 2px; }
#cover .btn:disabled { background: var(--rw-grey); color: #fff; border-color: var(--rw-grey); opacity: 1; cursor: default; }
#cover #setup-toggle-slide-btn.active { background: var(--rw-yellow); border-color: var(--rw-grey); }
#cover #clear-queue-btn:hover { background: var(--rw-light) !important; border-color: var(--rw-grey) !important; color: var(--rw-grey) !important; }

/* Loading state: keeps the yellow button and shows a spinner beside the text */
#cover .btn.is-loading:disabled { background: var(--rw-yellow); color: var(--rw-grey); border-color: transparent; cursor: progress; }
#cover .btn.is-loading::before {
    content: ""; width: 18px; height: 18px; margin-right: 10px; flex-shrink: 0;
    border: 3px solid rgba(89,89,89,.25); border-top-color: var(--rw-grey); border-radius: 50%;
    animation: btn-spin .8s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* ---------- Queue ---------- */
.sm-empty { margin: 0; font-style: normal; color: var(--rw-grey) !important; }
#cover .lot-item {
    background: #fff; border: 1px solid var(--rw-line); border-left: 6px solid var(--rw-line);
    padding: 16px 20px; margin-bottom: 12px; gap: 16px;
}
#cover .lot-item:last-child { margin-bottom: 0; }
#cover .lot-item.active-lot { background: var(--rw-light); border-left-color: var(--rw-yellow); }
#cover .lot-item.dragging { background: #fff; opacity: .95; transform: scale(.99); box-shadow: none; outline: 2px solid var(--rw-grey); border-left-color: var(--rw-yellow); }
#cover .lot-item.drag-over { background: var(--rw-light); box-shadow: inset 0 4px 0 0 var(--rw-yellow); }
.lot-main { display: flex; align-items: center; min-width: 0; }
.drag-handle { font-size: 20px; color: #8a8a8c; margin-right: 16px; }
#cover .lot-info { font-size: 18px; min-width: 0; }
.lot-title { font-weight: 700; margin-right: 8px; }
.lot-address { font-weight: 400; }
.lot-agent { font-size: 15px; margin-top: 4px; }
#cover .lot-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
#cover .lot-actions .btn { height: 44px; padding: 0 20px; font-size: 16px; margin: 0; }
.chip { font-size: 14px; font-weight: 700; padding: 5px 12px; border-radius: 2px; margin-right: 6px; }
.chip-sold { background: var(--rw-yellow); color: var(--rw-grey); }
.chip-passed { background: var(--rw-grey); color: #fff; }
.chip-held { background: #fff; color: var(--rw-grey); border: 1px solid var(--rw-grey); }

/* ---------- Sections ---------- */
#cover input[readonly] { background: var(--rw-light); font-weight: 700; }
.section-add { display: flex; gap: 12px; margin-bottom: 24px; }
#cover .section-add input { height: 44px; flex: 1; }
#cover .section-add .btn { height: 44px; }
.section-block { border: 1px solid var(--rw-line); margin-bottom: 20px; }
.section-block:last-child { margin-bottom: 0; }
.section-head { display: flex; align-items: center; gap: 16px; padding: 10px 12px 10px 16px; background: var(--rw-light); }
#cover .section-name { flex: 1; min-width: 0; height: 40px; padding: 0 8px; font-size: 19px; font-weight: 700; background: transparent; border: 1px solid transparent; }
#cover .section-name:hover { border-color: #A5A5A7; background: #fff; }
.section-count { font-size: 15px; white-space: nowrap; }
.section-actions { display: flex; gap: 8px; }
.section-lots { padding: 12px; }
.section-lots .sm-empty { padding: 12px 4px; }
.lots-flat .lot-item:last-child { margin-bottom: 0; }

/* ---------- Bidders ---------- */
.sm-row-bidder { grid-template-columns: 90px 1.3fr 1fr 1.3fr; }
#cover .check { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; cursor: pointer; margin: 0; }
#cover .check input { width: 20px; height: 20px; padding: 0; accent-color: var(--rw-grey); }
#bidder-lot-list { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 12px; }
.bidder-save { align-items: center; margin-top: 16px; }
#bidder-list { margin-top: 24px; border-top: 1px solid var(--rw-light); }
.bidder-row { display: grid; grid-template-columns: 56px 1.6fr 1fr 150px auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--rw-light); font-size: 16px; }
.bidder-row em { color: #8a8a8c; }
.bidder-actions { display: flex; gap: 8px; }
#bidder-list .sm-empty { padding-top: 16px; }

/* ---------- Live view ---------- */
.live-note { margin: 0; max-width: 62ch; }
.live-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.live-head .btn { margin-left: auto; flex-shrink: 0; }
.live-head + .live-on { margin-top: 20px; }
.sm-collapse > .sm-body { margin-top: 20px; }
.live-on { display: flex; gap: 28px; align-items: flex-start; flex-wrap: wrap; }
#live-qr { width: 240px; height: 240px; flex-shrink: 0; outline: 1px solid var(--rw-line); image-rendering: pixelated; }
.live-info { flex: 1; min-width: 280px; }
.live-info label { display: block; font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.live-url-row { display: flex; gap: 8px; margin-bottom: 16px; }
#cover .live-url-row input { height: 44px; font-size: 15px; }
.live-status { margin: 16px 0 0; font-size: 15px; }
.live-status.bad { font-weight: 700; }

/* ---------- Modal ---------- */
.custom-modal { background: #fff; color: var(--rw-grey); border-radius: 2px; font-family: 'Lato', Arial, sans-serif; box-shadow: none; }
.custom-modal h2 { font-family: 'Playfair Display', Georgia, serif; font-weight: 400; color: var(--rw-grey); }
.custom-modal p { color: var(--rw-grey); font-weight: 300; }
.modal-btn { font: 700 18px 'Lato', Arial, sans-serif; border: 1px solid var(--rw-grey); }
.confirm-btn { background: var(--rw-yellow); color: var(--rw-grey); }
.confirm-btn:hover { background: var(--rw-yellow-hover); }
.cancel-btn { background: #fff; color: var(--rw-grey); }
.cancel-btn:hover, .extra-btn:hover { background: var(--rw-light); }
.extra-btn { background: #fff; color: var(--rw-grey); }
.custom-modal { max-width: 640px; }
.modal-buttons { flex-wrap: wrap; }

/* ---------- Narrow screens ---------- */
@media (max-width: 800px) {
    #cover #form-container { padding: 40px 20px; }
    .sm-bar-inner { height: auto; flex-wrap: wrap; gap: 12px 16px; padding: 0 20px 14px; }
    .sm-bar h1 { font-size: 34px; }
    .sm-bar-actions { width: 100%; flex-wrap: wrap; margin-left: 0; }
    .sm-row-4, .sm-row-3, .sm-row-2, .sm-row-slide, .sm-row-bidder { grid-template-columns: 1fr; }
    .sm-actions { flex-direction: column; }
    #cover .lot-item { flex-direction: column; align-items: flex-start; }
    .bidder-row { grid-template-columns: 1fr; gap: 4px; }
}

/* ---------- Walkthrough (Help?) ---------- */
.tour { position: fixed; inset: 0; z-index: 60; }
#cover.touring #form-container { padding-bottom: 440px; }
.tour.hide { display: none; }
.tour:not(.has-target) { background: rgba(30, 30, 30, .62); }
.tour:not(.has-target) .tour-spot { display: none; }
.tour-spot { position: fixed; border-radius: 4px; pointer-events: none; box-shadow: 0 0 0 9999px rgba(30, 30, 30, .62), 0 0 0 4px var(--rw-yellow); transition: top .25s, left .25s, width .25s, height .25s; }
.tour-card { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); width: min(600px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow-y: auto; box-sizing: border-box; padding: 24px 28px; background: #fff; color: var(--rw-grey); border-top: 6px solid var(--rw-yellow); outline: none; }
.tour:not(.has-target) .tour-card { bottom: auto; top: 50%; transform: translate(-50%, -50%); }
.tour-count { font-size: 13px; font-weight: 700; letter-spacing: .04em; }
.tour-card h2 { margin: 6px 0 12px; font: 400 30px/1.15 'Playfair Display', Georgia, serif; }
.tour-body { font-size: 17px; line-height: 1.5; }
.tour-body p { margin: 0 0 10px; }
.tour-body ul, .tour-body ol { margin: 0 0 10px; padding-left: 22px; }
.tour-body li { margin: 4px 0; }
.tour-dots { display: flex; gap: 6px; margin: 14px 0 4px; }
.tour-dots span { width: 8px; height: 8px; background: var(--rw-line); }
.tour-dots span.on { background: var(--rw-grey); }
.tour-nav { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.tour-spacer { flex: 1; }
#cover .tour-card .btn-quiet { background: transparent; border-color: transparent; color: var(--rw-grey); text-decoration: underline; }
#cover .tour-card .btn-quiet:hover { background: var(--rw-light); }
#cover .tour-card .btn.hide { display: none; }
@media (prefers-reduced-motion: reduce) { .tour-spot { transition: none; } }
