/* Keep Moving campaign — styles. Matches the existing Speed+ campaign look
   (dark ground, #BFFF00 accent, Teko headers, Inter body) without touching
   any shared theme CSS. */

#keepmoving-app {
  --km-bg: #ffffff;
  --km-card: #f5f5f4;
  --km-border: #e5e5e5;
  --km-accent: #BFFF00;
  /* Same accent hue, darkened for use as TEXT on the light cards/page —
     pure #BFFF00 text has poor contrast on white/light-gray (it only
     reads well on the dark passport card, which keeps using --km-accent
     directly). Matches the darker lime (#9ecc00) already used for
     text-on-white elsewhere on the main site (e.g. sp-news-card__date). */
  --km-accent-text: #9ecc00;
  --km-text: #0d0d0d;
  --km-muted: #666666;
  --km-danger: #ff4444;

  background:
    radial-gradient(720px 420px at 50% 0%, rgba(191,255,0,0.08), transparent 70%),
    var(--km-bg);
  color: var(--km-text);
  min-height: 100vh;
  padding: clamp(32px, 8vh, 88px) 20px clamp(64px, 12vh, 120px);
  font-family: 'Inter', sans-serif;
  box-sizing: border-box;
}
#keepmoving-app *, #keepmoving-app *:before, #keepmoving-app *:after { box-sizing: border-box; }

#keepmoving-app .km-shell { max-width: min(520px, 100%); margin: 0 auto; }

#keepmoving-app h1, #keepmoving-app h2, #keepmoving-app h3 {
  font-family: 'Teko', sans-serif;
  letter-spacing: 2px;
  color: var(--km-text);
  margin: 0 0 8px;
  text-transform: uppercase;
}
#keepmoving-app h1 { font-size: 2.4rem; }
#keepmoving-app h2 { font-size: 1.8rem; }
#keepmoving-app p { color: var(--km-muted); line-height: 1.6; margin: 0 0 16px; font-size: 14px; }

/* Register screen — lanyard + form. Stacked on mobile (lanyard above form,
   since there's no room for two columns); side-by-side on wider screens
   (lanyard left, form right), matching the reference layout. */
#keepmoving-app .km-shell-wide { max-width: min(1120px, 100%); }

#keepmoving-app .km-register-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
#keepmoving-app .km-lanyard-stage {
  position: relative;
  overflow: hidden;
  height: min(760px, 92vh);
  width: 100%;
  margin: 4px 0 0;
  cursor: grab;
  /* No touch-action: none here on purpose — see Lanyard.css for why. */
}
@media (min-width: 760px) {
  #keepmoving-app .km-register-grid {
    flex-direction: row;
    align-items: stretch;
    gap: 28px;
  }
  #keepmoving-app .km-register-grid .km-lanyard-stage {
    flex: 1 1 50%;
    height: auto;
    min-height: 880px;
    margin: 0;
  }
  #keepmoving-app .km-register-form {
    flex: 1 1 50%;
    margin-bottom: 0;
  }
}
#keepmoving-app .km-lanyard-stage:active { cursor: grabbing; }
#keepmoving-app .km-lanyard-stage canvas { display: block; width: 100% !important; height: 100% !important; }

#keepmoving-app .km-view[hidden] { display: none !important; }

#keepmoving-app .km-card {
  background: var(--km-card);
  border: 1px solid var(--km-border);
  border-radius: 10px;
  padding: 24px 20px;
  margin-bottom: 16px;
}

