/* ==========================================================================
   Shared look for every page of the staff system.
   Colours and fonts are set once, here at the top.
   ========================================================================== */
:root {
  --lobby: #1e4d3a;        /* deep lobby green: the main colour */
  --lobby-dark: #163a2c;
  --brass: #b8893b;        /* key-tag brass: accents and focus rings */
  --brass-light: #efe2c6;
  --ink: #1c2321;          /* main text */
  --ink-soft: #56625d;     /* secondary text */
  --mist: #eef2ef;         /* page background */
  --paper: #ffffff;
  --line: #d5ddd8;
  --danger: #b42318;
  --danger-light: #fdecea;

  --font-display: "Young Serif", Georgia, "Times New Roman", serif;
  --font-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --radius: 10px;
}

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  background: var(--mist);
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.2;
}

:focus-visible {
  outline: 3px solid var(--brass);
  outline-offset: 2px;
}

/* ---------- Buttons ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 1.1rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.button-primary { background: var(--lobby); color: #fff; }
.button-primary:hover { background: var(--lobby-dark); }
.button-primary:disabled { opacity: 0.65; cursor: progress; }
.button-on-dark { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.45); }
.button-on-dark:hover { border-color: #fff; }

/* ---------- Form fields ---------- */
.field { display: grid; gap: 0.35rem; }
.field label { font-size: 0.95rem; font-weight: 600; }
.field input {
  min-height: 46px;
  padding: 0 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font: inherit;
}
.field input:focus-visible { border-color: var(--lobby); outline-offset: 1px; }

/* ---------- Banner shown when setup or the connection is missing ---------- */
.setup-banner {
  padding: 0.9rem 1.25rem;
  background: var(--danger-light);
  color: var(--danger);
  font-weight: 600;
  text-align: center;
}

/* ==========================================================================
   Login page: the sign-in panel is shaped like a hotel key tag
   ========================================================================== */
.login-page { background: var(--lobby); }

.login-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.25rem;
}

.key-tag {
  position: relative;
  width: min(100%, 380px);
  padding: 6.25rem 2rem 2.25rem;
  background: var(--paper);
  border-radius: 50% 50% 22px 22px / 130px 130px 22px 22px;
  box-shadow: 0 32px 60px -24px rgba(0, 0, 0, 0.55);
  transform-origin: 50% 46px;
  animation: tag-settle 1.1s cubic-bezier(0.3, 0.7, 0.4, 1) both;
}

/* engraved brass edge */
.key-tag::after {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1.5px solid var(--brass);
  border-radius: 50% 50% 15px 15px / 122px 122px 15px 15px;
  pointer-events: none;
}

/* punched hole with a brass ring */
.key-tag::before {
  content: "";
  position: absolute;
  top: 30px;
  left: 50%;
  width: 32px;
  height: 32px;
  margin-left: -16px;
  border-radius: 50%;
  background: var(--lobby);
  box-shadow: 0 0 0 6px var(--brass), inset 0 3px 5px rgba(0, 0, 0, 0.45);
}

.key-tag-name {
  font-size: 1.85rem;
  text-align: center;
  color: var(--lobby);
  overflow-wrap: anywhere;
}
.key-tag-sub {
  margin: 0.3rem 0 1.75rem;
  text-align: center;
  color: var(--ink-soft);
}

.login-form { position: relative; z-index: 1; display: grid; gap: 1rem; }
.login-form .button-primary { width: 100%; margin-top: 0.25rem; }

.message { margin: 0; font-size: 0.95rem; }
.message:empty { margin: -0.5rem 0; }   /* no extra gap until there's something to say */
.message.is-error { color: var(--danger); }

.login-help {
  max-width: 34ch;
  margin: 1.5rem 0 0;
  text-align: center;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.78);
}

@keyframes tag-settle {
  0%   { transform: rotate(-5deg); }
  55%  { transform: rotate(1.5deg); }
  100% { transform: rotate(0deg); }
}

/* ==========================================================================
   Staff screens (reception, bar & restaurant, admin)
   ========================================================================== */
.is-checking .topbar-user,
.is-checking .screen { visibility: hidden; }

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding: 0.8rem 1.25rem;
  background: var(--lobby);
  color: #fff;
  border-bottom: 3px solid var(--brass);
}
.topbar-hotel { font-family: var(--font-display); font-size: 1.3rem; }
.topbar-user { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.role-tag {
  margin-left: 0.5rem;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  background: var(--brass-light);
  color: var(--lobby-dark);
  font-size: 0.8rem;
  font-weight: 600;
}

.screen { max-width: 960px; margin: 0 auto; padding: 2.5rem 1.25rem 4rem; }
.screen h1 { font-size: 2.1rem; color: var(--lobby); }
.screen-lead { max-width: 60ch; margin: 0.4rem 0 1.75rem; color: var(--ink-soft); }

.panel {
  padding: 1.25rem 1.5rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.panel + .panel { margin-top: 1rem; }
.panel h2 { margin-bottom: 0.6rem; font-size: 1.3rem; }
.panel p { margin: 0; max-width: 70ch; }

.link-list { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1rem; }

/* Menu check on the bar & restaurant screen */
.menu-group + .menu-group { margin-top: 1.25rem; }
.menu-group h3 {
  margin-bottom: 0.25rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--lobby);
}
.menu-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line);
}
.menu-row:last-child { border-bottom: 0; }
.price { font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--ink-soft); }

@media (max-width: 480px) {
  .key-tag { padding: 5.75rem 1.4rem 1.9rem; }
  .key-tag-name { font-size: 1.6rem; }
  .screen h1 { font-size: 1.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  .key-tag { animation: none; }
}
