/* Shared styles for /book, /booking and /admin */
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 300 900; font-display: swap; src: url(fonts/figtree-latin.woff2) format('woff2'); }
@font-face { font-family: 'Instrument Serif'; font-style: italic; font-weight: 400; font-display: swap; src: url(fonts/instrument-serif-italic-latin.woff2) format('woff2'); }

:root {
    --bg: #ECE6E8; --ink: #0b0b0c; --muted: #6f6a72; --line: rgba(0,0,0,.09);
    --card: rgba(255,255,255,.62); --purple: #481BB6; --purple-2: #6a3cf0; --lav: #e7e0f6;
    --ok: #12804a; --warn: #a15c00; --bad: #b3261e; --radius: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
    font-family: 'Figtree', system-ui, sans-serif; font-weight: 500; color: var(--ink); background: var(--bg);
    background-image: radial-gradient(circle, rgba(72,27,182,.12) 1px, transparent 1.3px); background-size: 16px 16px;
    -webkit-font-smoothing: antialiased; min-height: 100vh;
}
a { color: var(--purple); }
button, input, select, textarea { font: inherit; color: inherit; }
.accent { font-family: 'Instrument Serif', serif; font-style: italic; font-weight: 400; font-size: 1.18em; -webkit-text-stroke: .03em currentColor; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* top bar */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 1120px; margin: 0 auto; padding: 22px 20px; }
.topbar img { height: 38px; width: auto; display: block; }

