/* PASNESER guest app — design system (vanilla CSS, no Tailwind) */

/* Reset & base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
}

#app {
  min-height: calc(100dvh - var(--devbar-h, 0px)); /* the dev bar (?mock=1) takes room at the bottom instead of covering the buttons */
}

/* Type scale */
.t-display { font-size: 2rem; font-weight: 600; line-height: 1.2; }
.t-title { font-size: 1.5rem; font-weight: 600; line-height: 1.2; }
.t-body { font-size: 1.0625rem; font-weight: 400; line-height: 1.5; }
.t-small { font-size: 0.875rem; font-weight: 400; line-height: 1.4; }
.t-muted { color: var(--text-muted); }

/* Screen container */
.screen {
  min-height: calc(100dvh - var(--devbar-h, 0px));
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.screen__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.25rem;
  gap: 1.5rem;
}

.screen__content--centered {
  justify-content: center;
  align-items: center;
  text-align: center;
}

.screen__footer {
  padding: 0.75rem 1.25rem 1.5rem;
  padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.card--lg {
  border-radius: var(--radius-lg);
  padding: 1.75rem;
}

/* Buttons */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: var(--tap-min);
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 1.0625rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  padding: 0.875rem 1.25rem;
  transition: opacity 0.15s, transform 0.1s;
  text-align: center;
}

.btn:active { transform: scale(0.98); }

.btn--primary { background: var(--brand); color: var(--on-brand); }
.btn--secondary { background: transparent; color: var(--brand-text); border: 1px solid var(--border); }
.btn--ghost { background: transparent; color: var(--brand-text); border: none; }
.btn--danger { background: var(--danger); color: var(--surface); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Round icon button */
.btn-round {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: var(--tap-min);
  min-height: var(--tap-min);
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--brand-text);
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  flex-shrink: 0;
}

.btn-round:active { transform: scale(0.95); }
.btn-round--primary { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.btn-round--lg { min-width: 3.75rem; min-height: 3.75rem; }

/* Input */
.input {
  width: 100%;
  min-height: var(--tap-min);
  padding: 0.875rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.25rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  outline: none;
  transition: border-color 0.15s;
}

.input:focus { border-color: var(--brand); }
.input::placeholder { color: var(--text-muted); text-transform: none; letter-spacing: normal; font-weight: 400; }

/* Status row */
.status-row {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}

.status-row__icon { flex-shrink: 0; width: 1.5rem; height: 1.5rem; }
.status-row__text { font-size: 1rem; font-weight: 400; flex: 1; }
.status-row--ok { border-color: var(--ok); }
.status-row--ok .status-row__icon { color: var(--ok); }
.status-row--warn { border-color: var(--warn); }
.status-row--warn .status-row__icon { color: var(--warn); }
.status-row--danger { border-color: var(--danger); }
.status-row--danger .status-row__icon { color: var(--danger); }

/* Alert / error block */
.alert {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem;
  border-radius: var(--radius);
  background: var(--danger-soft);
  border: 1px solid var(--danger);
}

.alert__text { color: var(--text); font-size: 1.0625rem; font-weight: 400; line-height: 1.5; }
.alert__icon { color: var(--danger); flex-shrink: 0; }

/* Progress bar */
.progress-bar { width: 100%; height: 0.5rem; background: var(--border); border-radius: 999px; overflow: hidden; }
.progress-bar__fill { height: 100%; background: var(--brand); border-radius: 999px; transition: width 0.3s ease; }

/* Progress ring */
.progress-ring { width: 6rem; height: 6rem; transform: rotate(-90deg); }
.progress-ring__circle { fill: none; stroke-width: 6; stroke-linecap: round; }
.progress-ring__track { stroke: var(--border); }
.progress-ring__fill { stroke: var(--brand); transition: stroke-dashoffset 0.3s ease; }

/* Hotel logo */
.hotel-logo {
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  object-fit: cover;
  background: var(--brand-soft);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--brand-text);
  overflow: hidden;
}

.hotel-logo--sm { width: 2rem; height: 2rem; font-size: 0.75rem; border-width: 1px; }
.hotel-logo img { width: 100%; height: 100%; object-fit: cover; }

/* Walking header */
.walk-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  padding-top: max(0.75rem, env(safe-area-inset-top));
}

/* Instruction text */
.instruction { font-size: 2rem; font-weight: 600; line-height: 1.2; padding: 0 0.25rem; }

/* Bottom action bar */
.action-bar {
  display: flex;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  padding: 1rem 1.25rem;
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

/* Overlay */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 100;
  padding: 2rem 1.25rem;
  text-align: center;
}

