/* ══════════════════════════════════════════════════════════════════════════
   GV-SYSTEM.CSS — Guide View on the Candbike scale        (new file, 2.21.706)
   ──────────────────────────────────────────────────────────────────────────
   WHY THIS FILE EXISTS

   Guide View was a THIRD brand. The guest site and Tour Manager run the
   logo-measured scale; this screen ran Forest Sage #3d6152 + Terracotta
   #b5502e + Amber #c9853f on cream — none of it in the logo, none of it a
   scale. A raw hex has one lightness, so it can do one job; every value in
   here was therefore doing a job it was not built for. Four pairings on the
   login window measured under their required ratio.

   METHOD — ELEMENT BY ELEMENT, BY JOB, NEVER BY VALUE
   Each element below is named for the job it does, and then given the STEP
   of the generated scale that does that job. Nothing is chosen by eye and
   no new hex is introduced. Every ratio in the comments is computed, not
   asserted.

   60 / 30 / 10 ON THIS SCREEN
     60  ink neutrals — ground, card, well, edges, all text
     30  the field structure and one still sky wash for depth
     10  sun, exactly once, on the single button that matters

   SCOPE AND SAFETY
   Every rule is scoped under #setupScreen, which is one notch more specific
   than the template's own inline block, so this file wins wherever it speaks
   and is silent everywhere else. If it fails to load, the screen renders
   exactly as 2.21.705. It cannot break the login.

   NO JAVASCRIPT CHANGED. The busy and error states below hook the classes
   the template's own confirmSetup() already sets (btn.disabled, and text
   written into .setup-err).
   ══════════════════════════════════════════════════════════════════════════ */

/* ── ROLES — the dark mapping, declared locally on the screen ──────────────
   Not :root, and not @media dark. This screen is dark by design, not by
   preference, and the rest of the app has not been converted — a global flip
   is what made four of five pairs unreadable in 2.21.655.              */
#setupScreen {
  /* ── THE STEPS THIS SCREEN USES ────────────────────────────────────────
     Re-declared locally, exactly as 2.21.650 did for Today. The generated
     system file is NOT linked here on purpose: it carries a bare
     `input, select, textarea { font-size }` rule that would reach the whole
     main app and resize every field in the expense and job-order sheets.
     Each value below is a step of the generated scale, named with its step
     so it stays traceable to the generator.                               */
  --gv-s-ink-950 : #232323;
  --gv-s-ink-900 : #343434;
  --gv-s-ink-600 : #707070;
  --gv-s-ink-500 : #878787;
  --gv-s-ink-300 : #c4c4c4;
  --gv-s-ink-200 : #dadada;
  --gv-s-ink-100 : #ececec;
  --gv-s-ink-50  : #f6f6f6;
  --gv-s-sun-500 : #fecf1a;
  --gv-s-sun-700 : #b48f01;
  --gv-s-punch-300: #f198c0;
  --gv-s-sky-500 : 30,153,218;   /* rgb parts, for the one wash */

  /* ── ROLES — the dark mapping, declared locally on the screen ──────────
     Not :root, and not @media dark. This screen is dark by design, not by
     preference, and the rest of the app has not been converted — a global
     flip is what made four of five pairs unreadable in 2.21.655.          */
  --gv-ground       : var(--gv-s-ink-950);   /* the page behind everything  */
  --gv-card         : var(--gv-s-ink-900);   /* the one task, raised        */
  --gv-well         : var(--gv-s-ink-950);   /* where he types, sunk        */

  /* TWO different edge jobs, so two different steps. A card edge is
     decorative — the card is also identified by its fill. A control edge is
     the thing that says "type here", so it carries the 3:1 bar of 1.4.11. */
  --gv-edge-card    : var(--gv-s-ink-600);   /* 3.17:1 vs ground            */
  --gv-edge-control : var(--gv-s-ink-500);   /* 4.37:1 vs well, 3.47 vs card*/

  /* Three text ranks, three steps. A size alone is not a hierarchy.       */
  --gv-t            : var(--gv-s-ink-100);   /* 13.30:1 on ground  HERO     */
  --gv-t-muted      : var(--gv-s-ink-200);   /* 11.24:1 on ground  META     */
  --gv-t-dim        : var(--gv-s-ink-300);   /*  9.01:1 on ground  LABEL    */

  --gv-act          : var(--gv-s-sun-500);   /* the one button that matters */
  --gv-act-busy     : var(--gv-s-sun-700);   /* the same button, thinking   */
  --gv-act-ink      : var(--gv-s-ink-950);   /* 10.59:1 on sun-500          */
  --gv-alert        : var(--gv-s-punch-300); /*  7.48:1 ground, 5.92:1 card */
  --gv-ring         : var(--gv-s-ink-50);    /* 14.54:1 vs well — the ring  */

  /* MOTION — three durations and one curve. Everything that moves is
     opacity or transform, so it runs on the compositor and costs no layout.
     Nothing loops except the sweep, and the sweep exists only while the
     network is being waited on.                                           */
  --gv-fast  : 140ms;
  --gv-med   : 240ms;
  --gv-enter : 380ms;
  --gv-ease  : cubic-bezier(.2,.7,.2,1);
}

