/* Visitor check-in kiosk (iPad). Separate from main.css: this page is for visitors, not IT. */
:root {
  --bg: #f6f8f9;
  --surface: #ffffff;
  --text: #15191c;
  --muted: #5d6b73;
  --border: #d5dde1;
  --accent: #0f7385;
  --accent-hover: #0b5f6e;
  --accent-soft: #e3f2f5;
  --error-bg: #fdf0ef;
  --error-text: #a3271b;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(16, 24, 28, 0.06), 0 4px 16px rgba(16, 24, 28, 0.06);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overscroll-behavior: none;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.kiosk {
  position: relative;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) max(24px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(24px, env(safe-area-inset-left));
}

/* Top bar */
.k-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 20px 0 8px;
}

.k-back,
.k-cancel {
  min-height: 56px;
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  font-size: 20px;
  color: var(--muted);
}

.k-back {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding-left: 8px;
}

.k-back svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.k-cancel {
  justify-self: end;
}

.k-back:active,
.k-cancel:active {
  background: var(--border);
}

.k-dots {
  display: flex;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.k-dots li {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.2s, width 0.2s;
}

.k-dots li.is-done {
  background: var(--accent);
}

.k-dots li.is-current {
  width: 28px;
  border-radius: 5px;
  background: var(--accent);
}

/* Steps */
.k-step {
  display: none;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 0 48px;
}

.k-step.is-active {
  display: flex;
  animation: k-in 0.28s ease-out;
}

.k-step.is-back {
  animation-name: k-in-back;
}

@keyframes k-in {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: none; }
}

