/* Site Workflow Manager — public pages (landing, sign-in).
   Palette taken from the Zailaf logo: indigo #28166F, signal red #DA251D, teal #96D0C6. */
@font-face {
  font-family: 'Archivo SWM';
  src: url('../fonts/archivo-var.woff2') format('woff2-variations'), url('../fonts/archivo-var.woff2') format('woff2');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #170F47;
  --ink-2: #221766;
  --indigo: #28166F;
  --red: #DA251D;
  --red-ink: #B81C15;
  --teal: #96D0C6;
  --teal-deep: #1B6F64;
  --paper: #F3F4F8;
  --white: #FFFFFF;
  --text: #1D1A33;
  --muted: #55536F;
  --line: #D8D9E5;
  --on-ink: #E9E7F6;
  --on-ink-muted: #ABA6D2;
  --radius-s: 6px;
  --radius-m: 12px;
  --shell: 1160px;
  --font: 'Archivo SWM', 'Archivo', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--paper);
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--indigo); }
a:hover { color: var(--red-ink); }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; border-radius: 3px; }
.shell { width: min(100% - 32px, var(--shell)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- type ---------- */
h1, h2, h3 { margin: 0; line-height: 1.08; color: inherit; }
.display {
  font-stretch: 118%;
  font-weight: 760;
  letter-spacing: -0.02em;
  font-size: clamp(2.3rem, 1.35rem + 3.5vw, 4rem);
  line-height: 1.02;
}
.h2 {
  font-stretch: 112%;
  font-weight: 720;
  letter-spacing: -0.015em;
  font-size: clamp(1.75rem, 1.2rem + 2vw, 2.6rem);
}
.h3 { font-stretch: 108%; font-weight: 680; font-size: 1.2rem; line-height: 1.25; }
.lede { font-size: clamp(1.08rem, 1rem + 0.35vw, 1.25rem); line-height: 1.55; max-width: 36em; }
p { margin: 0 0 1em; max-width: 68ch; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px;
  font: inherit; font-weight: 650; font-stretch: 106%; font-size: 1rem;
  border-radius: var(--radius-s); border: 2px solid transparent;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-ink); color: #fff; }
.btn-ghost-light { border-color: rgba(233, 231, 246, .45); color: var(--on-ink); }
.btn-ghost-light:hover { border-color: var(--on-ink); color: #fff; }
.btn-indigo { background: var(--indigo); color: #fff; }
.btn-indigo:hover { background: var(--ink); color: #fff; }

/* ---------- top bar ---------- */
.topbar { background: var(--white); border-bottom: 1px solid var(--line); }
.topbar .shell { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--text); }
.brand img { height: 34px; width: auto; }
.brand-name { font-stretch: 110%; font-weight: 700; font-size: 1.02rem; line-height: 1.1; color: var(--indigo); }
.brand-name small { display: block; font-weight: 500; font-stretch: 100%; font-size: .8rem; color: var(--muted); }
.brand-sep { width: 1px; height: 30px; background: var(--line); }
.topnav { display: flex; align-items: center; gap: 22px; }
.topnav a.link { text-decoration: none; color: var(--muted); font-weight: 550; font-size: .98rem; }
.topnav a.link:hover { color: var(--indigo); }
.topnav .btn { min-height: 42px; padding: 0 18px; }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    linear-gradient(rgba(150, 208, 198, .07) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, rgba(150, 208, 198, .07) 1px, transparent 1px) 0 0 / 40px 40px,
    var(--ink);
  color: var(--on-ink);
}
.hero .shell { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 48px; align-items: center; padding-block: 88px 96px; }
.hero .display { color: #fff; }
.hero .lede { color: var(--on-ink-muted); margin: 24px 0 34px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-note { margin-top: 22px; font-size: .92rem; color: var(--on-ink-muted); }

.plan { width: 100%; height: auto; }
.plan .grid-line { stroke: rgba(150, 208, 198, .14); }
.plan .road { stroke: rgba(233, 231, 246, .18); }
.plan .fence { stroke: var(--teal); }
.plan .fence-fill { fill: rgba(150, 208, 198, .08); }
.plan .crew circle { fill: var(--teal); }
.plan .crew text, .plan .away text { font-family: var(--font); font-weight: 700; font-size: 12px; fill: var(--ink); }
.plan .away circle { fill: var(--red); }
.plan .away text { fill: #fff; }
.plan .label { font-family: var(--font); font-size: 13px; fill: var(--on-ink-muted); }
.plan .label-strong { font-family: var(--font); font-size: 14px; font-weight: 650; fill: #fff; }
.plan .tag rect { fill: #fff; }
.plan .tag text { font-family: var(--font); font-size: 13px; fill: var(--text); }
.plan .tag .tag-red { fill: var(--red-ink); font-weight: 700; }
.plan .trail { stroke: var(--red); stroke-dasharray: 3 6; fill: none; }

/* the one orchestrated moment: a crew member steps outside the fence and the tag explains the deduction */
@media (prefers-reduced-motion: no-preference) {
  .plan .away { animation: walk-out 2.6s cubic-bezier(.45, .05, .25, 1) .9s both; }
  .plan .trail { stroke-dashoffset: 0; animation: trail-in 2.6s ease .9s both; }
  .plan .tag { animation: tag-in .5s ease 3.4s both; }
  @keyframes walk-out { from { transform: translate(-100px, 84px); } to { transform: translate(0, 0); } }
  @keyframes trail-in { from { opacity: 0; } to { opacity: 1; } }
  @keyframes tag-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}

/* ---------- sections ---------- */
.section { padding-block: 96px; }
.section-white { background: var(--white); }
.section-head { max-width: 40em; margin-bottom: 48px; }
.section-head p { color: var(--muted); margin-top: 16px; }

/* lifecycle: a real sequence, drawn as a route with stops */
.flow { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 64px; align-items: start; }
.flow-intro { position: sticky; top: 32px; }
.flow-intro p { color: var(--muted); margin-top: 18px; }
.route { list-style: none; margin: 0; padding: 0; position: relative; counter-reset: stop; }
.route::before { content: ""; position: absolute; left: 19px; top: 20px; bottom: 20px; width: 2px; background: repeating-linear-gradient(var(--indigo) 0 10px, transparent 10px 16px); opacity: .35; }
.route li { position: relative; padding: 0 0 34px 68px; counter-increment: stop; }
.route li:last-child { padding-bottom: 0; }
.route li::before {
  content: counter(stop);
  position: absolute; left: 0; top: -4px;
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--white); border: 2px solid var(--indigo);
  font-weight: 700; font-stretch: 110%; color: var(--indigo); font-size: .95rem;
}
.route li.stop-key::before { background: var(--indigo); color: #fff; }
.route li.stop-money::before { background: var(--red); border-color: var(--red); color: #fff; }
.route h3 { margin-bottom: 6px; }
.route p { color: var(--muted); margin: 0; max-width: 52ch; }

/* roles */
.roles { border-top: 2px solid var(--ink); }
.role { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 32px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.role h3 { font-stretch: 115%; font-weight: 720; font-size: clamp(1.2rem, 1rem + .7vw, 1.5rem); color: var(--indigo); }
.role p { margin: 0; color: var(--text); }
.role .where { display: block; margin-top: 8px; color: var(--muted); font-size: .94rem; }

/* sign-in band */
.signin-band { background: var(--indigo); color: var(--on-ink); }
.signin-band .shell { display: grid; grid-template-columns: minmax(0, 1.4fr) auto; gap: 40px; align-items: center; padding-block: 64px; }
.signin-band .h2 { color: #fff; }
.signin-band p { color: var(--on-ink-muted); margin: 14px 0 0; }

/* about */
.about { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 64px; align-items: start; }
.about-logo { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 36px; }
.about-logo img { width: 100%; height: auto; }
.about p { color: var(--muted); }




/* footer */
.footer { background: var(--ink); color: var(--on-ink-muted); font-size: .92rem; }
.footer .shell { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; padding-block: 28px; }
.footer a { color: var(--on-ink); }

/* ---------- sign-in page ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-side {
  background:
    linear-gradient(rgba(150, 208, 198, .07) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, rgba(150, 208, 198, .07) 1px, transparent 1px) 0 0 / 40px 40px,
    var(--ink);
  color: var(--on-ink);
  padding: 56px clamp(24px, 5vw, 72px);
  display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
}
.auth-side .h2 { color: #fff; max-width: 14em; }
.auth-side p { color: var(--on-ink-muted); margin-top: 18px; }
.auth-side .plan { max-width: 420px; }
.auth-side a { color: var(--on-ink); }
.auth-main { background: var(--white); display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.auth-card { width: min(100%, 400px); }
.auth-card .brand { margin-bottom: 40px; }
.auth-card h1 { font-stretch: 112%; font-weight: 740; font-size: 2rem; letter-spacing: -0.015em; }
.auth-card .hint { color: var(--muted); margin: 10px 0 28px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 620; margin-bottom: 7px; font-size: .97rem; }
.field input {
  width: 100%; min-height: 50px; padding: 0 14px;
  font: inherit; font-size: 1.02rem; color: var(--text);
  background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius-s);
}
.field input:hover { border-color: #B9BACF; }
.field input:focus { outline: none; border-color: var(--indigo); background: #fff; box-shadow: 0 0 0 3px rgba(40, 22, 111, .16); }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 76px; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  min-height: 38px; padding: 0 12px; border: 0; background: transparent;
  font: inherit; font-size: .9rem; font-weight: 620; color: var(--indigo); cursor: pointer; border-radius: 4px;
}
.auth-card .btn { width: 100%; margin-top: 8px; }
.alert { border-radius: var(--radius-s); padding: 12px 14px; margin-bottom: 20px; font-size: .96rem; line-height: 1.45; }
.alert-error { background: #FCEBEA; color: #8E1712; border-left: 4px solid var(--red); }
.alert-info { background: #EDEBF7; color: var(--indigo); border-left: 4px solid var(--indigo); }
.auth-foot { margin-top: 28px; font-size: .92rem; color: var(--muted); }
.auth-foot p { margin: 0 0 6px; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .hero .shell { grid-template-columns: 1fr; gap: 40px; padding-block: 56px 64px; }
  .hero-visual { max-width: 520px; }
  .flow, .about { grid-template-columns: 1fr; gap: 36px; }
  .flow-intro { position: static; }
  .about-logo { max-width: 360px; }
  .signin-band .shell { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { padding: 28px 24px; gap: 0; }
  .auth-side { display: none; }
  .auth-side .h2 { font-size: 1.35rem; }
}
@media (max-width: 640px) {
  .section { padding-block: 64px; }
  .topnav a.link { display: none; }
  .brand-sep, .brand-name small { display: none; }
  .brand img { height: 28px; }
  .role { grid-template-columns: 1fr; gap: 8px; padding: 22px 0; }
  .route li { padding-left: 58px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
