/* Traffic-light theme: red, yellow and green on a bright background.
   Yellow is only ever a fill behind dark text (yellow text on white is unreadable). */
:root {
  --red: #ef4444; --red-dk: #b91c1c; --red-bg: #fee2e2;
  --yellow: #facc15; --yellow-dk: #854d0e; --yellow-bg: #fef9c3;
  --green: #22c55e; --green-dk: #15803d; --green-bg: #dcfce7;
  --ink: #1f2937; --muted: #5b6676; --line: #e5e7eb; --bg: #fffdf7; --card: #ffffff;
  --radius: 16px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body { color: var(--ink); font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: flex; flex-direction: column; min-height: 100vh; overflow-x: hidden;
  background:
    radial-gradient(520px 380px at 92% 8%, rgba(239, 68, 68, .14), transparent 70%),
    radial-gradient(520px 380px at 55% 40%, rgba(250, 204, 21, .16), transparent 70%),
    radial-gradient(560px 420px at 0% 100%, rgba(34, 197, 94, .15), transparent 70%),
    var(--bg); }

.stripe, .card-stripe { display: grid; grid-template-columns: 1fr 1fr 1fr; }
.stripe { height: 6px; }
.stripe i:nth-child(1), .card-stripe i:nth-child(1) { background: var(--red); }
.stripe i:nth-child(2), .card-stripe i:nth-child(2) { background: var(--yellow); }
.stripe i:nth-child(3), .card-stripe i:nth-child(3) { background: var(--green); }

.nav { display: flex; justify-content: space-between; align-items: center; padding: 16px 32px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.tl-logo { width: 22px; height: 47px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.18)); }
.brand-text { display: grid; line-height: 1.15; }
.brand-text b { font-size: 18px; letter-spacing: .08em; }
.brand-text small { font-size: 12px; color: var(--muted); }
.nav-tag { font-size: 12px; font-weight: 600; color: var(--yellow-dk); background: var(--yellow-bg); border: 1px solid #fde68a;
  padding: 4px 10px; border-radius: 999px; }

.wrap { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 12px 32px 40px;
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, 400px); gap: 48px; align-items: start; }