#keepmoving-app .km-label {
  display: block;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--km-muted);
  margin: 14px 0 6px;
}
#keepmoving-app .km-input {
  width: 100%;
  padding: 13px 14px;
  background: var(--km-bg);
  border: 1px solid var(--km-border);
  color: var(--km-text);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  border-radius: 6px;
  outline: none;
}
#keepmoving-app .km-input:focus { border-color: var(--km-accent); }
#keepmoving-app .km-photo-upload {
  width: 96px;
  height: 96px;
  border-radius: 10px;
  border: 1px dashed var(--km-border);
  background: var(--km-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  margin-bottom: 4px;
  transition: border-color 0.2s;
}
#keepmoving-app .km-photo-upload:hover { border-color: var(--km-accent); }
#keepmoving-app .km-photo-preview-img { width: 100%; height: 100%; object-fit: cover; display: block; }
#keepmoving-app .km-photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--km-muted);
}
#keepmoving-app .km-photo-placeholder svg { width: 34px; height: 34px; }
#keepmoving-app .km-photo-placeholder span { font-size: 9px; letter-spacing: 0.5px; text-align: center; padding: 0 4px; }
#keepmoving-app .km-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 16px;
  font-size: 11px;
  line-height: 1.5;
  color: #666666;
}
#keepmoving-app .km-checkbox-row input { margin-top: 2px; accent-color: var(--km-accent); }

#keepmoving-app .km-btn {
  display: block;
  width: 100%;
  padding: 14px;
  background: var(--km-accent);
  color: #0d0d0d;
  border: 1px solid var(--km-accent);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 6px;
  transition: opacity 0.2s;
}
#keepmoving-app .km-btn:disabled { opacity: 0.4; cursor: not-allowed; }
#keepmoving-app .km-btn-outline {
  display: block;
  width: 100%;
  padding: 14px;
  background: transparent;
  color: var(--km-accent-text);
  border: 1px solid var(--km-accent-text);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 6px;
  transition: opacity 0.2s;
}
#keepmoving-app .km-btn-outline:disabled { opacity: 0.4; cursor: not-allowed; }
#keepmoving-app .km-btn-ghost {
  background: transparent;
  border: none;
  color: var(--km-muted);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  padding: 10px;
  width: 100%;
}
#keepmoving-app .km-strava-card { padding: 16px 20px; }
#keepmoving-app .km-strava-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
}
#keepmoving-app .km-strava-row .km-btn-ghost { width: auto; padding: 8px 12px; }
#keepmoving-app .km-strava-label { display: flex; align-items: center; gap: 8px; }
#keepmoving-app .km-strava-logo { height: 14px; width: auto; display: block; }

#keepmoving-app .km-error {
  color: var(--km-danger);
  font-size: 12px;
  margin: 12px 0 0;
  text-align: center;
}

/* Movement ID passport — a real ID card now: one of four tier background
   photos (Club/Plus/Pro/Elite — already has the SPEED+ logo and the
   tier-colored glow baked in from the source art) with the photo, ID
   info and barcode laid over it via percentage-based absolute
   positioning, so it scales cleanly at any card width. Locked to the
   source art's own aspect ratio (1058:717) so the overlay percentages
   stay accurate regardless of how wide .km-shell renders. Text here is
   intentionally always light — the card art is always a dark photo
   background regardless of the page's own light theme, same reasoning
   the old dark-passport-card had. */
