*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: 'Source Sans 3', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  line-height: 1.5;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-color: var(--bg);
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cpath d='M40 0H0V40' fill='none' stroke='%231C1C1C' stroke-width='1' stroke-opacity='0.07'/%3E%3C/svg%3E");
  background-size: 40px 40px;
  background-position: 0px 0px;
  -webkit-mask-image:
    linear-gradient(to bottom, transparent 0%, #000 22%, #000 78%, transparent 100%),
    linear-gradient(to right,  transparent 0%, #000 12%, #000 88%, transparent 100%);
  -webkit-mask-composite: source-in;
          mask-image:
    linear-gradient(to bottom, transparent 0%, #000 22%, #000 78%, transparent 100%),
    linear-gradient(to right,  transparent 0%, #000 12%, #000 88%, transparent 100%);
  mask-composite: intersect;
}

.grid-flow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.7;
  -webkit-mask-image:
    linear-gradient(to bottom, transparent 0%, #000 22%, #000 78%, transparent 100%),
    linear-gradient(to right,  transparent 0%, #000 12%, #000 88%, transparent 100%);
  -webkit-mask-composite: source-in;
          mask-image:
    linear-gradient(to bottom, transparent 0%, #000 22%, #000 78%, transparent 100%),
    linear-gradient(to right,  transparent 0%, #000 12%, #000 88%, transparent 100%);
  mask-composite: intersect;
}

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  z-index: 10;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}
.nav-inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: var(--primary);
  color: var(--on-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
}
.nav-links {
  display: inline-flex;
  align-items: center;
  gap: 22px;
}
.nav-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}
.nav-links a:hover { color: var(--primary); text-decoration: none; }
.nav-icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--text-muted);
  transition: color .15s ease;
}
.nav-links a:hover .nav-icon { color: var(--primary); }
.nav-links a.nav-login {
  /* force-match .btn + .btn-primary (override .nav-links a specificity) */
  margin-left: 6px;
  gap: 8px;
  font-weight: 600;
  color: var(--on-primary);
}
.nav-links a.nav-login:hover { color: var(--on-primary); }
.nav-login .nav-icon-light {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  color: var(--on-primary);
}
.nav-links a.nav-login:hover .nav-icon-light { color: var(--on-primary); }
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border: 1px solid var(--brand-yellow);
  background: var(--brand-yellow-soft);
  color: var(--text);
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
}
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 0 3px var(--warning-ring);
}

main {
  position: relative;
  z-index: 1;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 72px 24px 48px;
}
.container {
  width: 100%;
  max-width: 1040px;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 40px;
  align-items: center;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 9999px;
  background: var(--surface);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}
.status-badge .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--warning);
}
h1.title {
  font-size: 40px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 14px 0 10px;
  font-weight: 700;
  color: var(--text);
}
h1.title .accent { color: var(--primary); }
p.lead {
  margin: 0 0 18px;
  font-size: 15px;
  color: var(--text-muted);
  max-width: 460px;
}
.actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--r-md);
  cursor: pointer;
  border: 1px solid transparent;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.btn-primary {
  background: var(--primary); /* blue primary */
  color: var(--on-primary);
}
.btn-primary:hover { background: var(--primary-hover); text-decoration: none; color: var(--on-primary); }
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }

/* --- Auth / Login --- */
.auth-wrap {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
}
.auth-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 32px 28px;
  box-shadow: var(--shadow-md);
  animation: step-in 0.5s ease-out both;
}
.auth-head {
  text-align: center;
  margin-bottom: 22px;
}
.auth-mark {
  width: 40px;
  height: 40px;
  font-size: 20px;
  border-radius: 8px;
  margin: 0 auto 14px;
}
.auth-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
  color: var(--text);
}
.auth-sub {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.field-control {
  position: relative;
  display: flex;
  align-items: center;
}
.field-icon {
  position: absolute;
  left: 12px;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--text-soft);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.field-control input {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  padding: 10px 12px 10px 38px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field-control input::placeholder { color: var(--text-soft); }
.field-control input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}
.toggle-pass {
  position: absolute;
  right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: var(--r-md);
  color: var(--text-soft);
}
.toggle-pass:hover { color: var(--primary); }
.toggle-pass svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.toggle-pass.is-on { color: var(--primary); }
.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}
.remember {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-muted);
  cursor: pointer;
}
.remember input {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
  cursor: pointer;
}
.auth-link {
  color: var(--primary);
  font-weight: 500;
}
.auth-submit {
  width: 100%;
  justify-content: center;
  padding: 11px 16px;
  font-size: 15px;
}
.auth-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}
.auth-foot {
  margin: 4px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}
