/* ClickMe — shared styles. Mobile-first, welcoming hotel style, accessible. */

:root {
  --red: #DC2626;
  --red-dark: #B91C1C;
  --red-soft: #FEF2F2;
  --ink: #111827;
  --muted: #6B7280;
  --line: #E5E7EB;
  --paper: #FFFFFF;
  --bg: #F7F7F8;
  --ok: #047857;
  --ok-soft: #ECFDF5;
  --warn: #B45309;
  --warn-soft: #FFFBEB;
  --info: #1D4ED8;
  --info-soft: #EFF6FF;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(17,24,39,.06), 0 8px 24px rgba(17,24,39,.06);
  --focus: 0 0 0 3px rgba(220,38,38,.35);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-size: 17px;
}
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; margin: 0; }
a { color: var(--red); }
img { max-width: 100%; }

/* Layout -------------------------------------------------------------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.wrap { width: 100%; max-width: 600px; margin: 0 auto; padding: 16px; }
.wrap-wide { max-width: 1040px; }
.grow { flex: 1; }
.stack > * + * { margin-top: 14px; }
.row { display: flex; gap: 10px; align-items: center; }
.row-between { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.wrap-gap { flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 12px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* Brand header -------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--paper); border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; gap: 12px; padding-top: 12px; padding-bottom: 12px; }
.brand { font-weight: 800; font-size: 22px; letter-spacing: -0.03em; color: var(--ink); text-decoration: none; }
.brand span { color: var(--red); }
.brand-sub { font-size: 12px; color: var(--muted); font-weight: 600; }

/* Demo banner --------------------------------------------------------- */
.demo-banner {
  background: var(--warn-soft); color: var(--warn);
  border-bottom: 1px solid #FDE68A;
  font-size: 13px; font-weight: 600;
}
.demo-banner .wrap { padding-top: 8px; padding-bottom: 8px; display: flex; gap: 10px; align-items: center; justify-content: center; text-align: center; }

/* Cards --------------------------------------------------------------- */
.card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
}
.card + .card { margin-top: 14px; }
.card h2 { font-size: 20px; }
.card h3 { font-size: 16px; }
.card-tight { padding: 14px; }