#keepmoving-app .km-passport {
  position: relative;
  width: 100%;
  aspect-ratio: 1058 / 717;
  border-radius: 14px;
  overflow: hidden;
  background-color: var(--km-bg);
  background-size: cover;
  background-position: center;
  margin-bottom: 24px;
  color: #ffffff;
}
#keepmoving-app .km-passport-photo {
  position: absolute;
  left: 8%;
  top: 12%;
  width: 28%;
  height: 46%;
  background: #f5f5f4;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999999;
  cursor: pointer;
}
#keepmoving-app .km-passport-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
#keepmoving-app .km-passport-photo svg { width: 42%; height: 42%; }
#keepmoving-app .km-passport-name {
  position: absolute;
  left: 8%;
  top: 61%;
  width: 28%;
  text-align: center;
  font-weight: 700;
  font-size: clamp(10px, 3vw, 15px);
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#keepmoving-app .km-passport-barcode {
  position: absolute;
  left: 8%;
  top: 70%;
  width: 28%;
  height: 13%;
}
#keepmoving-app .km-passport-barcode canvas { width: 100%; height: 100%; display: block; }
#keepmoving-app .km-passport-info {
  position: absolute;
  left: 41%;
  top: 15%;
  width: 54%;
}
#keepmoving-app .km-passport-eyebrow {
  font-size: clamp(8px, 2vw, 11px);
  letter-spacing: 2px;
  color: var(--km-accent);
  text-transform: uppercase;
  margin-bottom: 4px;
}
#keepmoving-app .km-passport-id {
  font-family: 'Teko', sans-serif;
  font-size: clamp(1.3rem, 8vw, 2.5rem);
  letter-spacing: 2px;
  color: #ffffff;
  line-height: 1;
  margin: 2px 0 6px;
}
#keepmoving-app .km-passport-since {
  font-size: clamp(7px, 1.8vw, 10px);
  color: #aaaaaa;
  letter-spacing: 1px;
  text-transform: uppercase;
}
#keepmoving-app .km-passport-divider {
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  margin: 8% 0;
}
#keepmoving-app .km-passport-points {
  display: flex;
  gap: 12%;
}
#keepmoving-app .km-passport-tier-block {
  position: absolute;
  /* Aligned with the SPEED+ logo's right edge — the source art's visible
     black card doesn't quite reach the full canvas edge (there's a
     transparent bleed margin baked in, ~4% each side), so this stays a
     little inside that boundary rather than exactly at the logo's own
     edge — right at it put white text over the transparent margin,
     where it visually disappeared against the page's white background. */
  right: 5%;
  /* Barcode spans top:70% + height:13%, so its bottom edge sits 17% up
     from the card's bottom edge — match that exactly here. */
  bottom: 17%;
  width: 32%;
  text-align: right;
}
#keepmoving-app .km-passport-tier-name {
  font-family: 'Teko', sans-serif;
  font-weight: 700;
  font-size: clamp(1.1rem, 5.5vw, 1.9rem);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #ffffff;
  line-height: 1;
  margin-bottom: 6px;
}
#keepmoving-app .km-passport-tier-bar {
  width: 100%;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
}
#keepmoving-app .km-passport-tier-bar-fill {
  height: 100%;
  background: var(--km-accent);
  border-radius: 3px;
}
#keepmoving-app .km-passport .km-stat-value { color: #ffffff; }
#keepmoving-app .km-stat-value { font-family: 'Teko', sans-serif; font-size: clamp(1rem, 4.5vw, 1.7rem); color: var(--km-accent); line-height: 1; }
#keepmoving-app .km-stat-label { font-size: clamp(7px, 1.8vw, 10px); color: var(--km-muted); letter-spacing: 1px; text-transform: uppercase; margin-top: 2px; }
/* Challenge list */
#keepmoving-app .km-challenge {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
#keepmoving-app .km-challenge-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; color: var(--km-text); }
#keepmoving-app .km-challenge-meta { font-size: 12px; color: var(--km-muted); }
#keepmoving-app .km-points-pill {
  flex-shrink: 0;
  background: rgba(191,255,0,0.12);
  color: var(--km-accent-text);
  font-family: 'Teko', sans-serif;
  font-size: 1.1rem;
  letter-spacing: 1px;
  padding: 6px 12px;
  border-radius: 20px;
  white-space: nowrap;
}

/* Status badges */
#keepmoving-app .km-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 20px;
}
#keepmoving-app .km-badge-pending { background: rgba(13,13,13,0.08); color: #666666; }
#keepmoving-app .km-badge-approved { background: rgba(191,255,0,0.15); color: var(--km-accent-text); }
#keepmoving-app .km-badge-rejected { background: rgba(255,68,68,0.15); color: var(--km-danger); }

/* Leaderboard — rank icon, colored avatar initials, name, movee total.
   Top 3 get a medal in place of the rank number. */