.eyebrow { font-weight: 700; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; margin: 12px 0 10px; color: var(--muted); }
.eyebrow .r { color: var(--red-dk); } .eyebrow .y { color: var(--yellow-dk); } .eyebrow .g { color: var(--green-dk); }
h1 { font-size: clamp(32px, 4.6vw, 54px); line-height: 1.08; margin: 0 0 16px; letter-spacing: -.02em; }
h1 .red { color: var(--red); }
h1 .green { color: var(--green-dk); }
h1 .hl { background: linear-gradient(transparent 55%, var(--yellow) 55%, var(--yellow) 92%, transparent 92%); padding: 0 4px; }
.lead { color: #374151; font-size: 17px; max-width: 620px; margin: 0 0 22px; }

.chips { list-style: none; padding: 0; margin: 0 0 24px; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; border: 1px solid; }
.dot { width: 9px; height: 9px; border-radius: 50%; }
.c-red { color: var(--red-dk); background: var(--red-bg); border-color: #fecaca; } .c-red .dot { background: var(--red); }
.c-yellow { color: var(--yellow-dk); background: var(--yellow-bg); border-color: #fde68a; } .c-yellow .dot { background: #eab308; }
.c-green { color: var(--green-dk); background: var(--green-bg); border-color: #bbf7d0; } .c-green .dot { background: var(--green); }

/* animated scene */
.scene { margin: 0 0 22px; max-width: 620px; }
.scene svg { width: 100%; height: auto; display: block; border-radius: var(--radius); box-shadow: 0 10px 30px rgba(31, 41, 55, .15); }
.scene figcaption { color: var(--muted); font-size: 13px; margin-top: 8px; }
.scene em { color: var(--ink); font-style: normal; font-weight: 700; }
.verge { fill: #86d39a; }
.road { fill: #3a4049; }
.lane line { stroke: #f3f4f6; stroke-width: 3; stroke-dasharray: 16 14; }
.stopline { stroke: #ffffff; stroke-width: 6; }
.tiny { fill: #e5e7eb; font: 700 9px system-ui, sans-serif; letter-spacing: .1em; }
.signal .head { fill: #1f2937; } .signal .pole { fill: #4b5563; }
.lamp-red { fill: var(--red); filter: drop-shadow(0 0 6px var(--red)); animation: glow 1.6s ease-in-out infinite; }
.lamp-off { fill: #4b5563; }
.body { fill: #2563eb; } .body2 { fill: #e5e7eb; } .glass { fill: #111827; }
.box { fill: none; stroke-width: 2.5; stroke-dasharray: 6 4; animation: boxcolour 6s linear infinite; }
.tag rect { rx: 3; } .tag text { font: 700 10px ui-monospace, Menlo, Consolas, monospace; fill: #052e16; }
.tag-ok rect { fill: var(--green); } .tag-bad rect { fill: var(--red); } .tag-bad text { fill: #fff; }
.tag-ok { animation: tagok 6s linear infinite; } .tag-bad { animation: tagbad 6s linear infinite; }
.car { animation: drive 6s linear infinite; }
@keyframes drive { from { transform: translateY(0); } to { transform: translateY(-400px); } }
/* the car's rear (its reference point) crosses the stop line at ~55% of the loop */
@keyframes boxcolour { 0%, 54% { stroke: var(--green); } 55%, 100% { stroke: var(--red); } }
@keyframes tagok { 0%, 54% { opacity: 1; } 55%, 100% { opacity: 0; } }
@keyframes tagbad { 0%, 54% { opacity: 0; } 55%, 100% { opacity: 1; } }
@keyframes glow { 50% { opacity: .75; } }

.pipeline { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; counter-reset: step; }
.pipeline li { counter-increment: step; font-size: 13px; font-weight: 600; padding: 6px 10px; border-radius: 8px; background: #fff; border: 1px solid var(--line); }
.pipeline li::before { content: counter(step); display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: 6px;
  border-radius: 50%; color: #fff; font-size: 11px; font-weight: 700; background: var(--red); }
.pipeline li:nth-child(3n+2)::before { background: #eab308; color: var(--ink); }
.pipeline li:nth-child(3n)::before { background: var(--green-dk); }
.pipeline li + li { position: relative; margin-left: 14px; }
.pipeline li + li::after { content: "\2192"; position: absolute; left: -17px; top: 50%; transform: translateY(-50%); color: var(--muted); }

/* sign-in card */
.card { position: sticky; top: 24px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: 0 20px 50px rgba(31, 41, 55, .14); }
.card-stripe { height: 6px; }
.card > :not(.card-stripe) { margin-left: 26px; margin-right: 26px; }
.card-head { display: flex; gap: 14px; align-items: center; margin-top: 22px; margin-bottom: 16px; }
.card-lights { display: grid; gap: 4px; padding: 6px; background: var(--ink); border-radius: 10px; }
.card-lights i { width: 14px; height: 14px; border-radius: 50%; background: #4b5563; animation: cycle 6s infinite; }
.card-lights i:nth-child(1) { --on: var(--red); animation-delay: 0s; }
.card-lights i:nth-child(2) { --on: var(--yellow); animation-delay: -2s; }
.card-lights i:nth-child(3) { --on: var(--green); animation-delay: -4s; }
@keyframes cycle { 0%, 30% { background: var(--on); box-shadow: 0 0 8px var(--on); } 34%, 100% { background: #4b5563; box-shadow: none; } }
h2 { margin: 0 0 2px; font-size: 22px; }
.muted { color: var(--muted); margin: 0; }
.small { font-size: 13px; margin-top: 12px; }
label { display: block; font-size: 13px; font-weight: 700; margin: 12px 0 6px; }
input { width: 100%; font: inherit; color: var(--ink); background: #f9fafb; border: 1px solid #d1d5db; border-radius: 10px; padding: 11px 12px; }
input:focus { background: #fff; border-color: var(--green); }
input:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.pw { position: relative; }
.pw input { padding-right: 66px; }
.pw .ghost { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); padding: 5px 9px; font-size: 12px; }
.primary { display: block; width: 100%; margin-top: 18px; padding: 12px; border: 0; border-radius: 10px; cursor: pointer; text-align: center;
  font: 700 15px system-ui, sans-serif; color: #fff; background: var(--green-dk); text-decoration: none;
  box-shadow: 0 4px 0 #166534; }
.primary:hover { background: #16a34a; }
.primary:active { transform: translateY(2px); box-shadow: 0 2px 0 #166534; }
.primary:disabled { opacity: .65; cursor: progress; }
.ghost { background: #fff; color: var(--ink); border: 1px solid #d1d5db; border-radius: 8px; cursor: pointer; font: 600 13px system-ui, sans-serif; }
.ghost:hover { border-color: var(--red); color: var(--red-dk); }
.ghost.wide { width: 100%; padding: 10px; margin-top: 12px; }
.error { color: var(--red-dk); background: var(--red-bg); border: 1px solid #fecaca; border-left: 4px solid var(--red);
  padding: 8px 10px; border-radius: 8px; margin: 14px 0 0; font-size: 14px; }
.notice { color: var(--yellow-dk); background: var(--yellow-bg); border: 1px solid #fde68a; border-left: 4px solid #eab308;
  padding: 8px 10px; border-radius: 8px; font-size: 14px; margin-bottom: 4px; }
.signed-in p { margin: 0 0 6px; }
code { font: 12px ui-monospace, Menlo, Consolas, monospace; background: #f3f4f6; padding: 2px 6px; border-radius: 5px; border: 1px solid var(--line); }
.fine { color: var(--muted); font-size: 12px; margin-top: 18px; margin-bottom: 20px; border-top: 1px solid var(--line); padding-top: 14px; }

.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 18px 16px 24px; }

@media (max-width: 900px) {
  .wrap { grid-template-columns: 1fr; gap: 28px; padding: 8px 16px 32px; }
  .card { position: static; order: -1; }
  .nav { padding: 14px 16px; }
  .brand-text small { display: none; }
  .lead { font-size: 16px; }
  .card > :not(.card-stripe) { margin-left: 18px; margin-right: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .car, .box, .tag-ok, .tag-bad { animation-play-state: paused; animation-delay: -3.9s; }
  .lamp-red, .card-lights i { animation: none; }
  .card-lights i:nth-child(1) { background: var(--red); }
}