/* ── GROUND ───────────────────────────────────────────────────────────────
   One still sky wash, 10% — the supporting 30. It is a gradient, not an
   animation: it gives the flat field a centre at zero running cost.      */
#setupScreen {
  background:
    radial-gradient(90% 58% at 50% 30%, rgba(var(--gv-s-sky-500),.10), transparent 70%),
    var(--gv-ground);
  color: var(--gv-t);
}

/* ── TYPE RANKS — each fixes size AND weight AND colour together ───────── */

/* LABEL · identity, the lowest rank on the screen.
   WAS --gv-green-lt on ink = 2.93:1 FAIL. The brand mark was the least
   readable thing on the first screen a guide ever sees.                  */
#setupScreen .setup-logo {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .18em;
  color: var(--gv-t-dim);                   /* 9.01:1  was 2.93:1 */
}

/* HERO · the one loud thing. Serif is kept — it is the only serif here. */
#setupScreen .setup-title {
  color: var(--gv-t);                       /* 13.30:1 */
  letter-spacing: -.01em;
}

/* META · the single instruction. Was white at 50% alpha = 4.85:1, which
   passes but is thin on a phone held in sunlight.                        */
#setupScreen .setup-sub {
  color: var(--gv-t-muted);                 /* 11.24:1  was 4.85:1 */
}

/* ── THE CARD · holds the one task ───────────────────────────────────────
   A real fill, not a 6% tint. On a near-black ground in sun a 1.26:1 fill
   difference disappears, so the separation is carried by the EDGE, which
   survives glare.                                                        */
#setupScreen .setup-card {
  background: var(--gv-card);
  border: 1px solid var(--gv-edge-card);    /* 3.17:1 vs ground */
  box-shadow: 0 10px 30px rgba(0,0,0,.34);
}

/* LABEL · names the field */
#setupScreen .setup-card h2 {
  color: var(--gv-t-dim);                   /* 7.14:1 on card */
  opacity: 1;                               /* the rank is the colour, not alpha */
  letter-spacing: .02em;
}

/* ── THE FIELD · the one thing he types ──────────────────────────────────
   WAS: fill white@10%, edge white@20% = 1.40:1 against its own fill. The
   boundary of the only control on the screen was effectively invisible.  */
#setupScreen .setup-input {
  background: var(--gv-well);
  border: 1.5px solid var(--gv-edge-control); /* 4.37:1  was 1.40:1 */
  color: var(--gv-t);                         /* 13.30:1 */
  transition: border-color var(--gv-fast) var(--gv-ease),
              box-shadow   var(--gv-fast) var(--gv-ease);
}
#setupScreen .setup-input::placeholder { color: var(--gv-s-ink-500); }

/* FOCUS · says where the keyboard is.
   WAS: outline:none, replaced by a terracotta border at 2.17:1 against the
   field it outlined. This is the single worst failure on the window — the
   browser's own indicator was removed and what replaced it cannot be seen.
   1.4.11 wants 3:1; ink-50 gives 14.54:1.                                */
#setupScreen .setup-input:focus,
#setupScreen .setup-input:focus-visible {
  outline: 2px solid var(--gv-ring);        /* 14.54:1 */
  outline-offset: 2px;
  border-color: var(--gv-ring);
}

/* ── THE ACTION · exactly one on this screen, so it gets the 10% ─────────
   WAS terracotta #b5502e — 5.06:1, so it passed, but it is not in the logo
   and it is the same weight as everything else once colour is removed.   */