.auth-form.shake { animation: shake 0.45s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.timeline-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.timeline-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.timeline-card header h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}
.timeline-card header .count {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}
.timeline {
  position: relative;
  padding-left: 22px;
  margin: 0;
  list-style: none;
}
.timeline::before {
  content: "";
  position: absolute;
  top: 6px; bottom: 6px;
  left: 7px;
  width: 2px;
  background: var(--border);
  border-radius: 2px;
  transform-origin: top center;
  animation: draw-line 0.9s ease-out 0.15s both;
}
.step {
  position: relative;
  padding: 8px 0 8px;
  opacity: 0;
  animation: step-in 0.55s ease-out both;
}
.step + .step { border-top: 1px dashed var(--divider); }
.step .marker {
  position: absolute;
  left: -22px;
  top: 12px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border);
  box-shadow: 0 0 0 4px var(--surface);
  animation: marker-in 0.45s cubic-bezier(.2,.8,.2,1) both;
}
.step .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.step .name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.step .desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--bg-alt);
  white-space: nowrap;
}
.tag .pip {
  width: 6px; height: 6px; border-radius: 50%;
}
.step.done .marker { background: var(--success); border-color: var(--success); }
.step.done .tag { background: var(--success-soft); border-color: var(--success-border); color: var(--success-text); }
.step.done .tag .pip { background: var(--success); }
.step.now  .marker { background: var(--brand-yellow); border-color: var(--brand-yellow); }
.step.now  .tag { background: var(--brand-yellow-soft); border-color: var(--brand-yellow); color: var(--text); }
.step.now  .tag .pip { background: var(--primary); }
.step.next .marker { background: var(--surface); border-color: var(--border); }
.step.next .tag { background: var(--surface); border-color: var(--border); color: var(--text-muted); }
.step.next .tag .pip { background: var(--text-soft); }
/* Timeline stagger delays */
.timeline .step:nth-child(1) { animation-delay: 0.25s; }
.timeline .step:nth-child(2) { animation-delay: 0.45s; }
.timeline .step:nth-child(3) { animation-delay: 0.65s; }
.timeline .step:nth-child(4) { animation-delay: 0.85s; }
.timeline .step:nth-child(1) .marker { animation-delay: 0.30s; }
.timeline .step:nth-child(2) .marker { animation-delay: 0.50s; }
.timeline .step:nth-child(3) .marker { animation-delay: 0.70s; }
.timeline .step:nth-child(4) .marker { animation-delay: 0.90s; }

/* Pulse on the "now" marker */
.step.now .marker::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: var(--brand-yellow-pulse);
  animation: pulse-ring 2s ease-out infinite;
}

.footline {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 32px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--footer-bg);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(4px);
}
.footline code {
  font-family: 'Source Code Pro', monospace;
  font-size: 12px;
  color: var(--text);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: var(--r-sm);
  margin-left: 4px;
}

@media (max-width: 880px) {
  .container { grid-template-columns: 1fr; gap: 24px; }
  h1.title { font-size: 32px; }
  main { padding: 72px 18px 48px; }
  .nav-links a:not(.nav-login) { display: none; }
}
@media (max-height: 720px) {
  h1.title { font-size: 30px; margin-top: 10px; }
  p.lead { margin-bottom: 12px; }
  .timeline-card { padding: 16px; }
  .step { padding: 6px 0; }
}

/* --- Animations --- */
@keyframes step-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes marker-in {
  from { transform: scale(0.4); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
@keyframes draw-line {
  from { transform: scaleY(0); }
  to   { transform: scaleY(1); }
}
@keyframes pulse-ring {
  0%   { transform: scale(0.7); opacity: 0.8; }
  80%  { transform: scale(1.8); opacity: 0; }
  100% { transform: scale(1.8); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .bg-grid, .timeline::before, .timeline .step, .timeline .step .marker, .step.now .marker::after, .auth-card {
    animation: none !important; opacity: 1 !important; transform: none !important;
  }
  .step.now .marker::after { display: none; }
  .nav-login, .nav-login:hover, .nav-login .nav-icon-light, .nav-login:hover .nav-icon-light {
    transition: none !important; transform: none !important;
  }
}