#keepmoving-app .km-lb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--km-border);
}
#keepmoving-app .km-lb-row:last-child { border-bottom: none; }
#keepmoving-app .km-lb-rank,
#keepmoving-app .km-lb-medal {
  width: 24px;
  flex-shrink: 0;
  text-align: center;
  font-family: 'Teko', sans-serif;
  font-size: 1.3rem;
  color: var(--km-muted);
}
#keepmoving-app .km-lb-medal { font-size: 1.2rem; line-height: 1; }
#keepmoving-app .km-lb-avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
}
#keepmoving-app .km-lb-row.km-lb-me .km-lb-rank,
#keepmoving-app .km-lb-row.km-lb-me .km-lb-name,
#keepmoving-app .km-lb-row.km-lb-me .km-lb-points { color: var(--km-accent-text); }
#keepmoving-app .km-lb-name { flex: 1; font-size: 14px; font-weight: 600; }
#keepmoving-app .km-lb-you { font-weight: 400; color: var(--km-muted); }
#keepmoving-app .km-lb-points {
  font-family: 'Teko', sans-serif;
  font-size: 1.3rem;
  letter-spacing: 0.5px;
  color: var(--km-text);
  white-space: nowrap;
}
#keepmoving-app .km-lb-points-unit { font-family: 'Inter', sans-serif; font-size: 10px; font-weight: 600; color: var(--km-muted); letter-spacing: 1px; }

/* Nav / tabs at bottom of unlocked views */
#keepmoving-app .km-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
#keepmoving-app .km-tab {
  flex: 1 1 30%;
  min-width: 90px;
  text-align: center;
  padding: 10px;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--km-muted);
  border: 1px solid var(--km-border);
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
}
#keepmoving-app .km-tab.km-tab-active { color: #0d0d0d; background: var(--km-accent); border-color: var(--km-accent); }

#keepmoving-app .km-empty { text-align: center; color: var(--km-muted); font-size: 13px; padding: 30px 0; }

#keepmoving-app .km-proof-preview {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 8px;
  margin-top: 10px;
  border: 1px solid var(--km-border);
}

#keepmoving-app .km-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s;
  z-index: 10000;
  max-width: 90vw;
}
#keepmoving-app .km-toast.km-toast-show { opacity: 1; transform: translateX(-50%) translateY(0); }
#keepmoving-app .km-toast.km-toast-err { border-color: var(--km-danger); color: var(--km-danger); }

/* Events */
#keepmoving-app .km-event-poster {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 14px;
}
#keepmoving-app .km-muted-text { font-size: 12px; color: var(--km-muted); }

/* Rewards — wallet + section headers */
#keepmoving-app .km-section-title {
  font-family: 'Teko', sans-serif;
  letter-spacing: 2px;
  font-size: 1.3rem;
  color: var(--km-text);
  text-transform: uppercase;
  margin: 22px 0 12px;
}
#keepmoving-app .km-wallet-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: #666666;
}
#keepmoving-app .km-wallet-value {
  font-family: 'Teko', sans-serif;
  font-size: 2rem;
  color: var(--km-accent-text);
  line-height: 1;
}

/* My Vouchers — compact claimed-code stubs */
#keepmoving-app .km-my-voucher { padding: 16px 20px; }
#keepmoving-app .km-voucher-code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--km-border);
}
#keepmoving-app .km-voucher-code {
  font-family: 'Teko', sans-serif;
  font-size: 1.2rem;
  letter-spacing: 2px;
  color: var(--km-accent-text);
}
#keepmoving-app .km-voucher-code-row .km-btn-ghost { width: auto; padding: 6px 10px; }

/* Voucher ticket — Shopee-style stub card: logo stub | details | redeem action */
#keepmoving-app .km-voucher-ticket {
  display: flex;
  align-items: stretch;
  background: var(--km-card);
  border: 1px solid var(--km-border);
  border-radius: 12px;
  margin-bottom: 14px;
  position: relative;
}
#keepmoving-app .km-voucher-stub {
  flex: 0 0 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: var(--km-accent);
  border-radius: 12px 0 0 12px;
  border-right: 2px dashed rgba(13, 13, 13, 0.35);
  position: relative;
}
#keepmoving-app .km-voucher-stub::before,
#keepmoving-app .km-voucher-stub::after {
  content: "";
  position: absolute;
  right: -9px;
  width: 18px;
  height: 18px;
  background: var(--km-bg);
  border-radius: 50%;
  z-index: 1;
}
#keepmoving-app .km-voucher-stub::before { top: -9px; }
#keepmoving-app .km-voucher-stub::after { bottom: -9px; }
#keepmoving-app .km-voucher-logo { width: 52px; height: auto; display: block; filter: brightness(0); }
#keepmoving-app .km-voucher-body {
  flex: 1 1 auto;
  min-width: 0;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
