/* ar.css — the AR Training player and the marker sheets.
   Loaded only by /ar-run.html and the AR pages, so the rest of the site keeps its own stylesheet. */

.ar-shell { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1080px) { .ar-shell { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); } }

/* ---- the stage: video, overlays, badge ---- */
.ar-stage {
  position: relative; overflow: hidden; border-radius: 14px;
  background: #0b1a2b; aspect-ratio: 3 / 4; max-height: 78vh;
}
@media (min-width: 1080px) { .ar-stage { aspect-ratio: 16 / 10; max-height: none; } }
.ar-stage video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ar-stage.is-demo video { display: none; }
.ar-stage.is-demo::before {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(135deg, rgba(240,184,120,.10), rgba(15,42,74,.35)),
    repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 2px, transparent 2px 44px),
    repeating-linear-gradient(0deg, rgba(255,255,255,.05) 0 2px, transparent 2px 44px),
    #12263d;
}
.ar-detect { position: absolute; left: -9999px; top: 0; width: 1px; height: 1px; }

/* the overlay layer is locked to the marker: its transform is set by the engine */
.ar-overlay {
  position: absolute; left: 0; top: 0; width: 0; height: 0;
  transform-origin: 0 0; opacity: 0; transition: opacity .18s ease;
  will-change: transform;
}
.ar-lockbox {
  position: absolute; border: 2px dashed rgba(240,184,120,.85); border-radius: 10px;
  box-shadow: 0 0 0 9999px rgba(6,16,28,.18);
}
.ar-chips { position: absolute; left: 0; top: 0; }
.ar-chip {
  position: absolute; max-width: 210px; padding: 7px 10px; border-radius: 9px;
  background: rgba(8,20,34,.9); border: 1px solid rgba(240,184,120,.5); color: #f4f7fb;
  font-size: 12px; line-height: 1.35;
}
.ar-chip b { display: block; font-size: 10px; letter-spacing: .12em; color: #f0b878; margin-bottom: 2px; }
.ar-chip--escalate { border-color: rgba(240,120,120,.75); }
.ar-chip--escalate b { color: #ffb3b3; }
.ar-chip--route { border-color: rgba(140,210,255,.7); }
.ar-chip--route b { color: #9fd6ff; }

.ar-hud {
  position: absolute; left: 12px; right: 12px; bottom: 12px;
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.ar-lock, .ar-badge {
  font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 6px 10px; border-radius: 999px; background: rgba(8,20,34,.85);
  color: #cfe0f2; border: 1px solid rgba(255,255,255,.18);
}
.ar-lock.is-locked { background: #167a45; color: #fff; border-color: #167a45; }
.ar-status {
  position: absolute; left: 12px; right: 12px; top: 12px;
  font-size: 13px; color: #eaf1f8; background: rgba(8,20,34,.78); padding: 8px 11px; border-radius: 9px;
}
.ar-marker-hint { font-size: 12.5px; margin: 8px 0 0; color: var(--muted, #5b6b7c); }
.ar-marker-hint.ok { color: #167a45; font-weight: 600; }
.ar-marker-hint.warn { color: #a8341f; font-weight: 600; }

/* ---- the decision card ---- */
.ar-panel { display: grid; gap: 14px; }
.ar-card { background: #fff; border: 1px solid #e3e9f0; border-radius: 14px; padding: 18px; }
.ar-card h2 { font-size: 19px; line-height: 1.35; margin: 6px 0 14px; }
.ar-count { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: #7b8b9c; margin: 0; }
.ar-options { display: grid; gap: 9px; }
.ar-option {
  display: flex; gap: 11px; align-items: flex-start; width: 100%; text-align: left;
  padding: 12px 13px; border: 1px solid #d7e0ea; border-radius: 11px; background: #fbfcfe;
  font: inherit; font-size: 14.5px; line-height: 1.45; color: #14263a; cursor: pointer;
}
.ar-option:hover:not(:disabled) { border-color: #0f2a4a; background: #f3f7fc; }
.ar-option:disabled { cursor: default; }
.ar-option b {
  flex: 0 0 22px; height: 22px; border-radius: 50%; background: #0f2a4a; color: #fff;
  font-size: 12px; display: grid; place-items: center;
}
.ar-option.is-right { border-color: #167a45; background: #f1fbf5; }
.ar-option.is-right b { background: #167a45; }
.ar-option.is-wrong { border-color: #a8341f; background: #fdf3f1; }
.ar-option.is-wrong b { background: #a8341f; }
.ar-feedback { margin-top: 14px; padding-top: 14px; border-top: 1px solid #e3e9f0; }
.ar-verdict { font-size: 14.5px; line-height: 1.55; margin: 0 0 12px; }
.ar-feedback.ok .ar-verdict { color: #145c37; }
.ar-feedback.no .ar-verdict { color: #8c2c18; }
.ar-next {
  font: inherit; font-weight: 700; padding: 12px 16px; border-radius: 10px; border: 0;
  background: #0f2a4a; color: #fff; cursor: pointer;
}
.ar-btnrow { display: flex; flex-wrap: wrap; gap: 9px; }
.ar-btn {
  font: inherit; font-size: 14px; padding: 10px 13px; border-radius: 10px;
  border: 1px solid #cfd9e4; background: #fff; color: #14263a; cursor: pointer;
}
.ar-btn--primary { background: #0f2a4a; border-color: #0f2a4a; color: #fff; font-weight: 600; }
.ar-record-form { display: grid; gap: 10px; margin: 14px 0; }
.ar-field { display: grid; gap: 5px; font-size: 13.5px; }
.ar-field input { font: inherit; padding: 10px 11px; border: 1px solid #cfd9e4; border-radius: 9px; }
.ar-form-warn { font-size: 13.5px; color: #a8341f; margin: 10px 0 0; }
.ar-form-warn.ok { color: #167a45; font-weight: 600; }
.ar-course-switch { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
/* found in the first visual pass: the three course links rendered as one run-together string
   ("...ServicesProvide Guard...") because the anchors were inline. One per line. */
#ar-course-list { display: flex; flex-direction: column; gap: 2px; }
#ar-course-list a { display: block; color: #0f2a4a; padding: 3px 0; }
#ar-course-list a:hover { text-decoration: underline; }

/* practice mode: no marker exists, so the overlay is centred on a stand-in marker box. The engine
   used to move a zero-size layer, which threw the guidance chips outside the stage - caught in the
   first screenshot. */
/* The layer must stay a zero-size ORIGIN placed at the stage's centre, exactly as it behaves with
   a real marker (where the transform puts that origin on the marker centre). Giving it a size and
   margins made its top-left corner the origin, so the stand-in marker and the guidance chips were
   drawn half a box up and to the left - measured in the second visual pass. */
.ar-stage.is-demo .ar-overlay { left: 50%; top: 50%; width: 0; height: 0; margin: 0; transform: none; opacity: 1; }
.ar-course-switch a[aria-current="page"] { font-weight: 700; text-decoration: none; }

/* ---- the trainee list ---- */
.ar-records { background: #fff; border: 1px solid #e3e9f0; border-radius: 14px; padding: 18px; }
.ar-records h2 { font-size: 18px; margin: 0 0 6px; }
.ar-records .small { font-size: 13px; }
.ar-table-wrap { overflow-x: auto; margin: 12px 0; }
table.ar-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.ar-table th, table.ar-table td { text-align: left; padding: 8px 9px; border-bottom: 1px solid #e9eef4; }
table.ar-table th { font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; color: #6b7c8e; }
.ar-empty { font-size: 13.5px; color: var(--muted, #5b6b7c); }

/* ---- marker sheets (printable) ---- */
.ar-markers { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.ar-marker { border: 1px dashed #c9d4e0; border-radius: 10px; padding: 10px; text-align: center; background: #fff; }
.ar-marker img { width: 100%; height: auto; display: block; }
.ar-marker b { display: block; font-size: 12px; margin-top: 7px; }
.ar-marker span { display: block; font-size: 11.5px; color: #6b7c8e; }

@media print {
  .site-header, .site-footer, .ar-btnrow, .ar-course-switch, .ar-stage { display: none !important; }
  .ar-records, .ar-marker { border-color: #000; }
  body { background: #fff; }
}
