/* UPGC Staff Attendance PWA — plain CSS, mobile-first, no frameworks.
   Verdant Institutional palette on a zero-CDN system font stack.
   Dark-on-light, large touch targets. */
:root {
  /* Verdant Institutional brand tokens (mirror of branded-modern-styles.css) */
  --brand-green-deep: #1e5631;
  --brand-green-medium: #2d7a4a;
  --brand-green-light: #3a9b60;
  --brand-green-subtle: #e8f5ed;
  --brand-gold: #d4a53a;
  --brand-gold-light: #e6c563;
  --brand-gold-dark: #b8912e;   /* decoration only — borders, bars, fills */
  --brand-gold-ink: #765600;    /* gold TEXT on light surfaces (microcaptions) */
  --brand-gold-subtle: #fef9f0;

  /* Signature layered green-tinted card shadow */
  --shadow-brand: 0 1px 2px rgba(30, 86, 49, 0.04), 0 8px 24px -10px rgba(30, 86, 49, 0.10);
  --shadow-brand-hover: 0 1px 2px rgba(30, 86, 49, 0.04), 0 12px 28px -12px rgba(30, 86, 49, 0.18);

  /* Motion — Verdant base easing */
  --transition-base: 250ms cubic-bezier(.4, 0, .2, 1);
  --transition-fast: 150ms cubic-bezier(.4, 0, .2, 1);

  /* Legacy aliases kept so every existing rule stays on-token */
  --green: var(--brand-green-deep);
  --green-deep: var(--brand-green-deep);
  --gold: var(--brand-gold);
  --bg: #f4f7f5;
  --card: #ffffff;
  --ink: #1c2b22;
  --muted: #5b6b60;
  --danger: #c0392b;
  --amber-bg: #fdf3e0;
  --amber-ink: #92400e;
  --ok-bg: var(--brand-green-subtle);
  --ok-ink: #166534;
  --line: rgba(30, 86, 49, 0.12);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
}
.shell { max-width: 480px; margin: 0 auto; padding: 12px 12px 88px; }

.topbar {
  background: var(--brand-green-deep);
  color: #fff;
  padding: 14px 16px;
  border-radius: 0 0 14px 14px;
  margin: -12px -12px 14px;
}
/* Verdant signature: 3px green→gold→transparent top strip */
.topbar::before {
  content: "";
  display: block;
  height: 3px;
  margin: -14px -16px 12px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(90deg, var(--brand-green-deep) 0%, var(--brand-gold) 60%, transparent 100%);
}
.topbar .brand { display: flex; align-items: center; gap: 10px; }
.topbar .brand-logo { width: 30px; height: 30px; border-radius: 6px; object-fit: contain; background: #fff; }
.topbar .brand-lockup { display: flex; flex-direction: column; line-height: 1.3; }
.topbar .brand-name { font-size: 0.85rem; font-weight: 700; letter-spacing: -0.01em; }
.topbar .brand-city {
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--brand-gold-light);
}
.topbar h1 { margin: 2px 0 0; font-size: 1.3rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; }
.topbar .sub { font-size: 0.82rem; opacity: 0.9; margin-top: 2px; }

.card {
  background: var(--card);
  border: 1px solid rgba(30, 86, 49, 0.06);
  border-radius: 14px;
  box-shadow: var(--shadow-brand);
  padding: 18px 16px;
  margin-bottom: 14px;
}
.card.center { text-align: center; }
.microcap {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--brand-gold-ink); margin-bottom: 8px;
}
h2 { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; color: var(--brand-green-deep); margin: 0 0 8px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); font-size: 0.9rem; }