#setupScreen .setup-btn {
  background: var(--gv-act);
  color: var(--gv-act-ink);                 /* 10.59:1 */
  transition: transform var(--gv-fast) var(--gv-ease),
              box-shadow var(--gv-fast) var(--gv-ease),
              background var(--gv-fast) linear;
}
#setupScreen .setup-btn:hover:not(:disabled) {
  transform: translate3d(0,-1px,0);
  box-shadow: 0 6px 18px rgba(254,207,26,.22) /* sun-500 @22% */;
}
#setupScreen .setup-btn:active:not(:disabled) {
  background: var(--gv-act);
  transform: translate3d(0,0,0) scale(.985);
  box-shadow: none;
}
#setupScreen .setup-btn:focus-visible {
  outline: 2px solid var(--gv-ring);
  outline-offset: 2px;
}

/* BUSY · the template already sets btn.disabled while the PIN is checked,
   so this needs no JavaScript. One sweep, compositor-only, and it exists
   only for as long as the guide is actually waiting.                     */
#setupScreen .setup-btn:disabled {
  background: var(--gv-act-busy);
  color: var(--gv-act-ink);                 /* 5.14:1 */
  cursor: progress;
  position: relative;
  overflow: hidden;
  transform: none;
  box-shadow: none;
}
#setupScreen .setup-btn:disabled::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 22%,
                                      rgba(255,255,255,.34) 50%,
                                      transparent 78%);
  transform: translate3d(-100%,0,0);
  animation: gvSweep 1.15s linear infinite;
  pointer-events: none;
}

/* ── THE ERROR · tell him the PIN was wrong ──────────────────────────────
   WAS: 20px reserved whether or not there is an error, which is 30px of the
   53px of dead space measured at the bottom of the card. An empty element
   should occupy nothing; then its arrival is itself the signal.          */
#setupScreen .setup-err {
  min-height: 0;
  color: var(--gv-alert);                   /* 5.92:1 on card */
}
#setupScreen .setup-err:empty {
  display: none;
  margin: 0;
}
#setupScreen .setup-err:not(:empty) {
  animation: gvRise var(--gv-med) var(--gv-ease) both;
}
/* The error belongs to the field, so the field shows it too. No class is
   added anywhere — :has reads the state the template already wrote.      */
#setupScreen .setup-card:has(.setup-err:not(:empty)) .setup-input {
  border-color: var(--gv-alert);
}

/* ── ENTRANCE · once, on arrival, in rank order ──────────────────────────
   Four elements, 70ms apart, 380ms each — the last one finishes at 590ms.
   Transform and opacity only. This is the whole of the "life": the screen
   assembles itself in the order it should be read, and then holds still.
   Nothing on this screen blinks, pulses or loops.                        */
@keyframes gvRise {
  from { opacity: 0; transform: translate3d(0,10px,0); }
  to   { opacity: 1; transform: none; }
}
@keyframes gvSweep {
  from { transform: translate3d(-100%,0,0); }
  to   { transform: translate3d(100%,0,0); }
}

#setupScreen .setup-logo  { animation: gvRise var(--gv-enter) var(--gv-ease)   0ms both; }
#setupScreen .setup-title { animation: gvRise var(--gv-enter) var(--gv-ease)  70ms both; }
#setupScreen .setup-sub   { animation: gvRise var(--gv-enter) var(--gv-ease) 140ms both; }
#setupScreen .setup-card  { animation: gvRise var(--gv-enter) var(--gv-ease) 210ms both; }

/* ── REDUCED MOTION ──────────────────────────────────────────────────────
   The file this lives in had ZERO prefers-reduced-motion blocks in 139 KB
   before this release. Adding motion without this would have been a new
   accessibility failure, not a feature. Everything still ARRIVES — it just
   arrives instantly, and the sweep stops.                                */
@media (prefers-reduced-motion: reduce) {
  #setupScreen *,
  #setupScreen *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  #setupScreen .setup-logo,
  #setupScreen .setup-title,
  #setupScreen .setup-sub,
  #setupScreen .setup-card,
  #setupScreen .setup-err:not(:empty) {
    opacity: 1 !important;
    transform: none !important;
  }
  #setupScreen .setup-btn:disabled::after { display: none; }
}
