/* RGAB public website - the check of an assessment result (page /verify/, assets/js/assessment-verify.js).
   Loaded only by that page, after rgab.css, and uses the tokens of rgab.css (navy, charcoal, gold, porcelain, soft-white). No inline style, no image, no font
   of its own, no script of any other site.

   Design: a bold navy hero with a gold rule, a rounded form card, and an answer card that tells the four answers apart by an icon, a title and the words,
   never by colour alone.

   Motion (all CSS, subtle and fast, 0.2 to 0.6 s; nothing hides content for longer than a moment and nothing loops except the loading shimmer, which only
   exists while the check runs): the hero and the cards rise and fade in, the green check of a valid result draws itself, a gold ring pulses twice around the
   seal, the detail rows stagger in, the "not found" answer only fades (no shake), a soft shimmer shows while the check runs. Under prefers-reduced-motion
   every animation and transition is off and the icon is drawn at once. Focus rings are never removed. */

.vr-section { padding-top: 1.5rem; }

/* ---------------------------------------------------------------- hero */
.vr-hero {
  padding: 1.75rem 1.5rem 1.6rem;
  border-bottom: 5px solid var(--gold);
  border-radius: 16px;
  background: var(--navy);
  color: var(--soft-white);
  animation: vr-rise 0.45s ease-out both;
}
.vr-eyebrow { display: inline-block; margin-bottom: 0.5rem; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold); }
.vr-hero h1 { margin: 0 0 0.6rem; color: var(--soft-white); font-size: 2rem; line-height: 1.15; }
.vr-hero p { margin: 0; color: var(--soft-white); }
.vr-hero a { color: var(--gold); text-decoration: underline; }

/* ---------------------------------------------------------------- form */
.vr-form {
  margin-top: 1.25rem;
  padding: 1.4rem 1.4rem 1.2rem;
  border: 1px solid rgba(27, 42, 75, 0.14);
  border-top: 4px solid var(--gold);
  border-radius: 16px;
  background: var(--soft-white);
  animation: vr-rise 0.45s ease-out 0.08s both;
}
.vr-button { transition: transform 0.2s ease, box-shadow 0.2s ease; }
.vr-button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(27, 42, 75, 0.18); }
.vr-button:disabled { opacity: 0.7; cursor: progress; }

.vr-result { margin-top: 1.5rem; outline: none; }
.vr-result:focus-visible { outline: 3px solid var(--navy); outline-offset: 4px; border-radius: 16px; }
.vr-foot { margin-top: 1.25rem; }

/* ---------------------------------------------------------------- loading shimmer */
.vr-loading { padding: 1.1rem 1.25rem 1.25rem; border: 1px solid rgba(27, 42, 75, 0.14); border-radius: 16px; background: var(--soft-white); animation: vr-fade 0.2s ease-out both; }
.vr-wait { margin: 0 0 0.8rem; font-weight: 700; color: var(--navy); }
.vr-skel {
  display: block;
  height: 0.85rem;
  margin-top: 0.6rem;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--porcelain) 0%, var(--sand) 45%, var(--porcelain) 90%);
  background-size: 220% 100%;
  animation: vr-shimmer 1.1s linear infinite;
}
.vr-skel--short { width: 60%; }
.vr-problem { margin: 0; padding: 0.9rem 1rem; border-left: 4px solid var(--gold); border-radius: 0 12px 12px 0; background: var(--porcelain); color: var(--navy); font-weight: 600; animation: vr-fade 0.25s ease-out both; }

