/* my.css — customer job-tracker portal. Mobile-first; reuses site.css tokens
   (--navy, --sky, --line, shadows, Barlow). Loaded only on /my. */

.my-stage { padding: clamp(20px, 5vw, 44px) 0 72px; }
#my-app { max-width: 620px; margin: 0 auto; }
#my-app[data-loading] { color: var(--ink-soft); padding: 40px 0; text-align: center; }

.my-h1 { font-family: var(--font-body); font-weight: 800; font-size: clamp(24px, 6vw, 34px); letter-spacing: -0.02em; color: var(--ink); }
.my-h2 { font-family: var(--font-body); font-weight: 700; font-size: 15px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); margin: 22px 0 10px; }
.my-sub { color: var(--ink-soft); margin: 8px 0 18px; line-height: 1.5; }

.my-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-rest);
  padding: clamp(18px, 4vw, 26px);
  margin-bottom: 14px;
}

/* ---- login ---- */
.my-login { margin-top: 8px; }
.my-form { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.my-input {
  width: 100%;
  font: inherit; font-size: 17px;
  padding: 14px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-btn);
  background: var(--sky-100);
  color: var(--ink);
}
.my-input:focus { outline: none; border-color: var(--navy); background: var(--white); }
.my-code { text-align: center; letter-spacing: 0.4em; font-size: 26px; font-weight: 700; }

.my-btn {
  display: inline-block; width: 100%;
  font: inherit; font-weight: 700; font-size: 17px;
  text-align: center; text-decoration: none;
  padding: 14px 18px;
  border: none; border-radius: var(--r-btn);
  background: var(--navy); color: #fff;
  cursor: pointer;
}
.my-btn:hover { background: var(--navy-700); }
.my-btn:disabled { opacity: 0.6; cursor: default; }

.my-link {
  display: inline-block; margin-top: 14px;
  background: none; border: none; padding: 6px 0;
  color: var(--navy); font: inherit; font-weight: 600; font-size: 15px;
  cursor: pointer; text-decoration: underline;
}
.my-err { color: var(--err); font-size: 14.5px; min-height: 1.2em; font-weight: 600; }

/* ---- job list ---- */
.my-listhead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.my-joblist { display: flex; flex-direction: column; gap: 10px; }
.my-job {
  display: block; text-decoration: none; color: inherit;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-rest);
  padding: 16px 18px;
  transition: box-shadow .15s ease, transform .15s ease;
}
.my-job:hover { box-shadow: var(--shadow-card); transform: translateY(-1px); }
.my-job-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.my-job-svc { font-weight: 700; font-size: 17px; color: var(--ink); }
.my-job-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 6px; color: var(--ink-soft); font-size: 14.5px; }
.my-dot::before { content: '•'; margin-right: 8px; color: var(--line); }
.my-eta { margin-top: 10px; font-weight: 700; color: var(--navy); }
.my-note { color: var(--ink-soft); line-height: 1.5; margin-top: 6px; }

