/* Zen Stay: shared styles for the guest site and the admin. Colours and shapes come from the prototype. */

:root {
  --bg: #f4f1ec; --card: #fff; --ink: #26302b; --muted: #6b756f; --line: #dcd7cf;
  --accent: #3f7d5c; --accent-dark: #2f6148; --accent-soft: #e4f0e9;
  --danger: #c0392b; --danger-soft: #fbeae7; --warn: #8a6d1d; --warn-soft: #fbf3dc;
  --radius: 14px; --shadow: 0 10px 30px rgba(38, 48, 43, .08);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; line-height: 1.5; color: var(--ink);
  font-family: Quicksand, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #e9e4dc 0, var(--bg) 260px) no-repeat, var(--bg);
}
[hidden] { display: none !important; }

.wrap { max-width: 640px; margin: 0 auto; padding: 28px 16px 64px; padding-bottom: max(64px, env(safe-area-inset-bottom)); }
.top { text-align: center; margin-bottom: 22px; }
.brand { font-size: 1.7rem; font-weight: 700; letter-spacing: .01em; margin: 0; }
.brand span { border-bottom: 2px solid var(--line); padding: 0 .3em .1em; }
.sub { margin: .5rem 0 0; color: var(--muted); font-weight: 500; }

h1 { font-size: 1.45rem; margin: 0 0 8px; }
h2 { font-size: 1.15rem; margin: 0 0 4px; }
p { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }
.muted { color: var(--muted); }
.center { text-align: center; }
a { color: var(--accent-dark); }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px 24px; margin-bottom: 16px; }
@media (max-width: 560px) { .card { padding: 20px 16px; } }

