/* ============================================================
   OpnIMG — Signal Field design tokens
   Shared by all four web apps. Single source of truth.
   ============================================================ */

:root {
  /* ------- Ink (background) scale ------- */
  --ink-0: #070B14;
  --ink-1: #0F1525;
  --ink-2: #172033;
  --ink-3: #26314A;
  --line:  #2A3856;

  /* ------- Text scale ------- */
  --text-1: #F8FAFC;
  --text-2: #CBD5E1;
  --text-3: #94A3B8;

  /* ------- Signal palette ------- */
  --signal:     #FBBF24;  /* primary CTA — capture, submit */
  --signal-2:   #F59E0B;  /* hover / pressed */
  --signal-ink: #1A1300;  /* text on signal */
  --beacon:     #22D3EE;  /* info / fresh data */
  --safe:       #10B981;  /* verified / success / restoration */
  --alert:      #EF4444;  /* error / safety-critical */
  --warn:       #F59E0B;  /* sub-optimal / degraded */

  /* ------- Spacing scale ------- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-8: 48px;

  /* ------- Radius ------- */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-pill: 999px;

  /* ------- Shadow ------- */
  --shadow-1: 0 2px 6px rgba(0,0,0,.25);
  --shadow-2: 0 8px 24px rgba(0,0,0,.4);
  --shadow-signal: 0 6px 18px rgba(251,191,36,0.3);

  /* ------- Type ------- */
  --type-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", sans-serif;
  --type-text:    -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  --type-mono:    "SF Mono", ui-monospace, Menlo, Consolas, monospace;

  /* ------- Tap target (WCAG 2.1 AA) ------- */
  --tap-min: 48px;
}

/* ------------------------------------------------------------
   Base
   ------------------------------------------------------------ */
html, body {
  background: var(--ink-0);
  color: var(--text-1);
  font-family: var(--type-text);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
}

/* ------------------------------------------------------------
   Focus visible — applied everywhere by default
   ------------------------------------------------------------ */
:focus-visible {
  outline: 3px solid var(--signal);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* ------------------------------------------------------------
   Screen-reader only
   ------------------------------------------------------------ */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

/* ------------------------------------------------------------
   Common primitives — used across all four apps
   ------------------------------------------------------------ */

.opn-card {
  background: var(--ink-1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}

.opn-card-2 {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}

.opn-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 5px 10px;
  border-radius: var(--r-pill);
  background: rgba(15,21,37,0.72);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-1);
  min-height: 28px;
}

.opn-pill .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
}

.opn-badge-amber  { background: rgba(251,191,36,0.16); color: var(--signal); border-color: rgba(251,191,36,0.35); }
.opn-badge-cyan   { background: rgba(34,211,238,0.14); color: var(--beacon); border-color: rgba(34,211,238,0.32); }
.opn-badge-safe   { background: rgba(16,185,129,0.14); color: var(--safe);   border-color: rgba(16,185,129,0.32); }
.opn-badge-alert  { background: rgba(239,68,68,0.14);  color: var(--alert);  border-color: rgba(239,68,68,0.32); }
.opn-badge-warn   { background: rgba(245,158,11,0.16); color: var(--warn);   border-color: rgba(245,158,11,0.35); }

.opn-btn-primary {
  background: var(--signal);
  color: var(--signal-ink);
  font-weight: 700;
  border-radius: var(--r-md);
  padding: 14px 18px;
  font-size: 15px;
  box-shadow: var(--shadow-signal);
  border: 0;
  min-height: var(--tap-min);
  cursor: pointer;
}

.opn-btn-primary:hover { background: var(--signal-2); }
.opn-btn-primary:active { transform: translateY(1px); }
.opn-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.opn-btn-secondary {
  background: transparent;
  color: var(--text-1);
  font-weight: 600;
  border: 1.5px solid rgba(255,255,255,0.15);
  border-radius: var(--r-md);
  padding: 14px 18px;
  font-size: 15px;
  min-height: var(--tap-min);
  cursor: pointer;
}

.opn-btn-secondary:hover { border-color: rgba(255,255,255,0.3); }

.opn-btn-warn {
  background: rgba(245,158,11,0.15);
  color: var(--warn);
  font-weight: 700;
  border: 1.5px solid rgba(245,158,11,0.45);
  border-radius: var(--r-md);
  padding: 14px 18px;
  font-size: 15px;
  min-height: var(--tap-min);
  cursor: pointer;
}

.opn-btn-alert {
  background: rgba(239,68,68,0.15);
  color: var(--alert);
  font-weight: 700;
  border: 1.5px solid rgba(239,68,68,0.45);
  border-radius: var(--r-md);
  padding: 14px 18px;
  font-size: 15px;
  min-height: var(--tap-min);
  cursor: pointer;
}

/* ------------------------------------------------------------
   Mode switch — damage / restoration (Reporter app, per
   RESTORATION_DATA_MODEL.md §2)
   ------------------------------------------------------------ */
.opn-mode-pill {
  position: fixed;
  top: env(safe-area-inset-top, 16px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.opn-mode-damage      { background: rgba(251,191,36,0.16); color: var(--signal); border: 1px solid rgba(251,191,36,0.5); }
.opn-mode-restoration { background: rgba(16,185,129,0.16); color: var(--safe);   border: 1px solid rgba(16,185,129,0.5); }

/* ------------------------------------------------------------
   Live region for screen-reader announcements
   ------------------------------------------------------------ */
.opn-live-region {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}