#keepmoving-app .km-voucher-eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--km-accent-text);
  text-transform: uppercase;
  margin-bottom: 2px;
}
#keepmoving-app .km-voucher-title {
  font-family: 'Teko', sans-serif;
  font-size: 1.5rem;
  letter-spacing: 1px;
  color: var(--km-text);
  line-height: 1.15;
  text-transform: uppercase;
}
#keepmoving-app .km-voucher-desc { font-size: 11px; margin: 3px 0 0; color: #666666; }
#keepmoving-app .km-voucher-points {
  font-family: 'Teko', sans-serif;
  font-size: 1rem;
  letter-spacing: 1px;
  color: var(--km-text);
  opacity: 0.7;
  margin-top: 6px;
}
#keepmoving-app .km-voucher-action {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  padding: 10px 14px 10px 4px;
}
#keepmoving-app .km-voucher-redeem-btn {
  width: 76px;
  padding: 8px 6px;
  background: var(--km-accent);
  color: #0d0d0d;
  border: 1px solid var(--km-accent);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 6px;
  white-space: normal;
  line-height: 1.25;
}
#keepmoving-app .km-voucher-redeem-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* v43 — tier progress hint under the passport bar ("N more movee to Plus") */
#keepmoving-app .km-passport-tier-hint {
  margin-top: 5px;
  font-size: clamp(7px, 1.8vw, 10px);
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #cccccc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* v43 — name on the card is tappable to edit */
#keepmoving-app .km-passport-name { cursor: pointer; }
#keepmoving-app .km-passport-name-edit {
  font-size: 0.75em;
  margin-left: 4px;
  opacity: 0.6;
  vertical-align: top;
}
#keepmoving-app .km-name-edit { margin-top: -8px; }

/* v44 — tier perks strip under the Strava block (vouchers for this tier only) */
#keepmoving-app .km-promo-card { padding: 14px 16px 6px; }
#keepmoving-app .km-promo-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
#keepmoving-app .km-promo-eyebrow { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--km-accent-text); font-weight: 700; }
#keepmoving-app .km-promo-all { width: auto; padding: 6px 0; font-size: 10px; }
#keepmoving-app .km-promo-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px dashed var(--km-border); }
#keepmoving-app .km-promo-icon { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 8px; background: var(--km-accent); display: flex; align-items: center; justify-content: center; }
#keepmoving-app .km-promo-icon .km-voucher-icon { width: 22px; height: 22px; }
#keepmoving-app .km-promo-icon .km-voucher-logo { width: 28px; }
#keepmoving-app .km-promo-body { flex: 1 1 auto; min-width: 0; }
#keepmoving-app .km-promo-title { font-family: 'Teko', sans-serif; font-size: 1.2rem; letter-spacing: 1px; text-transform: uppercase; color: var(--km-text); line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#keepmoving-app .km-promo-meta { font-size: 11px; color: var(--km-muted); margin-top: 2px; }

/* v43 — leaderboard avatar shows the member's photo when they have one */
#keepmoving-app .km-lb-avatar-photo { overflow: hidden; background: var(--km-border); }
#keepmoving-app .km-lb-avatar-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* v43 — choosable stub icon (gift / discount / shirt …) in place of the logo */
#keepmoving-app .km-voucher-icon { width: 34px; height: 34px; color: #0d0d0d; display: block; }

/* v43 — voucher restricted to specific tiers */
#keepmoving-app .km-voucher-tier {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(13, 13, 13, 0.08);
  color: var(--km-text);
  font-size: 9px;
  letter-spacing: 1px;
}