/* ---- status badges ---- */
.my-badge { display: inline-block; font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: var(--r-chip); white-space: nowrap; }
.st-scheduled { background: var(--sky-100); color: var(--navy); }
.st-otw       { background: #fff2d6; color: #8a5a00; }
.st-arrived   { background: #e4ecfb; color: var(--navy-bright); }
.st-inprog    { background: #dff0ff; color: #1c5a8a; }
.st-done      { background: #d9f0e2; color: var(--success); }
.st-cancel    { background: #f3e2e0; color: var(--err); }

/* ---- DoorDash-style tracker ---- */
.my-track {
  display: flex; justify-content: space-between; position: relative;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card);
  box-shadow: var(--shadow-rest); padding: 22px 14px 16px; margin-bottom: 14px;
}
.my-track::before {
  content: ''; position: absolute; top: 30px; left: 32px; right: 32px; height: 3px;
  background: var(--line); border-radius: 2px; z-index: 0;
}
.my-track-step { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.my-track-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--white); border: 3px solid var(--line); }
.my-track-step.on .my-track-dot { background: var(--navy); border-color: var(--navy); }
.my-track-step.now .my-track-dot { box-shadow: 0 0 0 4px rgba(30,58,95,.18); }
.my-track-label { font-size: 11.5px; font-weight: 600; color: var(--ink-soft); text-align: center; line-height: 1.2; }
.my-track-step.on .my-track-label { color: var(--ink); }

/* ---- steps checklist ---- */
.my-steps { list-style: none; margin: 0; padding: 0; }
.my-step { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.my-step:last-child { border-bottom: none; }
.my-step-check { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); flex: none; position: relative; }
.my-step.done .my-step-check { background: var(--success); border-color: var(--success); }
.my-step.done .my-step-check::after { content: '✓'; color: #fff; font-size: 13px; font-weight: 700; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.my-step-label { color: var(--ink-soft); }
.my-step.done .my-step-label { color: var(--ink); }

/* ---- media ---- */
.my-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.my-media-item { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }

/* ---- phase 2: state-driven job screen ---- */
.tk-host { min-height: 200px; }
.tk-loading { color: var(--ink-soft); text-align: center; padding: 40px 0; }
.tk-state { text-align: center; }
/* mascot art as a clean floating header illustration — no box, no border, just
   the transparent PNG centered (the art self-frames) */
.tk-hero {
  display: block; width: 100%; max-width: 240px; height: auto;
  margin: 0 auto; object-fit: contain;
}
.tk-h1 { font-family: var(--font-body); font-weight: 800; font-size: clamp(23px, 6vw, 33px); letter-spacing: -0.02em; margin-top: 16px; }
.tk-sub { color: var(--ink-soft); margin-top: 6px; }
.tk-hint { color: var(--ink-soft); font-size: 14.5px; margin-top: 14px; }
.tk-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin-top: 12px; color: var(--ink-soft); font-size: 14.5px; }
.tk-svc { font-weight: 700; color: var(--ink); }

/* on-the-way road + moving van (NOT a map): HQ emblem → house emblem, van rides
   the dashed centerline; position is time-based (see my.js) */
.tk-road {
  position: relative; height: 138px; margin: 22px 0 10px;
  background: linear-gradient(180deg, #eaf1fa 0%, var(--sky-100) 100%);
  border: 1px solid var(--line); border-radius: 20px; overflow: hidden;
  box-shadow: var(--shadow-rest);
}
.tk-road::before { /* asphalt band */
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 48px;
  background: #d6e2f0;
}
.tk-road::after { /* dashed centerline */
  content: ''; position: absolute; left: 9%; right: 9%; bottom: 21px; height: 4px;
  background: repeating-linear-gradient(90deg, #fff 0 16px, transparent 16px 32px);
  border-radius: 2px;
}
.tk-road-hq, .tk-road-house {
  position: absolute; bottom: 14px; width: 60px; height: 60px; object-fit: contain; z-index: 1;
  filter: drop-shadow(0 3px 5px rgba(20,22,26,.18));
}
.tk-road-hq { left: 12px; }
.tk-road-house { right: 12px; }
.tk-van {
  position: absolute; bottom: 20px; left: 14%; width: 96px; height: auto; z-index: 2;
  transform: translateX(-50%); transition: left 1s linear;
  filter: drop-shadow(0 4px 5px rgba(20,22,26,.22));
}
@media (prefers-reduced-motion: reduce) { .tk-van { transition: none; } }
.tk-away { font-weight: 800; color: var(--navy); font-size: 19px; margin-top: 4px; }

/* in-progress progress bar */
.tk-progress-label { font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.tk-progress { height: 12px; background: var(--sky-100); border-radius: 999px; overflow: hidden; box-shadow: inset 0 1px 2px rgba(20,22,26,.08); }
.tk-progress-fill { height: 100%; background: linear-gradient(90deg, var(--success), #37a06a); border-radius: 999px; transition: width .5s cubic-bezier(.22,1,.36,1); }
.my-steps { text-align: left; margin-top: 14px; }
.my-step.current { font-weight: 700; }
.my-step.current .my-step-check { border-color: var(--navy); box-shadow: 0 0 0 4px rgba(30,58,95,.14); }
.my-step-time { margin-left: auto; font-size: 13px; color: var(--ink-soft); }

/* completed */
.tk-badge { width: 118px; height: 118px; object-fit: contain; margin: 2px auto 0; display: block; filter: drop-shadow(0 6px 12px rgba(30,58,95,.28)); }
.tk-soon { text-align: left; opacity: .85; }

/* ---- phase 3: portal nav, media strips, gallery, lightbox, photos tab ---- */
.my-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.my-nav-btn { font: inherit; font-weight: 700; font-size: 14.5px; padding: 8px 14px; border: 1.5px solid var(--line); border-radius: var(--r-chip); background: #fff; color: var(--ink-soft); cursor: pointer; transition: background .12s, border-color .12s, color .12s; }
.my-nav-btn:hover { border-color: var(--sky-deep); color: var(--ink); }
.my-nav-btn.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.my-nav-out { margin-left: auto; margin-top: 0; }

/* media thumbnail strips (in-progress, under steps) */
.tk-strip { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.tk-thumb { position: relative; width: 84px; height: 84px; padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--sky-100); cursor: pointer; }
.tk-thumb-media { width: 100%; height: 100%; object-fit: cover; display: block; }
.tk-thumb-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 22px; text-shadow: 0 1px 6px rgba(0,0,0,.6); }
.my-step-row { display: flex; align-items: center; gap: 12px; }
.my-step > .tk-strip { padding-left: 32px; }

/* completed gallery reuses .my-media grid; thumbs are buttons */
.my-media .tk-thumb { width: 100%; height: auto; aspect-ratio: 1; }

/* lightbox */
.tk-lightbox { position: fixed; inset: 0; z-index: 1000; background: rgba(10,12,16,.88); display: flex; align-items: center; justify-content: center; padding: 20px; }
.tk-lightbox-stage { max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.tk-lightbox-media { max-width: 100%; max-height: 78vh; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.tk-lightbox-cap { color: #fff; font-size: 15px; text-align: center; max-width: 640px; }
.tk-lightbox-bar { display: flex; gap: 10px; }
.tk-lightbox-btn { font: inherit; font-weight: 700; font-size: 15px; padding: 10px 18px; border-radius: var(--r-btn); border: 1.5px solid rgba(255,255,255,.4); background: rgba(255,255,255,.12); color: #fff; text-decoration: none; cursor: pointer; }
.tk-lightbox-btn:hover { background: rgba(255,255,255,.22); }

/* photos tab */
.my-photo-job { display: block; text-decoration: none; color: var(--navy); font-weight: 700; margin-bottom: 8px; }
.my-photo-date { text-decoration: underline; }
.my-photo-svc { font-weight: 700; color: var(--ink-soft); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; margin: 12px 0 8px; }

/* ---- phase 4: punch card, receipts, book again ---- */
.punch-card { text-align: center; }
.punch-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(58px, 1fr)); gap: 12px; margin: 8px auto 16px; max-width: 400px; }
.punch-slot { aspect-ratio: 1; border: 2px dashed var(--sky-deep); border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--sky-100); }
.punch-slot.on { border: none; background: none; }
.punch-stamp { width: 100%; height: 100%; object-fit: contain; }
.punch-num { color: var(--navy); font-weight: 800; font-size: 18px; opacity: .45; }
.punch-msg { font-weight: 700; color: var(--navy); font-size: 16px; }
.punch-pop { animation: punchPop .6s cubic-bezier(.2,1.4,.5,1) both; }
@keyframes punchPop { 0% { transform: scale(0) rotate(-18deg); opacity: 0; } 60% { transform: scale(1.25) rotate(6deg); } 100% { transform: scale(1) rotate(0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .punch-pop { animation: none; } }

.my-book-again { margin-top: 6px; }
.my-receipt-link { font-weight: 700; color: var(--navy); text-decoration: underline; font-size: 15px; }
.my-receipt-dl { margin-left: auto; color: var(--navy); text-decoration: underline; font-weight: 600; }

/* ---- dev mode: OTP bypass banner ---- */
.my-devbanner { background: #a3231b; color: #fff; font-weight: 800; text-align: center; padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; letter-spacing: .02em; box-shadow: var(--shadow-rest); }
