/* Campus Food Locker: shared stylesheet.
   This file is duplicated in cloud/static and locker/static. Keep both copies identical. */

:root {
  --bg: #f3f6f5;
  --surface: #ffffff;
  --surface-2: #e9f0ef;
  --fg: #14262a;
  --muted: #46585c;
  --border: #aebdbf;
  --accent: #0a6a62;
  --accent-fg: #ffffff;
  --ok: #15613a;
  --warn: #7d4a00;
  --bad: #a01c1c;
  --focus: #1a4fd0;
  --sim-bg: #fff3c4;
  --sim-fg: #5a3d00;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 38, 42, 0.08), 0 4px 14px rgba(20, 38, 42, 0.06);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1517;
    --surface: #172326;
    --surface-2: #203033;
    --fg: #e8f0f1;
    --muted: #a9bcbf;
    --border: #4a6165;
    --accent: #52d1c4;
    --accent-fg: #04201c;
    --ok: #74dca0;
    --warn: #f2b955;
    --bad: #ff9494;
    --focus: #9dbdff;
    --sim-bg: #3a2f08;
    --sim-fg: #ffe28a;
    --shadow: none;
  }
}

* { box-sizing: border-box; }

html { font-size: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5rem; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 0.75rem; }

a { color: var(--accent); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 0.5rem; top: -4rem;
  background: var(--accent); color: var(--accent-fg);
  padding: 0.75rem 1rem; border-radius: 8px; z-index: 50;
}
.skip-link:focus { top: 0.5rem; }

/* ---- header and layout ---- */
.site-header {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; font-size: 1.05rem; letter-spacing: 0.01em; }
.brand small { font-weight: 500; color: var(--muted); margin-left: 0.4rem; }
.spacer { flex: 1; }

.container { max-width: 960px; margin: 0 auto; padding: 1rem; }
.container.narrow { max-width: 560px; }
.container.wide { max-width: 1280px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}
.card > :last-child { margin-bottom: 0; }

.row { display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: center; }
.stack > * + * { margin-top: 0.75rem; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.center { text-align: center; }
.hidden { display: none !important; }

/* ---- the "Simulated" label ---- */
.sim-badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  background: var(--sim-bg); color: var(--sim-fg);
  border: 1px dashed currentColor; border-radius: 999px;
  padding: 0.1rem 0.7rem; font-size: 0.8rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap;
}

/* ---- connection note ---- */
.conn-note {
  background: var(--sim-bg); color: var(--sim-fg);
  border: 1px solid currentColor; border-radius: 8px;
  padding: 0.4rem 0.75rem; margin: 0.5rem 1rem 0; font-size: 0.9rem; font-weight: 600;
}

/* ---- forms ---- */
label, .label { display: block; font-weight: 600; margin-bottom: 0.3rem; }
.hint { color: var(--muted); font-size: 0.9rem; margin: 0.25rem 0 0; }

input[type="text"], input[type="password"], input[type="number"], select, textarea {
  width: 100%; min-height: 48px; padding: 0.55rem 0.75rem;
  font: inherit; color: var(--fg); background: var(--surface);
  border: 2px solid var(--border); border-radius: 10px;
}
textarea { min-height: 5.5rem; resize: vertical; }

.check { display: flex; align-items: center; gap: 0.75rem; min-height: 48px; font-weight: 600; cursor: pointer; }
.check input { width: 1.6rem; height: 1.6rem; accent-color: var(--accent); flex: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  min-height: 48px; min-width: 48px; padding: 0.55rem 1.1rem;
  font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
  color: var(--fg); background: var(--surface-2);
  border: 2px solid var(--border); border-radius: 10px;
}
.btn:hover:not(:disabled) { border-color: var(--fg); }
.btn.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.btn.danger { color: var(--bad); border-color: var(--bad); background: transparent; }
.btn.block { display: flex; width: 100%; }
.btn.small { min-height: 44px; padding: 0.3rem 0.8rem; font-size: 0.9rem; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }

/* ---- pills (always text, never colour alone) ---- */
.pill {
  display: inline-flex; align-items: center; gap: 0.3rem;
  border: 2px solid currentColor; border-radius: 999px;
  padding: 0 0.6rem; font-size: 0.85rem; font-weight: 700; white-space: nowrap;
}
.pill.ok { color: var(--ok); }
.pill.warn { color: var(--warn); }
.pill.bad { color: var(--bad); }
.pill.neutral { color: var(--muted); }

/* ---- big codes ---- */
.code-big {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-weight: 800; font-size: 2.6rem; letter-spacing: 0.22em;
  padding: 0.4rem 0.9rem; border-radius: 12px;
  background: var(--surface-2); border: 2px dashed var(--border);
  display: inline-block; user-select: all;
}
.num-big { font-size: 3.2rem; font-weight: 800; line-height: 1; }

/* ---- tables ---- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
table.data { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
table.data th, table.data td { text-align: left; padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data th { background: var(--surface-2); position: sticky; top: 0; white-space: nowrap; }
table.data td.mono, .mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.85rem; }

.grid { display: grid; gap: 0.75rem; }
.grid.cols-4 { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media (max-width: 480px) {
  .code-big { font-size: 2.1rem; letter-spacing: 0.15em; }
  h1 { font-size: 1.4rem; }
}