/* Buttons ------------------------------------------------------------- */
.btn {
  appearance: none; border: 1px solid transparent; cursor: pointer;
  font-family: inherit; font-size: 17px; font-weight: 700;
  padding: 14px 18px; border-radius: var(--radius-sm);
  min-height: 52px; width: 100%;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { background: #F9FAFB; }
.btn-ghost { background: transparent; color: var(--red); min-height: 44px; padding: 10px 12px; }
.btn-danger { background: #fff; color: var(--red); border-color: #FCA5A5; }
.btn-auto { width: auto; }
.btn-sm { min-height: 40px; padding: 8px 14px; font-size: 15px; width: auto; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row .btn { width: auto; flex: 1; min-width: 140px; }

/* Forms --------------------------------------------------------------- */
.field { display: block; margin-top: 14px; }
.field:first-child { margin-top: 0; }
.field label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.field .hint { font-weight: 400; color: var(--muted); font-size: 13px; }
.input, .select, .textarea {
  width: 100%; font-family: inherit; font-size: 17px; color: var(--ink);
  padding: 13px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--red); box-shadow: var(--focus); }
.input[aria-invalid="true"] { border-color: var(--red); }
.textarea { min-height: 90px; resize: vertical; }
.field-error { color: var(--red); font-size: 13px; margin-top: 6px; font-weight: 600; }
.checkrow { display: flex; gap: 12px; align-items: flex-start; margin-top: 12px; }
.checkrow input[type="checkbox"] { width: 22px; height: 22px; margin-top: 2px; flex: none; accent-color: var(--red); }
.code-input { letter-spacing: 8px; text-align: center; font-size: 26px; font-weight: 700; }

/* Progress steps ------------------------------------------------------ */
.progress { display: flex; gap: 6px; margin: 4px 0 2px; }
.progress .seg { flex: 1; height: 6px; border-radius: 99px; background: var(--line); }
.progress .seg.done { background: var(--red); }
.progress .seg.active { background: var(--red); opacity: .55; }
.step-label { font-size: 13px; color: var(--muted); font-weight: 600; }

/* Status pills -------------------------------------------------------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 99px;
  border: 1px solid transparent; white-space: nowrap;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 99px; background: currentColor; }
.pill-grey { background: #F3F4F6; color: #4B5563; }
.pill-info { background: var(--info-soft); color: var(--info); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-red { background: var(--red-soft); color: var(--red); }

/* Banners ------------------------------------------------------------- */
.banner { border-radius: var(--radius-sm); padding: 14px 16px; font-size: 15px; border: 1px solid; }
.banner-info { background: var(--info-soft); color: var(--info); border-color: #BFDBFE; }
.banner-ok { background: var(--ok-soft); color: var(--ok); border-color: #A7F3D0; }
.banner-warn { background: var(--warn-soft); color: var(--warn); border-color: #FDE68A; }
.banner-error { background: var(--red-soft); color: var(--red-dark); border-color: #FCA5A5; }
.banner strong { display: block; margin-bottom: 2px; }

/* Definition rows ----------------------------------------------------- */
.dl { display: grid; grid-template-columns: 1fr auto; gap: 10px 16px; }
.dl dt { color: var(--muted); font-size: 15px; }
.dl dd { margin: 0; font-weight: 600; text-align: right; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }

/* Loading skeletons --------------------------------------------------- */
.skeleton { background: linear-gradient(90deg,#eee,#f5f5f5,#eee); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; }
@keyframes sk { 0%{background-position:200% 0} 100%{background-position:-200% 0} }
.sk-line { height: 14px; margin: 8px 0; }
.sk-line.w60 { width: 60%; } .sk-line.w40 { width: 40%; } .sk-line.w80 { width: 80%; }
.spinner { width: 20px; height: 20px; border: 3px solid rgba(255,255,255,.5); border-top-color: #fff; border-radius: 99px; animation: spin .7s linear infinite; }
.spinner-ink { border-color: rgba(17,24,39,.2); border-top-color: var(--ink); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Empty state --------------------------------------------------------- */
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty .big { font-size: 40px; margin-bottom: 8px; }

/* Staff table / list -------------------------------------------------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .input { width: auto; flex: 1; min-width: 180px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font-size: 14px; font-weight: 600; padding: 8px 12px; border-radius: 99px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.arrival { display: block; width: 100%; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; cursor: pointer; }
.arrival + .arrival { margin-top: 10px; }
.arrival:hover { border-color: #D1D5DB; }
.arrival:focus-visible { outline: none; box-shadow: var(--focus); }
.arrival .top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.arrival .name { font-weight: 700; font-size: 17px; }
.arrival .ref { color: var(--muted); font-size: 13px; }
.arrival .statuses { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }

/* Modal / drawer ------------------------------------------------------ */
.overlay { position: fixed; inset: 0; background: rgba(17,24,39,.45); display: flex; align-items: flex-end; justify-content: center; z-index: 50; }
.sheet { background: #fff; width: 100%; max-width: 680px; max-height: 92vh; overflow: auto; border-radius: 18px 18px 0 0; padding: 18px; }
.sheet h2 { font-size: 20px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; position: sticky; top: -18px; background: #fff; padding: 6px 0; }
.icon-btn { background: #F3F4F6; border: none; width: 40px; height: 40px; border-radius: 99px; font-size: 20px; cursor: pointer; line-height: 1; }
@media (min-width: 640px) { .overlay { align-items: center; } .sheet { border-radius: 18px; } }

/* Toast --------------------------------------------------------------- */
.toast-wrap { position: fixed; left: 0; right: 0; bottom: 16px; display: flex; justify-content: center; z-index: 80; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 99px; font-weight: 600; font-size: 15px; box-shadow: var(--shadow); max-width: 92%; }
.toast.err { background: var(--red-dark); }

/* Simulated/label tag ------------------------------------------------- */
.sim-tag { display: inline-block; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--warn); background: var(--warn-soft); border: 1px solid #FDE68A; padding: 2px 8px; border-radius: 6px; }

/* Big code / key ------------------------------------------------------ */
.keybox { text-align: center; padding: 20px; background: var(--ink); color: #fff; border-radius: var(--radius); }
.keybox .num { font-size: 44px; font-weight: 800; letter-spacing: 6px; }
.roombox { text-align: center; padding: 18px; background: var(--ok-soft); border: 1px solid #A7F3D0; border-radius: var(--radius); }
.roombox .num { font-size: 40px; font-weight: 800; color: var(--ok); }

/* Landing ------------------------------------------------------------- */
.hero { text-align: center; padding: 28px 0 12px; }
.hero h1 { font-size: clamp(40px, 11vw, 72px); font-weight: 800; }
.hero h1 span { color: var(--red); }
.hero p { color: var(--muted); font-size: 18px; margin-top: 8px; }

footer.foot { color: var(--muted); font-size: 13px; text-align: center; padding: 24px 16px; }