.btn {
  display: block; width: 100%; min-height: 52px;
  border: none; border-radius: 12px;
  font-size: 1.05rem; font-weight: 700; font-family: inherit;
  cursor: pointer; padding: 12px 16px;
  transition: background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.btn:disabled { opacity: 0.55; cursor: default; }
.btn:focus-visible { outline: 3px solid var(--brand-gold); outline-offset: 3px; }
.btn-primary { background: var(--brand-green-deep); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-green-medium); }
.btn-gold {
  background: var(--brand-gold-subtle); color: var(--brand-gold-ink);
  border: 1.5px solid var(--brand-gold);
}
.btn-gold:hover:not(:disabled) { background: var(--brand-gold); color: #3d2e00; }
.btn-ghost { background: #fff; color: var(--brand-green-deep); border: 1.5px solid var(--line); }
.btn-ghost:hover:not(:disabled) { border-color: var(--brand-green-medium); }
.btn + .btn { margin-top: 10px; }
.btn-big { min-height: 72px; font-size: 1.25rem; border-radius: 16px; }

.field { margin-bottom: 12px; }
.field label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 4px; }
.field input {
  width: 100%; min-height: 50px; padding: 10px 12px;
  font-size: 1.05rem; font-family: inherit;
  border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.field input:focus { outline: 3px solid var(--brand-gold); outline-offset: 1px; border-color: var(--brand-green-medium); }

.banner {
  border-radius: 12px; padding: 12px 14px; margin-bottom: 14px;
  font-size: 0.92rem; font-weight: 600;
}
.banner.error { background: #fbe9e7; color: var(--danger); border-left: 4px solid var(--danger); }
.banner.warn { background: var(--amber-bg); color: var(--amber-ink); border-left: 4px solid #d97706; }
.banner.ok { background: var(--ok-bg); color: var(--ok-ink); border-left: 4px solid var(--brand-green-deep); }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.78rem; font-weight: 700;
  padding: 4px 12px; border-radius: 999px;
}
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.online { background: var(--ok-bg); color: var(--ok-ink); }
.pill.offline { background: #fbe9e7; color: var(--danger); }

.loc-line {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.85rem; padding: 10px 12px; border-radius: 10px; margin-bottom: 14px;
  background: var(--ok-bg); color: var(--brand-green-deep);
}
.loc-line.bad { background: #fbe9e7; color: var(--danger); }
.loc-line button {
  margin-left: auto; border: none; background: none; cursor: pointer;
  font-size: 1.1rem; min-width: 44px; min-height: 44px; color: var(--muted);
}
.loc-line button:focus-visible { outline: 3px solid var(--brand-gold); outline-offset: 2px; border-radius: 8px; }

.choice-card {
  display: block; width: 100%; text-align: left;
  background: var(--card); border: 2px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-brand);
  padding: 18px 16px; margin-bottom: 12px; cursor: pointer; font-family: inherit;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}
.choice-card .t { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.02em; color: var(--brand-green-deep); }
.choice-card .d { font-size: 0.88rem; color: var(--muted); margin-top: 4px; }
.choice-card:hover { border-color: var(--brand-gold); box-shadow: var(--shadow-brand-hover); }
.choice-card:focus-visible { outline: 3px solid var(--brand-gold); outline-offset: 3px; }
.choice-card:active { border-color: var(--brand-green-deep); }

.result-icon {
  width: 84px; height: 84px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.4rem; margin: 6px auto 14px;
}
.result-icon.ok { background: var(--ok-bg); color: var(--brand-green-deep); }
.result-icon.bad { background: #fbe9e7; color: var(--danger); }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0;
  display: flex; background: #fff; border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0);
  z-index: 20;
}
.tabbar button, .tabbar a {
  flex: 1; min-height: 56px; border: none; background: none;
  font-family: inherit; font-size: 0.8rem; font-weight: 700;
  color: var(--muted); cursor: pointer; text-decoration: none;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.tabbar button:focus-visible, .tabbar a:focus-visible { outline: 3px solid var(--brand-gold); outline-offset: -3px; }
.tabbar .active { color: var(--brand-green-deep); border-top: 3px solid var(--brand-gold); }

.update-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: var(--brand-green-deep); color: #fff;
  border-bottom: 2px solid var(--brand-gold);
  padding: 12px 16px; text-align: center;
  font-size: 0.95rem; font-weight: 600; cursor: pointer;
  display: none;
}

.video-wrap {
  position: relative; border-radius: 12px; overflow: hidden;
  border: 3px solid var(--brand-green-deep); background: #000; margin-bottom: 12px;
}
.video-wrap video { width: 100%; height: auto; display: block; transform: scaleX(-1); }
.video-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; transform: scaleX(-1); }
.video-status {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.72); color: #fff;
  padding: 6px 16px; border-radius: 999px; font-size: 0.85rem; font-weight: 600;
  white-space: nowrap;
}
.video-status.ok { background: rgba(30, 86, 49, 0.92); }

.linklike {
  background: none; border: none; color: var(--brand-green-deep);
  font-family: inherit; font-size: 0.9rem; font-weight: 600;
  text-decoration: underline; cursor: pointer; padding: 8px; min-height: 44px;
}
.linklike:focus-visible { outline: 3px solid var(--brand-gold); outline-offset: 2px; border-radius: 8px; }
.spinner {
  width: 44px; height: 44px; margin: 18px auto;
  border: 5px solid var(--line); border-top-color: var(--brand-green-deep);
  border-radius: 50%; animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
ol.plain, ul.plain { padding-left: 22px; }
ol.plain li, ul.plain li { margin-bottom: 8px; }

/* Phase 2 — offline queue, pending screens, QR proof */
.qr-canvas {
  display: block; margin: 10px auto;
  width: 264px; height: 264px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
}
.pending-meta { font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.banner .linklike { padding: 2px 6px; min-height: 0; font-size: 0.92rem; }
.banner.error { border: 1.5px solid var(--danger); }
