/* ============================================================
   Kiosk overlay: web timer bar (replaces the retired tkinter
   TimerBar). Fixed top strip rendered inside the Tauri webview.
   Reuses the brand tokens defined in style.css :root. No new
   colors are introduced here.
   ============================================================ */

/* ── Fixed top strip ───────────────────────────────────────── */
#kiosk-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;   /* same stacking slot the retired .timer-bar-stub used */
}

.kiosk-bar {
  height: var(--timer-bar-h);
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--surface-border);
  color: var(--text);
  font-size: 13px;
  letter-spacing: 0.02em;
  user-select: none;
  overflow: hidden;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

/* While the shell shows only the 40px strip, the page behind the bar must not
   scroll: the shrunken viewport otherwise grows scrollbars whose arrow caps
   paint inside the bar. kiosk_overlay.js toggles this class in requestMode. */
html.kiosk-strip-mode,
html.kiosk-strip-mode body {
  overflow: hidden !important;
}

.kiosk-brand {
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  white-space: nowrap;
}

.kiosk-seg {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.kiosk-cap {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin-right: 4px;
}

.kiosk-notice {
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--warn);
  white-space: nowrap;
}

.kiosk-notice:empty {
  display: none;
}

/* ── Session buttons (Plan 6) ─────────────────────────────────
   Shown only while status == "active" (kiosk_overlay.js renderTimerBar).
   28 px tall inside the 40 px bar, 96 px wide: above the 24 x 24 pointer
   target floor. Labels are 12 px, not large text, so they need 4.5:1:
   slate ground / white text for the solid button, slate text with the
   teal border for the ghost; the warning bar inverts to white / red
   (5.44:1). */
.kiosk-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.kiosk-notice:not(:empty) + .kiosk-actions {
  margin-left: 12px;
}

.kiosk-btn {
  height: 28px;
  min-width: 96px;
  padding: 0 12px;
  border: 1px solid var(--text);
  border-radius: var(--radius-sm);
  background: var(--text);
  color: var(--on-accent);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
}

.kiosk-btn--ghost {
  border-color: var(--accent);
  background: transparent;
  color: var(--text);
}

.kiosk-btn:hover {
  border-color: var(--accent);
}

.kiosk-btn:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.kiosk-bar--warning .kiosk-btn {
  border-color: var(--on-accent);
  background: var(--on-accent);
  color: var(--danger);
}

.kiosk-bar--warning .kiosk-btn--ghost {
  color: var(--on-accent);
}

.kiosk-bar--warning .kiosk-btn:focus-visible {
  outline-color: var(--on-accent);
}

/* ── Warning state: <= 2 min headroom, no successful reauth ── */
.kiosk-bar--warning {
  background: var(--danger);
  border-bottom-color: var(--danger);
  color: var(--on-accent);
}

.kiosk-bar--warning .kiosk-brand,
.kiosk-bar--warning .kiosk-cap,
.kiosk-bar--warning .kiosk-seg {
  color: var(--on-accent);
}

.kiosk-bar--warning .kiosk-notice {
  color: var(--on-accent);
}

/* ── Reauth / print modal roots (Tasks 6 and 7 fill these in) ── */
.kiosk-modal {
  position: fixed;
  inset: 0;
  z-index: 1050;   /* above the bar (1000), below the extend-confirm overlay (1100) */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--scrim);
}

/* ── Reauth modal (Task 6): #kiosk-reauth content ──────────────
   Matches the existing extend-confirm overlay (.extend-modal /
   .extend-actions in style.css): teal primary "Yes", muted secondary
   "No", same card/scrim/radius tokens. No new colors introduced. */
.kiosk-modal-card {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow), 0 0 0 1px var(--accent-dim2);
  padding: 32px 32px 28px;
  text-align: center;
}

.kiosk-modal-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 12px;
}

.kiosk-modal-card--confirm .kiosk-modal-title {
  color: var(--accent);
  margin-bottom: 0;
}

.kiosk-modal-body {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 22px;
}

.kiosk-modal-count {
  display: inline-block;
  min-width: 1.4em;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.kiosk-modal-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.kiosk-modal-actions .btn-large {
  flex: 1;
  min-width: 160px;
}

/* ── Print-confirm modal (Task 7): #kiosk-print content ────────
   Same card/scrim/radius tokens as the reauth modal above (#kiosk-reauth):
   .kiosk-modal-card / .kiosk-modal-title / .kiosk-modal-actions are shared,
   so Pay & Print (.btn-primary, teal) and Cancel (.btn-secondary, muted)
   already match without any new color introduced here. .error-banner is the
   existing danger-toned banner from style.css, reused for "Card declined"
   and other charge-failure copy. */
.kiosk-print-doc {
  font-size: 14px;
  color: var(--text-dim);
  margin: -4px 0 18px;
  word-break: break-word;
}

.kiosk-print-card .error-banner {
  text-align: left;
  margin: 0 0 18px;
}

/* The HTML `hidden` attribute must win over the `display: flex` above (see
   the CLAUDE.md gotcha). style.css already carries the global guard
   ([hidden] { display: none !important }); this local copy keeps the
   overlay CSS self-contained even if it is ever loaded before style.css. */
[hidden] { display: none !important; }
