/* Label Scanner — internal tool for Glossier front desk / receiving.
 * Tokens and patterns follow the Glossier Brand Book 2025 digital spec
 * (see glossier-tokens.css). Pink is primary; black and white are the
 * accents; CTA blue is the sole functional accent, used only for buttons
 * and links. Color never encodes app state — no red/green status colors.
 *
 * Apercu is licensed from Colophon Foundry and not bundled here; confirm
 * the license covers web embedding before shipping. The fallback stack
 * below is a stopgap and won't match Apercu's proportions.
 */

:root {
  /* ---- Core palette ---- */
  --g-pink-light: #FAF2F4;   /* backgrounds carrying black text */
  --g-pink: #F8E6EA;         /* general pink field */
  --g-black: #000000;        /* all text — pure black, never gray */
  --g-white: #FFFFFF;

  /* ---- Secondary / accent — used sparingly ---- */
  --g-cta-blue: #0600FF;     /* main digital accent: links, primary buttons */
  --g-gray-shopgrid: #F7F7F7;
  --g-gray: #E3E3E3;         /* secondary buttons against white */

  --text-primary: var(--g-black);
  --text-secondary: rgba(0, 0, 0, 0.62);
  --border: rgba(0, 0, 0, 0.14);

  /* ---- Type ---- */
  --g-font: "Apercu Pro", "Apercu", ui-sans-serif, system-ui, -apple-system,
            "Helvetica Neue", Arial, sans-serif;
  --g-font-mono: "Apercu Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --g-weight-regular: 400;
  --g-weight-medium: 500;
  --g-weight-bold: 700;

  /* Leading: 133.3% for sentence-case body, 100% for uppercase display. */
  --g-leading-body: 1.333;
  --g-leading-display: 1;

  /* Tracking: body sits at 0; uppercase bold is tracked out ~0.02em. */
  --g-tracking-display: 0.02em;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--g-pink-light);
  color: var(--text-primary);
  font-family: var(--g-font);
  font-weight: var(--g-weight-regular);
  line-height: var(--g-leading-body);
}

.topbar {
  background: var(--g-white);
  border-bottom: 1px solid var(--border);
  padding: 20px 24px;
}

.topbar-inner {
  max-width: 640px;
  margin: 0 auto;
}

.admin-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-link {
  text-decoration: none;
}

.header-links {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 28px;
  height: 28px;
  /* G logo clearspace ~= its stroke width; the surrounding flex gap covers it */
}

.brand-eyebrow {
  font-family: var(--g-font-mono);
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

/* Display headline: Apercu Bold, uppercase, tracked out, tight leading —
 * the brand's dominant headline treatment. */
.brand-title {
  margin: 2px 0 0;
  font-size: 1.375rem;
  font-weight: var(--g-weight-bold);
  text-transform: uppercase;
  line-height: var(--g-leading-display);
  letter-spacing: var(--g-tracking-display);
}

.page {
  max-width: 640px;
  margin: 24px auto;
  padding: 0 24px 48px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Cards stay square-cornered and text-forward — the utilitarian half of
 * the brand's "balance of opposites." */
.card {
  background: var(--g-white);
  border: 1px solid var(--border);
  padding: 20px;
}

.scanner-identity-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.scanner-identity-card input {
  font-family: var(--g-font);
  font-size: 0.9375rem;
  padding: 10px;
  border: 1px solid var(--border);
  color: var(--g-black);
}

/* Shopgrid Gray is the brand's own backdrop for product photography —
 * a fitting idle state for a camera frame. It's never visible once the
 * live feed starts, since the video covers the stage completely. */
.camera-stage {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--g-gray-shopgrid);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.camera-stage video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-placeholder {
  color: var(--g-black);
  text-align: center;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.camera-placeholder[hidden] {
  display: none;
}

#signin-required p {
  margin: 0 0 16px;
}

.scan-greeting {
  margin: 0 0 16px;
  font-size: 1rem;
  font-weight: var(--g-weight-medium);
}

.whoami-label {
  display: flex;
  align-items: center;
  font-family: var(--g-font-mono);
  font-size: 0.8125rem;
}

.whoami-label[hidden] {
  display: none;
}

.scan-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.status {
  margin-top: 12px;
  font-family: var(--g-font-mono);
  font-size: 0.8125rem;
  color: var(--text-secondary);
  min-height: 18px;
}

/* Buttons: square-cornered, text-forward. CTA blue is the primary digital
 * accent; gray is the alternate against white. */
.g-button, .g-button-secondary {
  font-family: var(--g-font);
  font-weight: var(--g-weight-regular);
  font-size: 0.875rem;
  border-radius: 0;
  padding: 0.875rem 1.75rem;
  cursor: pointer;
  border: 1px solid transparent;
}

.g-button {
  background: var(--g-cta-blue);
  color: var(--g-white);
}

.g-button:disabled {
  background: var(--g-gray);
  color: var(--text-secondary);
  cursor: default;
}

.g-button-secondary {
  background: var(--g-gray);
  color: var(--g-black);
}

.results-card h2 {
  font-family: var(--g-font-mono);
  font-size: 0.8125rem;
  font-weight: var(--g-weight-regular);
  text-transform: uppercase;
  letter-spacing: var(--g-tracking-display);
  margin: 0 0 8px;
}

.results-card h2:not(:first-child) {
  margin-top: 24px;
}

#ocr-text {
  width: 100%;
  font-family: var(--g-font);
  font-size: 0.875rem;
  line-height: var(--g-leading-body);
  padding: 10px;
  border: 1px solid var(--border);
  resize: vertical;
  margin-bottom: 8px;
}

.candidate-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.candidate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
}

/* "Notified" state stays inside the brand palette — a pink field rather
 * than a status color, since color is never used to encode meaning. */
.candidate.is-notified {
  background: var(--g-pink-light);
  border-color: var(--g-black);
}

.candidate-title {
  color: var(--text-secondary);
  font-weight: var(--g-weight-regular);
  font-size: 0.8125rem;
}

.empty-state {
  font-family: var(--g-font-mono);
  color: var(--text-secondary);
  font-size: 0.8125rem;
}