/* ---------------------------------------------------------------- the answer card */
.vr-card {
  border: 1px solid rgba(27, 42, 75, 0.16);
  border-top: 8px solid var(--charcoal);
  border-radius: 16px;
  background: var(--soft-white);
  padding: 1.25rem 1.25rem 1.1rem;
  overflow-wrap: anywhere;
  animation: vr-rise 0.45s ease-out both;
}
.vr-card--valid { border-top-color: #1F6F4A; }
.vr-card--superseded { border-top-color: var(--gold); }
.vr-card--notfound, .vr-card--error { border-top-color: var(--charcoal); animation-name: vr-fade; animation-duration: 0.35s; }
.vr-card--busy { border-top-color: var(--navy); }

.vr-head { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.vr-text { min-width: 0; }
.vr-title { margin: 0 0 0.35rem; font-size: 1.35rem; line-height: 1.25; color: var(--navy); }
.vr-lead { margin: 0; color: var(--charcoal); }

/* the seal: a round badge with the icon; the valid one pulses a gold ring twice */
.vr-seal { position: relative; flex: none; width: 56px; height: 56px; border-radius: 50%; background: var(--navy); }
.vr-seal--valid { background: #1F6F4A; }
.vr-seal--superseded { background: var(--gold); }
.vr-seal--notfound, .vr-seal--error { background: var(--charcoal); }
.vr-seal::after { content: ''; position: absolute; inset: -4px; border: 3px solid var(--gold); border-radius: 50%; opacity: 0; pointer-events: none; }
.vr-seal--valid::after { animation: vr-ring 0.6s ease-out 0.3s 2 both; }
.vr-ic { display: block; width: 56px; height: 56px; }
.vr-ic * { fill: none; stroke: #FFFFFF; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.vr-seal--superseded .vr-ic * { stroke: var(--navy); }
.vr-ic-ring { stroke-opacity: 0.35; }
.vr-ic-draw { stroke-dasharray: 40; stroke-dashoffset: 40; animation: vr-draw 0.5s ease-out 0.25s forwards; }

/* the rows */
.vr-rows { margin: 0 0 1rem; padding: 0.25rem 1rem; border: 1px solid rgba(27, 42, 75, 0.12); border-radius: 12px; background: #FFFFFF; }
.vr-row { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); gap: 0.25rem 1rem; padding: 0.65rem 0; border-bottom: 1px solid rgba(27, 42, 75, 0.1); animation: vr-fade 0.3s ease-out both; }
.vr-row:last-child { border-bottom: 0; }
.vr-row:nth-child(1) { animation-delay: 0.20s; }
.vr-row:nth-child(2) { animation-delay: 0.25s; }
.vr-row:nth-child(3) { animation-delay: 0.30s; }
.vr-row:nth-child(4) { animation-delay: 0.35s; }
.vr-row:nth-child(5) { animation-delay: 0.40s; }
.vr-row:nth-child(6) { animation-delay: 0.45s; }
.vr-row:nth-child(7) { animation-delay: 0.50s; }
.vr-row dt { margin: 0; font-size: 0.85rem; font-weight: 700; color: var(--charcoal); }
.vr-row dd { margin: 0; font-weight: 600; color: var(--navy); }
.vr-verdict { display: inline-block; justify-self: start; padding: 0.2rem 0.85rem; border: 2px solid var(--navy); border-radius: 999px; letter-spacing: 0.06em; }
.vr-row dd.vr-verdict--passed { background: #1F6F4A; border-color: #1F6F4A; color: #FFFFFF; }
.vr-row dd.vr-verdict--not_passed { background: #4A5568; border-color: #4A5568; color: #FFFFFF; }
.vr-row dd.vr-verdict--under_review { background: var(--gold); border-color: var(--gold); color: var(--navy); }

.vr-note { margin: 0; font-size: 0.9rem; color: var(--charcoal); }

/* ---------------------------------------------------------------- keyframes (every one is 0.2 to 0.6 s, except the loading shimmer) */
@keyframes vr-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes vr-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes vr-draw { to { stroke-dashoffset: 0; } }
@keyframes vr-ring { 0% { opacity: 0.9; transform: scale(0.85); } 100% { opacity: 0; transform: scale(1.35); } }
@keyframes vr-shimmer { from { background-position: 100% 0; } to { background-position: -120% 0; } }

@media (max-width: 520px) {
  .vr-hero { padding: 1.3rem 1.1rem 1.2rem; }
  .vr-hero h1 { font-size: 1.6rem; }
  .vr-form { padding: 1.1rem 1rem 1rem; }
  .vr-card { padding: 1rem 0.9rem 0.8rem; }
  .vr-head { gap: 0.75rem; }
  .vr-seal, .vr-ic { width: 48px; height: 48px; }
  .vr-row { grid-template-columns: minmax(0, 1fr); }
  .vr-title { font-size: 1.2rem; }
}

/* ---------------------------------------------------------------- no motion when the visitor asks for none: everything is simply there */
@media (prefers-reduced-motion: reduce) {
  .vr-hero, .vr-form, .vr-card, .vr-row, .vr-loading, .vr-problem, .vr-seal::after, .vr-ic-draw, .vr-skel { animation: none; }
  .vr-ic-draw { stroke-dasharray: none; stroke-dashoffset: 0; }
  .vr-seal::after { display: none; }
  .vr-button { transition: none; }
  .vr-button:hover:not(:disabled) { transform: none; box-shadow: none; }
}