@keyframes k-in-back {
  from { opacity: 0; transform: translateX(-40px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .k-step.is-active {
    animation: none;
  }
}

h1 {
  margin: 0 0 16px;
  font-size: clamp(36px, 5.5vw, 52px);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h2 {
  margin: 0 0 28px;
  font-size: clamp(30px, 4.4vw, 42px);
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.k-lead {
  margin: 0 0 40px;
  font-size: 24px;
  line-height: 1.4;
  color: var(--muted);
}

.k-hint {
  margin: -16px 0 20px;
  font-size: 20px;
  color: var(--muted);
}

.k-fine {
  margin: 16px 0 0;
  font-size: 16px;
  color: var(--muted);
  text-align: center;
}

.k-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* Welcome: greeting on one side, the office globe on the other (stacked in portrait) */
.k-welcome,
.k-done {
  align-items: center;
  text-align: center;
}

.k-welcome {
  max-width: 1240px;
  padding-top: 56px;
}

.k-welcome.is-active {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  align-items: center;
  gap: 24px;
}

.k-welcome-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1;
}

.k-welcome.no-globe.is-active {
  grid-template-columns: 1fr;
}

@media (orientation: portrait), (max-width: 860px) {
  .k-welcome.is-active {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .k-globe {
    order: -1;
  }
}

.k-logo {
  width: min(260px, 50vw);
  height: auto;
  margin-bottom: 36px;
}

.k-hello-wrap {
  margin: 0;
  height: 1.15em;
  font-size: clamp(52px, 7.5vw, 88px);
  line-height: 1.15;
  overflow: hidden;
}

.k-hello {
  display: inline-block;
  background: linear-gradient(100deg, var(--text) 0%, var(--accent) 55%, #3fb6c8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.k-hello.is-out {
  animation: k-hello-out 0.45s ease-in forwards;
}

.k-hello.is-in {
  animation: k-hello-in 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

@keyframes k-hello-out {
  to { opacity: 0; transform: translateY(-60%); filter: blur(6px); }
}

@keyframes k-hello-in {
  from { opacity: 0; transform: translateY(60%); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: none; }
}

.k-where {
  margin: 4px 0 20px;
  font-size: clamp(26px, 3.2vw, 34px);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.k-welcome .k-lead {
  max-width: 460px;
  margin-bottom: 32px;
}

/* The globe */
.k-globe {
  position: relative;
  width: min(100%, 72vh);
  aspect-ratio: 1;
  margin: 0 auto;
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 1.2s ease, transform 1.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (orientation: portrait), (max-width: 860px) {
  .k-globe {
    width: min(78vw, 46vh);
  }
}

.k-globe.is-ready {
  opacity: 1;
  transform: none;
}

.k-globe canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.k-city {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  padding: 10px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 24px rgba(15, 115, 133, 0.18);
  backdrop-filter: blur(6px);
  white-space: nowrap;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 22px));
  animation: k-city-in 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.3);
}

.k-city b {
  font-size: 20px;
}

.k-city span {
  font-size: 15px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

@keyframes k-city-in {
  from { opacity: 0; transform: translate(-50%, calc(-100% - 6px)) scale(0.85); }
}

.k-globe-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3%;
  margin: 0;
  padding: 0 8%;
  white-space: pre-line;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--accent-hover);
  text-align: center;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.k-globe-caption.is-shown {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .k-hello.is-in,
  .k-hello.is-out,
  .k-city {
    animation: none;
  }
}

/* Buttons */
.k-btn {
  align-self: stretch;
  min-height: 72px;
  margin-top: 28px;
  padding: 0 32px;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-size: 24px;
  font-weight: 600;
  transition: background 0.15s, transform 0.1s, opacity 0.15s;
}

.k-btn:active {
  background: var(--accent-hover);
  transform: scale(0.98);
}

.k-btn:disabled {
  opacity: 0.35;
  cursor: default;
  transform: none;
}

.k-btn-hero {
  align-self: center;
  min-width: min(420px, 100%);
  min-height: 88px;
  font-size: 28px;
  border-radius: 999px;
}

.k-btn-quiet {
  align-self: center;
  min-width: 240px;
  background: var(--surface);
  color: var(--text);
  box-shadow: inset 0 0 0 2px var(--border);
}

.k-btn-quiet:active {
  background: var(--border);
}

/* Tiles */
.k-tiles {
  display: grid;
  gap: 16px;
}

.k-tiles-2 {
  grid-template-columns: repeat(2, 1fr);
}

.k-tiles-3 {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 700px) {
  .k-tiles-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.k-tile {
  min-height: 112px;
  padding: 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.25;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}

.k-tile:active {
  transform: scale(0.97);
}

.k-tile[aria-checked="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.k-reveal {
  display: flex;
  flex-direction: column;
  margin-top: 28px;
}

/* Inputs */
.k-fields {
  display: grid;
  gap: 20px;
}

.k-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.k-field span {
  font-size: 18px;
  font-weight: 600;
  color: var(--muted);
}

.k-field input {
  width: 100%;
  min-height: 76px;
  padding: 0 22px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 28px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.k-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

/* Host suggestions */
.k-suggest {
  margin: 12px 0 0;
  padding: 6px;
  list-style: none;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.k-suggest li {
  display: flex;
  align-items: center;
  min-height: 64px;
  padding: 0 18px;
  border-radius: 12px;
  font-size: 24px;
  cursor: pointer;
}

.k-suggest li:active,
.k-suggest li[aria-selected="true"] {
  background: var(--accent-soft);
}

.k-suggest mark {
  background: none;
  color: var(--accent);
  font-weight: 700;
}

/* Review */
.k-summary {
  margin: 0;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.k-summary button {
  display: grid;
  grid-template-columns: 200px 1fr auto;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 68px;
  padding: 12px 24px;
  border: 0;
  border-top: 1px solid var(--border);
  background: none;
  text-align: left;
  font-size: 22px;
}

.k-summary button:first-child {
  border-top: 0;
}

.k-summary button:active {
  background: var(--accent-soft);
}

.k-summary .k-label {
  color: var(--muted);
  font-size: 18px;
}

.k-summary .k-value {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.k-summary .k-edit {
  color: var(--accent);
  font-size: 18px;
  font-weight: 600;
}

.k-privacy {
  margin-top: 20px;
  font-size: 18px;
  color: var(--muted);
}

.k-privacy summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
}

.k-privacy p {
  margin: 8px 0 0;
  line-height: 1.5;
}

.k-error {
  margin: 20px 0 0;
  padding: 16px 20px;
  border-radius: 14px;
  background: var(--error-bg);
  color: var(--error-text);
  font-size: 20px;
}

/* Done */
.k-check {
  width: 120px;
  height: 120px;
  margin-bottom: 32px;
}

.k-check svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.k-check circle {
  fill: var(--accent-soft);
  stroke-dasharray: 151;
  animation: k-draw 0.5s ease-out both;
}

.k-check path {
  stroke-width: 4;
  stroke-dasharray: 40;
  animation: k-draw 0.35s 0.35s ease-out both;
}

@keyframes k-draw {
  from { stroke-dashoffset: 151; }
  to { stroke-dashoffset: 0; }
}

@media (max-width: 600px) {
  .k-summary button {
    grid-template-columns: 1fr auto;
  }

  .k-summary .k-label {
    grid-column: 1 / -1;
  }
}

/* Kiosk: "you're expected" screen and the welcome clock */
.k-clock {
  position: absolute;
  top: max(20px, env(safe-area-inset-top));
  right: max(28px, env(safe-area-inset-right));
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.k-expected {
  align-items: center;
  text-align: center;
}

.k-expected-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px 24px;
  margin: 0 0 8px;
  padding: 24px 32px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 22px;
  text-align: left;
}

.k-expected-card dt {
  color: var(--muted);
}

.k-expected-card dd {
  margin: 0;
  font-weight: 600;
}

.k-link {
  margin-top: 20px;
  min-height: 56px;
  padding: 0 20px;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 20px;
  font-weight: 600;
}

.k-btn.is-busy {
  opacity: 0.6;
}

/* Staff page (/visitors): laptop and reception iPad */
body.staff {
  min-height: 100%;
}

.s-bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
}

.s-logo {
  height: 22px;
  width: auto;
}

.s-bar h1 {
  margin: 0 auto 0 0;
  font-size: 20px;
  letter-spacing: 0;
}

.s-offices {
  display: flex;
  padding: 4px;
  border-radius: 12px;
  background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--border);
}

.s-offices button {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  background: none;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
}

.s-offices button[aria-selected="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(16, 24, 28, 0.12);
}

.s-kiosk-link {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.s-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 24px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px;
}

@media (max-width: 960px) {
  .s-main {
    grid-template-columns: 1fr;
  }
}

.s-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

.s-col-side {
  align-self: start;
  position: sticky;
  top: 88px;
}

@media (max-width: 960px) {
  .s-col-side {
    position: static;
  }
}

.s-card {
  padding: 22px 24px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.s-card h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0;
}

.s-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.s-sub {
  margin: 4px 0 0;
  font-size: 15px;
  color: var(--muted);
}

.s-empty {
  margin: 8px 0 0;
  font-size: 15px;
  color: var(--muted);
}

.s-day {
  margin: 18px 0 4px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.s-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.s-visit {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}

.s-list > .s-visit:first-child {
  border-top: 0;
}

.s-time {
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.s-who {
  min-width: 0;
}

.s-name {
  font-size: 17px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.s-meta {
  margin-top: 2px;
  font-size: 14px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.s-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.s-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.s-pill-arrived {
  background: #e6f4ea;
  color: #1e6b34;
}

.s-pill-expected {
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.s-pill-late {
  background: #fff4e0;
  color: #8a4b00;
}

.s-pill-cancelled {
  background: var(--bg);
  color: var(--muted);
}

.s-tag {
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--bg);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  vertical-align: 2px;
}

.s-visit.is-cancelled .s-name {
  text-decoration: line-through;
  color: var(--muted);
}

.s-btn {
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}

.s-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.s-btn-primary {
  background: var(--accent);
  color: #fff;
}

.s-btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.s-btn-ghost {
  background: none;
  color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--border);
}

.s-btn-ghost:hover:not(:disabled) {
  background: var(--bg);
  color: var(--text);
}

/* Register form */
.s-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.s-form .s-sub {
  margin: -8px 0 4px;
}

.s-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.s-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.s-field span {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.s-field em {
  font-style: normal;
  font-weight: 400;
}

.s-field input,
.s-field select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  outline: none;
}

.s-field input:focus,
.s-field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.s-form .s-btn-primary {
  min-height: 48px;
  font-size: 16px;
}

.s-error {
  margin: 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--error-bg);
  color: var(--error-text);
  font-size: 15px;
}

.s-done {
  padding: 12px 14px;
  border-radius: 10px;
  background: #e6f4ea;
  color: #1e6b34;
  font-size: 15px;
  line-height: 1.45;
}

.s-fine {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

.s-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 3;
  transform: translateX(-50%);
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--text);
  color: #fff;
  font-size: 15px;
  box-shadow: var(--shadow);
}

@media (max-width: 600px) {
  .s-main {
    padding: 16px;
  }

  .s-visit {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .s-actions {
    grid-column: 2;
  }

  .s-logo {
    display: none;
  }
}

/* Staff: who is signed in */
.s-me {
  font-size: 14px;
  color: var(--muted);
}

.s-me a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

/* Sign-in page */
.g-main {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px 16px;
}

.g-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 420px;
  padding: 32px;
}

.g-card h1 {
  margin: 0;
  font-size: 28px;
}

.g-card #g-email-step,
.g-card #g-code-step {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.g-logo {
  width: 150px;
  height: auto;
}

.g-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 15px;
  color: var(--muted);
  cursor: pointer;
}

.g-check input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--accent);
}

.g-btn {
  min-height: 48px;
  font-size: 16px;
}

.g-code {
  font-size: 28px !important;
  font-weight: 700;
  letter-spacing: 0.4em;
  text-align: center;
}

/* Groups */
.k-add-person {
  align-self: center;
}

.k-exp-group {
  max-width: 560px;
  margin: 16px 0 0;
  font-size: 20px;
}

.k-expected .k-btn + .k-btn {
  margin-top: 16px;
}

.s-tag-group {
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.s-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  font-size: 16px;
  resize: vertical;
  outline: none;
}

.s-field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
