/* Tollvera pay.tollvera.com — mobile-first, monochrome + red accent #E63946 */

:root {
  --fg: #111111;
  --fg-secondary: #555555;
  --muted: #8a8a8e;
  --bg: #ffffff;
  --bg-soft: #f6f6f7;
  --border: #e4e4e6;
  --accent: #E63946;
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font);
  color: var(--fg);
  background: var(--bg-soft);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 440px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.screen {
  display: none;
  flex-direction: column;
  padding: 28px 22px calc(28px + env(safe-area-inset-bottom));
  flex: 1;
}
.screen.is-visible { display: flex; }

/* ── Brand ─────────────────────────────────────────────────────────── */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}
.brand-logo {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: block;
  box-shadow: 0 0 0 1px var(--border);
}
.brand-name { font-weight: 600; font-size: 17px; letter-spacing: -0.01em; }

/* ── Location card ─────────────────────────────────────────────────── */
.location-card { margin-bottom: 26px; }
.operator-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.operator-row .location-kicker { margin-bottom: 0; }
.operator-logo {
  width: 26px; height: 26px;
  border-radius: 6px;
  display: block;
}
.location-kicker {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
}
.location-name {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.location-address { font-size: 14px; margin-top: 6px; }

/* ── Form ──────────────────────────────────────────────────────────── */
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-secondary);
  margin-bottom: 8px;
}
.optional { font-weight: 400; color: var(--muted); }
.field input {
  width: 100%;
  font: inherit;
  font-size: 17px;
  padding: 14px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  outline: none;
  transition: border-color 0.15s ease;
}
.field input:focus { border-color: #000; }
.field input::placeholder { color: #b9b9be; }

.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

/* hours stepper */
.hours-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
}
.hours-btn {
  width: 46px; height: 46px;
  border: none;
  border-radius: 10px;
  background: var(--bg-soft);
  font-size: 24px;
  font-weight: 500;
  color: var(--fg);
  cursor: pointer;
  touch-action: manipulation;
}
.hours-btn:active { background: #eaeaec; }
.hours-value {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Stripe Payment Element */
.payment-element {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 12px 6px;
  min-height: 44px;
  background: var(--bg);
}

/* pay button */
.pay-button {
  width: 100%;
  margin-top: 6px;
  padding: 17px;
  border: none;
  border-radius: var(--radius);
  background: #000;
  color: #fff;
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  transition: opacity 0.15s ease;
}
.pay-button:disabled { opacity: 0.35; cursor: not-allowed; }
.pay-button:not(:disabled):active { opacity: 0.85; }
.pay-button .amount { font-variant-numeric: tabular-nums; }

/* ── Ticket scan ───────────────────────────────────────────────────── */
.scan-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  border: 1.5px dashed #000;
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--fg);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
}
.scan-button:active { background: var(--bg-soft); }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  color: var(--muted);
  font-size: 12px;
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* scanner screen */
.screen-scan { gap: 18px; }
.scan-header { text-align: center; }
.scan-title { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 4px; }
.scan-subtitle { font-size: 13.5px; }
.scan-viewport {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 3 / 4;
}
.scan-viewport video {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.scan-reticle {
  position: absolute;
  inset: 12% 10%;
  border: 2px solid rgba(255,255,255,0.9);
  border-radius: 14px;
  box-shadow: 0 0 0 999px rgba(0,0,0,0.35);
  pointer-events: none;
}
.scan-status {
  position: absolute;
  left: 0; right: 0; bottom: 12px;
  text-align: center;
  color: #fff;
  font-size: 13px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}
.scan-cancel {
  border: none;
  background: none;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
  padding: 14px;
  cursor: pointer;
}
.scan-cancel:active { opacity: 0.6; }

/* powered-by footer (done screen) */
.powered-by {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 22px;
  font-size: 12px;
  color: var(--muted);
}
.powered-by img { border-radius: 3px; }

/* ── Feedback ──────────────────────────────────────────────────────── */
.muted { color: var(--muted); }
.error { color: var(--accent); font-size: 14px; margin-bottom: 12px; }
.error-title { font-size: 22px; font-weight: 700; margin-bottom: 10px; }

.spinner {
  width: 34px; height: 34px;
  border: 3px solid var(--border);
  border-top-color: #000;
  border-radius: 50%;
  margin: 40px auto 18px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

#screen-loading, #screen-processing, #screen-error {
  align-items: center;
  justify-content: center;
  text-align: center;
}
#screen-loading .brand, #screen-processing .brand, #screen-error .brand {
  justify-content: center;
}
#screen-error p { max-width: 320px; }

/* ── Success ───────────────────────────────────────────────────────── */
#screen-done { align-items: stretch; padding-top: 56px; }
.done-icon { display: flex; justify-content: center; margin-bottom: 18px; }
.done-title {
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 28px;
}

.receipt {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 22px;
}
.receipt > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
}
.receipt > div:last-child { border-bottom: none; }
.receipt dt { font-size: 13px; color: var(--muted); flex-shrink: 0; }
.receipt dd { font-size: 15px; font-weight: 500; text-align: right; }
.receipt .receipt-total { background: var(--bg-soft); }
.receipt .receipt-total dd { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }

.done-note { text-align: center; font-size: 13.5px; margin-bottom: 26px; }

.app-upsell {
  display: block;
  text-align: center;
  font-size: 14px;
  color: var(--fg);
  background: var(--bg-soft);
  border-radius: var(--radius);
  padding: 15px 16px;
  text-decoration: none;
}
.app-upsell:active { background: #eeeef0; }

@media (min-width: 480px) {
  body { padding: 24px 0; }
  .page {
    min-height: auto;
    border-radius: 20px;
    border: 1px solid var(--border);
    box-shadow: 0 12px 40px rgba(0,0,0,0.08);
  }
}
