/* ==========================================================
   Shared design system: every page links this BEFORE its own <style>.
   Change the brand here; pages refer to these variables, not raw colors.
   ========================================================== */

:root {
    /* Typeface */
    --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;

    /* Neutrals: warm off-white ground, charcoal ink */
    --bg: #f6f4f0;
    --surface: #ffffff;
    --surface-2: #faf8f5;      /* subtle fills: tab bars, footers, hover rows */
    --fill: #efebe5;           /* chips, secondary buttons */
    --line: #e6e1d9;           /* card borders, dividers */
    --line-strong: #d3ccc1;    /* input borders, dashed outlines */
    --ink: #1c1f23;            /* headings and main text */
    --ink-2: #454b53;          /* body text */
    --muted: #6f757d;          /* secondary text */
    --faint: #a3a7ad;          /* placeholders, disabled */

    /* Brand accent: deep teal */
    --accent: #0f766e;
    --accent-hover: #0b5d56;
    --accent-soft: #e5f3f1;
    --accent-soft-line: #b9dfd9;
    --accent-ring: rgba(15, 118, 110, 0.22);

    /* Status */
    --success: #15803d;
    --success-soft: #dcf5e4;
    --warn: #a15c07;
    --warn-soft: #fdf3e1;
    --warn-line: #f2d49b;
    --danger: #c53030;
    --danger-soft: #fdeaea;
    --star: #f59e0b;

    /* Shape */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 18px;
    --shadow-sm: 0 1px 2px rgba(28, 31, 35, 0.05);
    --shadow: 0 4px 16px rgba(28, 31, 35, 0.06);
    --shadow-lg: 0 18px 48px rgba(28, 31, 35, 0.14);
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--ink-2);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

h1, h2, h3, h4, h5 { font-family: var(--font); color: var(--ink); letter-spacing: -0.02em; line-height: 1.2; }
h1 { font-weight: 800; }
h2, h3 { font-weight: 700; }

a { color: var(--accent); }
::selection { background: var(--accent-soft-line); color: var(--ink); }

button, input, select, textarea { font-family: inherit; }

input, select, textarea {
    color: var(--ink);
    background-color: var(--surface);
    transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-ring);
    outline: none;
}

button { transition: background-color 0.15s, color 0.15s, border-color 0.15s, transform 0.1s; }
button:active:not(:disabled) { transform: translateY(1px); }
button:focus-visible, a:focus-visible { outline: 3px solid var(--accent-ring); outline-offset: 2px; }

img { max-width: 100%; }

input[type="checkbox"], input[type="radio"], input[type="range"] { accent-color: var(--accent); }

/* ---------- Shared brand pieces ---------- */
.brand-mark {
    display: inline-flex; align-items: center; gap: 10px;
    font-weight: 800; font-size: 1.15rem; color: var(--ink); text-decoration: none; letter-spacing: -0.02em;
}
.brand-mark .brand-dot {
    width: 30px; height: 30px; border-radius: 9px; background: var(--accent);
    display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 0.95rem;
}