/* cards & buttons */
.card { background: var(--card); border: 1px solid rgba(255,255,255,.8); border-radius: var(--radius); box-shadow: 0 30px 60px -40px rgba(40,20,90,.35); backdrop-filter: blur(8px); }
.dark { background: #000; color: #fff; border-color: #000; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 22px; border-radius: 999px; border: 0; cursor: pointer; text-decoration: none; font-size: 15px; transition: filter .15s, transform .15s, background .15s; white-space: nowrap; }
.btn:active { transform: scale(.98); }
.btn-primary { background: linear-gradient(90deg, #0f0a24 0%, #2a2733 55%, #3d3d3d 100%); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 10px 22px -12px rgba(0,0,0,.6); }
.btn-primary:hover { filter: brightness(1.25); }
.btn-purple { background: var(--purple); color: #fff; }
.btn-purple:hover { background: var(--purple-2); }
.btn-ghost { background: transparent; border: 1px solid rgba(0,0,0,.8); color: var(--ink); }
.btn-ghost:hover { background: #000; color: #fff; }
.btn-danger { background: transparent; border: 1px solid rgba(179,38,30,.5); color: var(--bad); }
.btn-danger:hover { background: var(--bad); color: #fff; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.icon-btn { width: 38px; height: 38px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.7); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-btn:hover { background: #fff; }
.icon-btn[disabled] { opacity: .35; pointer-events: none; }

/* forms */
label.field { display: block; margin-bottom: 14px; font-size: 14px; }
label.field > span { display: block; margin-bottom: 6px; color: var(--muted); }
.input, select.input, textarea.input { width: 100%; height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid rgba(0,0,0,.14); background: #fff; outline: none; font-size: 16px; }
textarea.input { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; }
.input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(72,27,182,.15); }
.hint { font-size: 13px; color: var(--muted); }
.error-box { background: #fdecea; color: var(--bad); border-radius: 12px; padding: 10px 14px; font-size: 14px; margin-bottom: 14px; }
.notice { background: #fff6e5; color: var(--warn); border-radius: 12px; padding: 10px 14px; font-size: 14px; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 999px; font-size: 13px; background: var(--lav); color: var(--purple); }
.dot { width: 8px; height: 8px; border-radius: 99px; background: #39ff14; display: inline-block; }

/* ---------- booking page ---------- */
.book-wrap { max-width: 1120px; margin: 0 auto 60px; padding: 0 20px; display: grid; grid-template-columns: 340px 1fr; gap: 24px; align-items: start; }
.host { padding: 28px; position: sticky; top: 20px; }
.host .avatar { width: 84px; height: auto; display: block; margin-bottom: 18px; }
.host h1 { font-size: 30px; line-height: 34px; margin: 6px 0 14px; letter-spacing: -.02em; font-weight: 500; }
.host .meta { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 10px; color: #3a3640; font-size: 15px; }
.host .meta li { display: flex; gap: 10px; align-items: center; }
.host .meta svg { flex: none; color: var(--purple); }
.host p { color: var(--muted); font-size: 15px; line-height: 22px; margin: 0; }
.picker { padding: 28px; min-height: 520px; }
.picker h2 { font-size: 22px; font-weight: 500; margin: 0 0 18px; letter-spacing: -.01em; }
.picker-grid { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 28px; }
.month-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.month-head strong { font-size: 17px; font-weight: 600; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; text-align: center; }
.cal .dow { font-size: 12px; color: var(--muted); padding: 6px 0; text-transform: uppercase; letter-spacing: .04em; }
.cal button { aspect-ratio: 1; border: 0; border-radius: 999px; background: transparent; font-size: 15px; color: #b5afb9; cursor: default; position: relative; }
.cal button.open { background: var(--lav); color: var(--purple); font-weight: 700; cursor: pointer; }
.cal button.open:hover { background: #d9cef3; }
.cal button.sel { background: var(--purple); color: #fff; }
.cal button.today::after { content: ''; position: absolute; bottom: 6px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 9px; background: currentColor; }
.tz-row { margin-top: 18px; display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.tz-row select { max-width: 100%; height: 38px; font-size: 14px; }
.times h3 { font-size: 15px; font-weight: 600; margin: 4px 0 14px; }
.times .list { display: grid; gap: 8px; max-height: 420px; overflow-y: auto; padding-right: 4px; }
.slot { display: flex; gap: 8px; }
.slot button { flex: 1; min-width: 0; padding: 0 8px; white-space: nowrap; height: 46px; border-radius: 12px; border: 1px solid rgba(72,27,182,.35); background: #fff; color: var(--purple); font-weight: 600; cursor: pointer; transition: all .15s; }
.slot button:hover { border-color: var(--purple); box-shadow: 0 0 0 2px rgba(72,27,182,.15); }
.slot.active button { background: #555; color: #fff; border-color: #555; flex: 1; }
.slot .go { display: none; }
.slot.active .go { display: inline-flex; flex: 1; height: 46px; border-radius: 12px; }
.empty { color: var(--muted); font-size: 14px; line-height: 21px; }
.summary { display: flex; gap: 12px; align-items: flex-start; background: var(--lav); border-radius: 14px; padding: 14px 16px; margin-bottom: 20px; color: #2b2340; font-size: 15px; line-height: 22px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.done { text-align: center; padding: 30px 10px; }
.done .check { width: 64px; height: 64px; border-radius: 99px; background: var(--purple); color: #fff; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.done h2 { font-size: 28px; margin-bottom: 8px; }
.done .when { font-size: 18px; margin: 14px 0 20px; }
.skeleton { background: linear-gradient(90deg, rgba(0,0,0,.05), rgba(0,0,0,.09), rgba(0,0,0,.05)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 12px; }
@keyframes sk { to { background-position: -200% 0; } }

@media (max-width: 900px) {
    .book-wrap { grid-template-columns: 1fr; }
    .host { position: static; }
    .picker-grid { grid-template-columns: 1fr; }
    .times .list { max-height: none; grid-template-columns: 1fr 1fr; }
    .slot.active { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
    .picker, .host { padding: 20px; }
    .form-grid { grid-template-columns: 1fr; }
    .host h1 { font-size: 26px; line-height: 30px; }
}

/* ---------- manage page ---------- */
.narrow { max-width: 560px; margin: 0 auto 60px; padding: 0 20px; }
.narrow .card { padding: 28px; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 10px 14px; font-size: 15px; margin: 18px 0 22px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- admin ---------- */
.admin { max-width: 1180px; margin: 0 auto 80px; padding: 0 20px; }
.tabs { display: flex; gap: 6px; background: rgba(255,255,255,.55); border: 1px solid rgba(255,255,255,.9); padding: 5px; border-radius: 999px; width: max-content; max-width: 100%; overflow-x: auto; }
.tabs button { height: 38px; padding: 0 16px; border-radius: 999px; border: 0; background: transparent; cursor: pointer; font-size: 14px; white-space: nowrap; }
.tabs button[aria-selected="true"] { background: #000; color: #fff; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 22px 0; }
.stat { padding: 18px 20px; }
.stat b { display: block; font-size: 30px; font-weight: 600; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: 14px; }
.subtabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.subtabs button { height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.6); cursor: pointer; font-size: 14px; }
.subtabs button[aria-pressed="true"] { background: var(--purple); color: #fff; border-color: var(--purple); }
.meetings { display: grid; gap: 12px; }
.meeting { padding: 18px 20px; display: grid; grid-template-columns: 150px 1fr auto; gap: 18px; align-items: start; }
.meeting .date b { display: block; font-size: 20px; font-weight: 600; }
.meeting .date span { color: var(--muted); font-size: 14px; }
.meeting h3 { margin: 0 0 4px; font-size: 18px; font-weight: 600; }
.meeting .sub { color: var(--muted); font-size: 14px; line-height: 21px; word-break: break-word; }
.meeting .notes { margin-top: 10px; font-size: 14px; line-height: 21px; background: rgba(0,0,0,.035); border-radius: 10px; padding: 10px 12px; white-space: pre-wrap; }
.meeting .actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.meeting details { margin-top: 10px; }
.meeting summary { cursor: pointer; font-size: 14px; color: var(--purple); }
.badge { display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 99px; background: #eee; color: #555; margin-left: 6px; vertical-align: middle; }
.badge.cancel { background: #fdecea; color: var(--bad); }
.badge.soon { background: #e7f6ee; color: var(--ok); }
.panel { padding: 24px; margin-top: 20px; }
.panel h2 { margin: 0 0 4px; font-size: 20px; font-weight: 600; }
.panel > p.hint { margin: 0 0 18px; }
.day { display: grid; grid-template-columns: 140px 1fr; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); align-items: start; }
.day:first-of-type { border-top: 0; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; height: 40px; }
.switch input { width: 40px; height: 22px; appearance: none; background: #cfc9d3; border-radius: 99px; position: relative; cursor: pointer; transition: background .2s; margin: 0; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 99px; background: #fff; transition: transform .2s; }
.switch input:checked { background: var(--purple); }
.switch input:checked::after { transform: translateX(18px); }
.ranges { display: grid; gap: 8px; }
.range { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.range input[type="time"] { width: 150px; height: 40px; }
.off { color: var(--muted); font-size: 14px; height: 40px; display: flex; align-items: center; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; }
.overrides { display: grid; gap: 8px; margin-top: 14px; }
.override { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 12px; background: rgba(0,0,0,.035); font-size: 14px; }
.savebar { position: sticky; bottom: 16px; display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 20px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: #000; color: #fff; padding: 12px 18px; border-radius: 999px; font-size: 14px; opacity: 0; transition: all .25s; pointer-events: none; z-index: 50; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.modal { position: fixed; inset: 0; background: rgba(10,6,20,.45); display: none; align-items: center; justify-content: center; padding: 20px; z-index: 40; }
.modal.open { display: flex; }
.modal .card { background: #fff; width: 100%; max-width: 460px; padding: 24px; }
.login { max-width: 400px; margin: 10vh auto; padding: 32px; }
.share { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.share code { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font-size: 14px; }
@media (max-width: 860px) {
    .stats { grid-template-columns: 1fr 1fr; }
    .meeting { grid-template-columns: 1fr; }
    .meeting .actions { flex-direction: row; flex-wrap: wrap; }
    .day { grid-template-columns: 1fr; gap: 6px; }
    .grid2, .grid3 { grid-template-columns: 1fr; }
}