.overlay--black { background: #000; color: #fff; } /* Pocket Mode is black by definition */
.overlay__text { color: #fff; font-size: 1.25rem; font-weight: 600; }
.overlay__hint { color: rgba(255,255,255,0.6); font-size: 1rem; margin-top: 0.5rem; }

/* Bottom sheet */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: flex;
  align-items: flex-end;
}

.sheet {
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%;
  max-height: 85dvh;
  overflow-y: auto;
  padding: 1.5rem 1.25rem;
  padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sheet__handle { width: 2.5rem; height: 0.25rem; background: var(--border); border-radius: 999px; margin: 0 auto 0.5rem; flex-shrink: 0; }

/* Notices */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius);
  background: var(--warn-soft);
  border: 1px solid var(--warn);
  font-size: 0.9375rem;
  line-height: 1.4;
}

.notice__icon { color: var(--warn); flex-shrink: 0; margin-top: 0.125rem; }

/* Off route arrow */
.route-arrow { width: 5rem; height: 5rem; color: var(--brand-text); }

/* Footer link */
.footer-link {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: var(--tap-min);
  padding: 0.75rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  font-family: var(--font);
}

.footer-link:active { opacity: 0.6; }

/* Postcard */
.postcard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: center;
}

.postcard__route { width: 100%; max-width: 16rem; color: var(--brand-text); }
.postcard__route svg { width: 100%; height: auto; color: var(--brand-text); }

.postcard__stats { display: flex; gap: 1.5rem; flex-wrap: wrap; justify-content: center; }
.postcard__stat { text-align: center; }
.postcard__stat-value { font-size: 1.5rem; font-weight: 600; color: var(--brand-text); }
.postcard__stat-label { font-size: 0.8125rem; color: var(--text-muted); margin-top: 0.25rem; }

/* Missed list */
.missed-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.missed-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
}
.missed-item:active { background: var(--brand-soft); }
.missed-item__title { font-size: 1rem; font-weight: 400; }
.missed-item__icon { color: var(--brand-text); flex-shrink: 0; }

/* Report choices */
.report-choice {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: var(--tap-min);
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-size: 1rem;
  font-family: var(--font);
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
  width: 100%;
  text-align: left;
}

.report-choice:active, .report-choice--selected {
  border-color: var(--brand);
  background: var(--brand-soft);
}

/* Textarea */
.textarea {
  width: 100%;
  min-height: 5rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
}

.textarea:focus { border-color: var(--brand); }

/* Dev bar */
.devbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 150; /* below the sheets (200): an open sheet is never covered */
  background: #1a1a2e;
  color: #eee;
  border-top: 1px solid #333;
  font-size: 0.8125rem;
}

.devbar__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem;
  cursor: pointer;
  width: 100%;
  border: none;
  background: #1a1a2e;
  color: #eee;
  font-family: var(--font);
  font-size: 0.8125rem;
}

.devbar__panel {
  padding: 0.75rem 1rem 1rem;
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.devbar__row { display: flex; align-items: center; gap: 0.5rem; }
.devbar__label { flex-shrink: 0; min-width: 3.5rem; color: #999; }

.devbar select {
  flex: 1;
  min-height: 2rem;
  background: #2a2a3e;
  color: #eee;
  border: 1px solid #444;
  border-radius: 0.375rem;
  padding: 0.25rem 0.5rem;
  font-family: var(--font);
  font-size: 0.8125rem;
}

.devbar__hint { color: #888; font-size: 0.75rem; line-height: 1.4; padding-top: 0.25rem; }
.devbar__hint code { background: #2a2a3e; padding: 0.125rem 0.375rem; border-radius: 0.25rem; font-size: 0.75rem; }

/* Animations */
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-up { from { transform: translateY(1rem); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slide-up-sheet { from { transform: translateY(100%); } to { transform: translateY(0); } }

.animate-fade { animation: fade-in 0.2s ease-out; }
.animate-slide-up { animation: slide-up 0.2s ease-out; }
.animate-sheet { animation: slide-up-sheet 0.25s ease-out; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Utility */
.flex-col { display: flex; flex-direction: column; }
.flex-row { display: flex; flex-direction: row; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.text-center { text-align: center; }
.w-full { width: 100%; }
.mt-auto { margin-top: auto; }

/* Additions (accent icons, recovery code, menu, pocket overlay) */
.icon-accent { color: var(--brand-text); display: inline-flex; }
.recovery-code { font-size: 2rem; font-weight: 700; letter-spacing: 0.1em; color: var(--brand-text); margin-top: 0.5rem; word-break: break-all; }
.menu-item { display: flex; align-items: center; gap: 0.75rem; text-align: left; }
.hotel-logo--center { margin: 0 auto; }
.overlay__icon { opacity: 0.4; }

/* Start-up timing (?timing=1) */
.timing { position: fixed; left: 0.5rem; right: 0.5rem; bottom: 0.5rem; z-index: 300; margin: 0; padding: 0.5rem 0.75rem; font: 0.75rem/1.4 ui-monospace, monospace; white-space: pre-wrap; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); }