/* form fields */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin-top: 16px; }
label { font-weight: 600; font-size: .92rem; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date], textarea {
  font: inherit; font-size: 1rem; color: var(--ink); background: #fff; width: 100%; min-height: 48px;
  border: 1.5px solid var(--line); border-radius: 10px; padding: 12px 13px;
  transition: border-color .15s, box-shadow .15s;
}
input:hover, textarea:hover { border-color: #bdb6aa; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(63, 125, 92, .16); }

/* buttons */
.nav { display: flex; gap: 12px; margin-top: 26px; }
.btn {
  font: inherit; font-weight: 700; font-size: 1rem; border: 0; border-radius: 12px;
  padding: 14px 22px; min-height: 52px; cursor: pointer; transition: transform .05s, background .15s;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid rgba(63, 125, 92, .4); outline-offset: 2px; }
.btn.primary { background: var(--accent); color: #fff; flex: 1; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn.ghost:hover { background: #faf8f5; }
.btn.link { background: none; color: var(--accent-dark); text-decoration: underline; min-height: 44px; }

/* notices */
.banner { border-radius: 10px; padding: 12px 14px; margin: 12px 0; font-weight: 600; font-size: .92rem; }
.banner.error { background: var(--danger-soft); color: var(--danger); }
.banner.ok { background: var(--accent-soft); color: var(--accent-dark); }
.badge {
  display: inline-flex; gap: 6px; align-items: center; background: var(--accent); color: #fff;
  border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: .85rem; margin-bottom: 14px;
}
.pill {
  display: inline-block; background: var(--accent-soft); color: var(--accent-dark);
  border-radius: 999px; padding: 2px 10px; font-weight: 700; font-size: .8rem;
}

.pill.warn { background: var(--warn-soft); color: var(--warn); }
.small { font-size: .88rem; }
.btn.inline { display: inline-flex; align-items: center; text-decoration: none; flex: none; }

/* ===== check-in form ===== */

/* stepper */
.steps { display: flex; gap: 6px; margin: 0 0 18px; padding: 0; list-style: none; }
.steps li { flex: 1; }
.steps button {
  all: unset; box-sizing: border-box; width: 100%; cursor: pointer; text-align: center;
  font-size: .78rem; font-weight: 600; color: var(--muted); padding-top: 10px; position: relative;
}
.steps button::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 5px; border-radius: 5px;
  background: var(--line); transition: background .25s;
}
.steps li.done button::before { background: #9cc6ad; }
.steps li.current button::before { background: var(--accent); }
.steps li.current button { color: var(--ink); }
.steps button:disabled { cursor: default; }
.steps button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.step { animation: step-in .25s ease; }
form:not(.stepped) .step + .step { margin-top: 28px; } /* all steps on one page when the script did not run */
@keyframes step-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.intro { background: var(--accent-soft); border-radius: 10px; padding: 12px 14px; margin: 0 0 6px; }
.intro b { display: block; }
.intro small { color: #3d5547; font-size: .88rem; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.full { grid-column: 1 / -1; }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }

.opt { color: var(--muted); font-weight: 500; font-size: .8rem; margin-left: 4px; }
textarea { min-height: 92px; resize: vertical; }
input[aria-invalid=true], textarea[aria-invalid=true] { border-color: var(--danger); background: #fffafa; }
input[aria-invalid=true]:focus { box-shadow: 0 0 0 4px rgba(192, 57, 43, .14); }
.hint { font-size: .82rem; color: var(--muted); margin: 0; }
.err { font-size: .84rem; color: var(--danger); margin: 0; display: none; font-weight: 600; }
.field.bad .err { display: block; }
.suggest { font-size: .84rem; background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: 6px 10px; margin: 0; }
.suggest button { all: unset; cursor: pointer; text-decoration: underline; font-weight: 700; }
.suggest button:focus-visible, .chip:focus-visible { outline: 2px solid var(--accent); }
.chip {
  all: unset; cursor: pointer; font-size: .82rem; font-weight: 600; color: var(--accent-dark);
  background: var(--accent-soft); border-radius: 999px; padding: 4px 11px; align-self: flex-start;
}
.chip:hover { background: #d3e8dc; }

/* switches (checkboxes) */
.switch { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; padding: 12px 0; margin-top: 8px; }
.switch.tight { padding: 4px 0; margin-top: 0; }
.switch input {
  appearance: none; flex: none; width: 44px; height: 26px; border-radius: 26px; background: #cfc9be;
  position: relative; cursor: pointer; transition: background .2s; margin: 1px 0 0;
}
.switch input::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s;
}
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(18px); }
.switch input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.switch span { font-weight: 500; font-size: .95rem; }
.switch.bad span { color: var(--danger); }
.consent-err { color: var(--danger); font-size: .84rem; font-weight: 600; margin: -4px 0 6px 56px; }

/* review + admin detail lists */
.summary { margin: 0; padding: 0; }
.srow { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #eee9e1; }
.srow:last-child { border-bottom: 0; }
.srow dt { color: var(--muted); font-size: .85rem; font-weight: 600; flex: none; }
.srow dd { margin: 0; font-weight: 600; text-align: right; word-break: break-word; white-space: pre-line; }
.sgroup { margin: 18px 0 4px; display: flex; justify-content: space-between; align-items: baseline; }
.sgroup h3 { margin: 0; font-size: .95rem; }
.sgroup button { all: unset; cursor: pointer; color: var(--accent-dark); font-weight: 700; font-size: .85rem; text-decoration: underline; }
.sgroup button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn:disabled { opacity: .65; cursor: progress; }
.draft { font-size: .8rem; color: var(--muted); text-align: center; margin: 14px 0 0; min-height: 1.2em; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* "You're checked in" */
.done-card { text-align: center; padding: 36px 12px; }
.done-card h1 { font-size: 1.55rem; margin: 0 0 6px; }
.tick {
  width: 72px; height: 72px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; margin: 0 auto 14px; font-size: 2rem;
  animation: pop .45s cubic-bezier(.2, 1.4, .4, 1);
}
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }

/* ===== long text pages (policy) ===== */
.prose h1 { font-size: 1.6rem; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 2px solid var(--line); }
.prose h2 { font-size: 1.1rem; margin: 26px 0 8px; color: var(--accent-dark); }
.prose p { margin: 0 0 12px; }
.prose .lead { font-weight: 700; font-size: 1.05rem; margin-bottom: 6px; }
.prose ul { margin: 0 0 12px; padding-left: 22px; }
.prose li { margin-bottom: 4px; }
.prose li::marker { color: var(--accent); }

/* ===== admin tables ===== */
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th { text-align: left; font-size: .8rem; color: var(--muted); font-weight: 700; padding: 8px 10px 8px 0; border-bottom: 1.5px solid var(--line); }
.table td { padding: 10px 10px 10px 0; border-bottom: 1px solid #eee9e1; vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table a { font-weight: 700; }

/* ===== admin shell: left menu + page ===== */
.ms {
  font-family: 'Material Symbols Outlined'; font-weight: 400; font-style: normal; font-size: 22px; line-height: 1;
  letter-spacing: normal; text-transform: none; display: inline-block; white-space: nowrap; direction: ltr;
  width: 1em; height: 1em; overflow: hidden; vertical-align: middle; flex: none; font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
}

.shell { display: flex; min-height: 100vh; }
.sidebar {
  flex: none; width: 248px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  gap: 20px; padding: 20px 14px; background: #fff; border-right: 1px solid var(--line);
}
.side-brand { display: block; padding: 4px 10px; color: var(--ink); text-decoration: none; }
.side-brand b { display: block; font-size: 1.25rem; letter-spacing: .01em; }
.side-brand small { color: var(--muted); font-weight: 600; font-size: .8rem; }
.side-nav { flex: 1; overflow-y: auto; }
.side-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.navlink {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px;
  color: var(--ink); text-decoration: none; font-weight: 600;
}
.navlink:hover { background: #f4f1ec; }
.navlink[aria-current=page] { background: var(--accent-soft); color: var(--accent-dark); }
.side-brand:focus-visible, .navlink:focus-visible, .usermenu summary:focus-visible,
.menu a:focus-visible, .menu button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.content { flex: 1; min-width: 0; padding: 28px 32px 64px; }
.page-title { margin: 0 0 18px; font-size: 1.6rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; align-items: start; }
.cards .card { margin-bottom: 0; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 16px; align-items: start; }
.narrow { max-width: 640px; }
.stat { font-size: 2.8rem; font-weight: 700; line-height: 1.1; margin: 0; }
.stat-label { color: var(--muted); font-weight: 600; margin: 2px 0 14px; }

/* the avatar menu at the bottom of the left menu */
.usermenu { position: relative; }
.usermenu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary:hover, .usermenu[open] summary { background: #f4f1ec; }
.avatar {
  flex: none; width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: .95rem;
}
.who { flex: 1; min-width: 0; line-height: 1.25; }
.who b, .who small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who small { color: var(--muted); font-weight: 600; font-size: .78rem; }
.menu {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); z-index: 10; padding: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
}
.menu a, .menu button {
  all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--ink);
}
.menu a:hover, .menu button:hover { background: #f4f1ec; }
.menu a:focus-visible, .menu button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* small screens: the menu becomes a bar on top of the page */
@media (max-width: 800px) {
  .shell { flex-direction: column; }
  .sidebar {
    position: static; width: auto; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center;
    gap: 8px 12px; padding: 10px 14px; border-right: 0; border-bottom: 1px solid var(--line);
  }
  .side-brand { flex: 1; }
  .usermenu { order: 2; }
  .who, .usermenu summary .ms { display: none; }
  .side-nav { order: 3; flex: 0 0 100%; overflow: visible; }
  .side-nav ul { display: flex; gap: 6px; overflow-x: auto; }
  .menu { bottom: auto; top: calc(100% + 6px); left: auto; right: 0; width: 200px; }
  .content { padding: 20px 14px 48px; }
}

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