/* ---------- Reviews & reply threads (static/js/reviews.js) ---------- */
.rv-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; background: var(--surface); text-align: left; }
.rv-head { display: flex; align-items: center; gap: 12px; }
.rv-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rv-name { font-weight: 700; color: var(--ink); font-size: 0.95rem; }
.rv-sub { color: var(--muted); font-size: 0.8rem; }
.rv-stars { margin-left: auto; color: var(--star); letter-spacing: 1px; font-size: 1rem; white-space: nowrap; }
.rv-text { color: var(--ink-2); font-size: 0.92rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.rv-body { margin-top: 10px; }
.rv-replies { margin: 12px 0 0 18px; padding-left: 14px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.rv-reply-meta { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; color: var(--ink); margin-bottom: 2px; }
.rv-badge { background: var(--accent-soft); color: var(--accent); font-size: 0.68rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.04em; }
.rv-date { color: var(--faint); font-size: 0.78rem; }
.rv-reply-form, .rv-write { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.rv-reply-form textarea, .rv-write textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px; font-size: 0.9rem; resize: vertical; }
.rv-reply-btn { align-self: flex-end; background: var(--accent); color: #fff; border: none; border-radius: 10px; padding: 8px 18px; font-weight: 700; font-size: 0.88rem; cursor: pointer; }
.rv-reply-btn:hover { background: var(--accent-hover); }
.rv-reply-btn:disabled { background: var(--faint); cursor: not-allowed; }
.rv-pick { display: flex; gap: 4px; }
.rv-pick-star { background: none; border: none; font-size: 1.8rem; line-height: 1; color: var(--line-strong); cursor: pointer; padding: 0 2px; }
.rv-pick-star.on { color: var(--star); }
.rv-empty { text-align: center; color: var(--muted); font-style: italic; padding: 24px 0; }
.reviews-modal-scroll { max-height: 65vh; overflow-y: auto; margin: 0 -6px; padding: 0 6px; }

/* ---------- "Confirm your email" banner (static/js/verify-banner.js) ---------- */
.verify-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    background: var(--warn-soft); border: 1px solid var(--warn-line); color: var(--warn); border-radius: var(--radius);
    padding: 12px 16px; font-size: 0.9rem; text-align: left; }
.verify-banner strong { color: var(--ink); }
.verify-banner button { background: var(--surface); border: 1px solid var(--warn-line); color: var(--warn); font-weight: 700;
    border-radius: 8px; padding: 6px 12px; cursor: pointer; white-space: nowrap; }
.verify-banner button:disabled { opacity: 0.7; cursor: default; }
.forgot-link { display: block; text-align: right; font-size: 0.85rem; color: var(--accent); text-decoration: none; margin: 4px 0 6px 0; font-weight: 600; }
.forgot-link:hover { text-decoration: underline; }

/* Small helper text under a form field */
.field-hint { display: block; margin-top: 4px; font-size: 0.8rem; color: var(--muted); }

/* The hidden attribute always hides, even on elements whose class sets display: flex/grid */
[hidden] { display: none !important; }

/* ---------- Photo lightbox (static/js/lightbox.js) ---------- */
.lightbox { position: fixed; inset: 0; z-index: 5000; background: rgba(15, 17, 20, 0.92); display: flex; align-items: center; justify-content: center; }
.lightbox-img { max-width: calc(100vw - 120px); max-height: calc(100vh - 80px); border-radius: 8px; object-fit: contain; }
.lightbox-btn { position: absolute; background: rgba(255, 255, 255, 0.14); color: #fff; border: none; border-radius: 50%;
    width: 44px; height: 44px; font-size: 1.5rem; cursor: pointer; line-height: 1; }
.lightbox-btn:hover { background: rgba(255, 255, 255, 0.28); }
.lightbox-close { top: 16px; right: 16px; font-size: 1.1rem; }
.lightbox-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lightbox-count { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center; color: #d6d9dd; font-size: 0.85rem; }
@media (max-width: 600px) { .lightbox-img { max-width: 100vw; } .lightbox-prev, .lightbox-next { top: auto; bottom: 12px; transform: none; } }

/* ---------- Review photos ---------- */
.rv-photos { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
.rv-photo { padding: 0; border: none; background: none; cursor: zoom-in; border-radius: 8px; overflow: hidden; }
.rv-photo img { width: 72px; height: 72px; object-fit: cover; display: block; border-radius: 8px; border: 1px solid var(--line); }
.rv-add-photo { font-size: 0.82rem; font-weight: 700; color: var(--accent); cursor: pointer; border: 1px dashed var(--accent-soft-line); border-radius: 8px; padding: 8px 10px; }

/* ---------- Message threads (static/js/messages.js) ---------- */
.msg-thread { border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: var(--surface); margin-top: 8px; }
.msg-list { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.msg { display: flex; flex-direction: column; align-items: flex-start; }
.msg-mine { align-items: flex-end; }
.msg-bubble { background: var(--fill); color: var(--ink); border-radius: 12px 12px 12px 4px; padding: 8px 11px; font-size: 0.9rem; max-width: 85%; white-space: pre-wrap; word-break: break-word; }
.msg-mine .msg-bubble { background: var(--accent); color: #fff; border-radius: 12px 12px 4px 12px; }
.msg-meta { font-size: 0.7rem; color: var(--faint); margin-top: 2px; }
.msg-form { display: flex; gap: 8px; align-items: flex-end; }
.msg-form textarea { flex: 1; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 8px; font-family: inherit; font-size: 0.9rem; resize: vertical; }
.msg-send { background: var(--accent); color: #fff; border: none; border-radius: 8px; padding: 9px 14px; font-weight: 700; cursor: pointer; font-family: inherit; }
.msg-empty { color: var(--muted); font-size: 0.85rem; text-align: center; margin: 6px 0; }
.unread-dot { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
    background: var(--danger); color: #fff; font-size: 0.7rem; font-weight: 800; margin-left: 6px; }

/* ---------- Tappable time slots ---------- */
.slot-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.slot-pill { border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: 7px 12px;
    font-size: 0.85rem; font-weight: 700; cursor: pointer; font-family: inherit; }
.slot-pill:hover { border-color: var(--accent); color: var(--accent); }
.slot-pill.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- Toasts and confirm dialogs (static/js/ui.js) ---------- */
.toast-stack { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 7000; display: flex; flex-direction: column; gap: 8px;
    width: min(460px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; background: var(--ink); color: #fff;
    border-radius: 12px; padding: 12px 14px; font-size: 0.92rem; line-height: 1.4; box-shadow: var(--shadow-lg); transition: opacity 0.4s, transform 0.4s; }
.toast-success { background: #11623a; }
.toast-error { background: #9b2424; }
.toast button { background: none; border: none; color: inherit; opacity: 0.75; cursor: pointer; font-size: 0.9rem; padding: 0 2px; }
.toast-hide { opacity: 0; transform: translateY(8px); }
.dialog-overlay { position: fixed; inset: 0; z-index: 6000; background: rgba(28, 31, 35, 0.45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.dialog { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 22px; width: 100%; max-width: 420px; }
.dialog p { margin: 0 0 18px 0; color: var(--ink); font-size: 0.98rem; line-height: 1.5; }
.dialog-buttons { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.dialog-buttons button { border-radius: 10px; padding: 10px 16px; font-weight: 700; font-family: inherit; font-size: 0.92rem; cursor: pointer; }
.dialog-cancel { background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink-2); }
.dialog-ok { background: var(--accent); border: 1px solid var(--accent); color: #fff; }
.dialog-ok.danger { background: var(--danger); border-color: var(--danger); }

/* ---------- Keyboard focus, everywhere ---------- */
:focus-visible { outline: 3px solid var(--accent-ring); outline-offset: 2px; }
button:focus-visible, a:focus-visible, [role="button"]:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Verified badge ---------- */
.verified-badge { display: inline-flex; align-items: center; gap: 4px; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-soft-line);
    border-radius: 999px; padding: 2px 9px; font-size: 0.75rem; font-weight: 800; vertical-align: middle; white-space: nowrap; }
.rv-report { background: none; border: none; padding: 0; margin-top: 8px; color: var(--faint); font-size: 0.75rem; cursor: pointer; font-family: inherit; text-decoration: underline; }
