/*
 * Build My Plan.
 *
 * Day 1 is styled as a real BodyPlan session card — it has to look like the
 * product, because it is the product's output. Locked days are styled to read
 * as "already built, waiting in the app", not as censored text: they show
 * genuine metadata (title, focus, exercise count, duration) with placeholder
 * rows standing in for exercises the server never sent.
 */

/* ── Hero ───────────────────────────────────────────────────────────────── */
.bmp-hero-proof {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem;
  margin-top: 1.35rem; font-size: 0.86rem; font-weight: 600; color: var(--bpt-subtle);
}
.bmp-hero-proof strong { color: var(--bpt-ink); font-weight: 800; }
.bmp-dot { width: 3px; height: 3px; border-radius: 50%; background: #cbd5e1; }

/* Hidden on phones: the builder should be the first thing under the H1 there.
   Fixed phone aspect ratio with a top crop — the source screenshots are full
   phone-length, so an auto height would size off the image and overflow. */
.bmp-hero-media { position: relative; height: 24rem; display: none; }
@media (min-width: 900px) {
  .bmp-hero-media { display: block; }
  /* Wider than the shell's default media column: two offset phones need room to
     sit apart, otherwise the back one hides entirely behind the front one. */
  .bpt-header--stack { grid-template-columns: minmax(0, 1fr) 20rem; }
}
.bmp-device {
  position: absolute;
  width: 10.5rem; aspect-ratio: 9 / 19.5;
  border-radius: 1.4rem; overflow: hidden;
  background: #0a1220; border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 30px 60px -30px rgba(15, 23, 42, 0.65);
}
.bmp-device img {
  display: block; width: 100%; height: 100%;
  object-fit: cover; object-position: top center;
}
.bmp-device--back { top: 0; right: 1.5rem; transform: rotate(5deg); opacity: 0.92; }
.bmp-device--front { bottom: 0; left: 1.5rem; transform: rotate(-4deg); }

/* ── Stepper ────────────────────────────────────────────────────────────── */
.bmp-progress { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 1.25rem; }
.bmp-progress-bar { flex: 1; height: 4px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.bmp-progress-fill {
  height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, #3b82f6, #6366f1);
  transition: width 0.3s ease;
}
.bmp-progress-label {
  font-size: 0.75rem; font-weight: 700; color: var(--bpt-subtle);
  white-space: nowrap; letter-spacing: 0.02em;
}

.bmp-step[hidden] { display: none; }
.bmp-step-question {
  font-family: "Manrope", sans-serif; font-weight: 800;
  font-size: 1.2rem; letter-spacing: -0.02em; color: var(--bpt-ink);
}
.bmp-step-help { font-size: 0.87rem; color: var(--bpt-subtle); margin-top: 0.4rem; line-height: 1.55; }
.bmp-step-body { margin-top: 1.15rem; }

/* Big tap targets: this flow is almost entirely thumbs on a phone. */
.bmp-options { display: grid; gap: 0.6rem; }
.bmp-options--split { grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); }
.bmp-option { position: relative; }
.bmp-option input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.bmp-option-face {
  display: block; padding: 0.95rem 1.1rem; border-radius: 0.85rem;
  border: 1.5px solid #d8dee9; background: #fff; cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.bmp-option input:checked + .bmp-option-face {
  border-color: var(--bpt-accent); background: rgba(59, 130, 246, 0.06);
  box-shadow: 0 0 0 1px var(--bpt-accent);
}
.bmp-option input:focus-visible + .bmp-option-face { box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3); }
/* Both are <span>: without display:block the title and its description render on
   one line at two different sizes. */
.bmp-option-title { display: block; font-weight: 700; font-size: 0.97rem; color: var(--bpt-ink); }
.bmp-option-sub {
  display: block; font-size: 0.82rem; color: var(--bpt-subtle);
  margin-top: 0.2rem; line-height: 1.45;
}

.bmp-nav { display: flex; gap: 0.65rem; margin-top: 1.4rem; align-items: center; }
.bmp-back {
  background: none; border: none; padding: 0.6rem 0.4rem; cursor: pointer;
  font-family: inherit; font-size: 0.9rem; font-weight: 600; color: var(--bpt-subtle);
}
.bmp-back:hover { color: var(--bpt-ink); }
.bmp-next {
  flex: 1; border: none; cursor: pointer; padding: 0.9rem 1.5rem; border-radius: 0.8rem;
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
  color: #fff; font-size: 1rem; font-weight: 700; font-family: inherit;
  box-shadow: 0 14px 30px -14px rgba(99, 102, 241, 0.65);
  transition: filter 0.15s;
}
.bmp-next:hover:not(:disabled) { filter: brightness(1.07); }
.bmp-next:disabled { opacity: 0.6; cursor: progress; }

.bmp-optional-toggle {
  margin-top: 1rem; background: none; border: none; padding: 0; cursor: pointer;
  font-family: inherit; font-size: 0.85rem; font-weight: 600; color: var(--bpt-accent-strong);
}
.bmp-optional-fields { margin-top: 1.1rem; display: grid; gap: 1rem; }
.bmp-optional-fields[hidden] { display: none; }
.bmp-field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

/* ── Generating ─────────────────────────────────────────────────────────── */
/* Real progress for a real request — this is not a staged delay. */
.bmp-generating { text-align: center; padding: 3rem 1rem; }
.bmp-generating[hidden] { display: none; }
.bmp-spinner {
  width: 2.5rem; height: 2.5rem; margin: 0 auto; border-radius: 50%;
  border: 3px solid rgba(59, 130, 246, 0.2); border-top-color: var(--bpt-accent);
  animation: bmp-spin 0.8s linear infinite;
}
@keyframes bmp-spin { to { transform: rotate(360deg); } }
.bmp-generating p { margin-top: 1rem; font-size: 0.95rem; font-weight: 600; color: var(--bpt-muted); }
@media (prefers-reduced-motion: reduce) {
  .bmp-spinner { animation-duration: 2s; }
}

/* ── Plan summary ───────────────────────────────────────────────────────── */
.bmp-results[hidden] { display: none; }
.bmp-summary {
  border-radius: 1.25rem; padding: 1.6rem 1.4rem;
  background: linear-gradient(150deg, #0b1220 0%, #16233d 100%); color: #fff;
}
.bmp-summary-eyebrow {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.11em;
  text-transform: uppercase; color: #93c5fd;
}
.bmp-summary-title {
  font-family: "Sora", "Manrope", sans-serif; font-weight: 800;
  font-size: clamp(1.6rem, 5.5vw, 2.1rem); letter-spacing: -0.03em; margin-top: 0.35rem;
}
.bmp-summary-facts { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.1rem; }
.bmp-summary-fact {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: rgba(255, 255, 255, 0.09); border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9999px; padding: 0.4rem 0.85rem;
  font-size: 0.83rem; font-weight: 600; color: #e2e8f0;
}

/* ── Day 1 session card ─────────────────────────────────────────────────── */
.bmp-day { margin-top: 1.5rem; }
.bmp-day-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.bmp-day-index {
  font-size: 0.74rem; font-weight: 800; letter-spacing: 0.11em;
  text-transform: uppercase; color: var(--bpt-accent-strong);
}
.bmp-day-title {
  font-family: "Manrope", sans-serif; font-weight: 800;
  font-size: 1.35rem; letter-spacing: -0.025em; color: var(--bpt-ink); margin-top: 0.2rem;
}
.bmp-day-meta { font-size: 0.83rem; color: var(--bpt-subtle); font-weight: 600; }

.bmp-exercises {
  margin-top: 1rem; border: 1px solid var(--bpt-border); border-radius: 1rem;
  background: #fff; overflow: hidden;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02), 0 16px 40px -30px rgba(15, 23, 42, 0.4);
}
.bmp-exercise {
  display: flex; gap: 0.9rem; padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--bpt-border);
}
.bmp-exercise:last-child { border-bottom: none; }
.bmp-exercise-num {
  flex: 0 0 auto; width: 1.75rem; height: 1.75rem; border-radius: 0.55rem;
  background: rgba(59, 130, 246, 0.1); color: var(--bpt-accent-strong);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 800;
}
.bmp-exercise-body { flex: 1; min-width: 0; }
.bmp-exercise-name { font-weight: 700; font-size: 0.98rem; color: var(--bpt-ink); line-height: 1.35; }
.bmp-exercise-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.4rem; }
.bmp-tag {
  font-size: 0.72rem; font-weight: 600; color: var(--bpt-subtle);
  background: #f1f5f9; border-radius: 0.4rem; padding: 0.2rem 0.45rem;
}
.bmp-exercise-rx {
  margin-top: 0.5rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1rem;
  font-size: 0.86rem; color: var(--bpt-muted);
}
.bmp-exercise-rx b { color: var(--bpt-ink); font-weight: 700; }
.bmp-exercise-cue { margin-top: 0.4rem; font-size: 0.8rem; color: var(--bpt-subtle); line-height: 1.5; }

/* ── Locked days ────────────────────────────────────────────────────────── */
.bmp-locked { margin-top: 1rem; }
.bmp-locked-card {
  position: relative; border: 1px solid var(--bpt-border); border-radius: 1rem;
  background: #fff; padding: 1.15rem 1.2rem; margin-top: 0.75rem; overflow: hidden;
}
.bmp-locked-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }
.bmp-locked-lock {
  flex: 0 0 auto; width: 1.9rem; height: 1.9rem; border-radius: 0.6rem;
  background: #f1f5f9; color: var(--bpt-subtle);
  display: inline-flex; align-items: center; justify-content: center;
}
.bmp-locked-lock svg { width: 0.95rem; height: 0.95rem; }
.bmp-locked-meta {
  display: flex; flex-wrap: wrap; gap: 0.4rem 0.9rem; margin-top: 0.55rem;
  font-size: 0.83rem; color: var(--bpt-subtle); font-weight: 600;
}
.bmp-locked-focus { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.75rem; }
.bmp-locked-focus .bmp-tag { background: rgba(59, 130, 246, 0.08); color: var(--bpt-accent-strong); }

/*
 * Placeholder rows. These are empty bars — there is no exercise text underneath
 * them, because the server never sent any. They communicate "N sessions are
 * built and waiting" rather than pretending to hide readable content.
 */
.bmp-locked-rows { margin-top: 0.9rem; display: grid; gap: 0.5rem; }
.bmp-locked-row { display: flex; align-items: center; gap: 0.65rem; }
.bmp-locked-dot { flex: 0 0 auto; width: 1.4rem; height: 1.4rem; border-radius: 0.4rem; background: #eef2f7; }
.bmp-locked-bar { height: 0.6rem; border-radius: 999px; background: #eef2f7; }
.bmp-locked-bar--long { flex: 1; }
.bmp-locked-bar--short { width: 3.5rem; flex: 0 0 auto; }
.bmp-locked-card::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4.5rem;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff 85%);
  pointer-events: none;
}
.bmp-locked-cta {
  position: relative; z-index: 1; margin-top: 0.9rem;
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.82rem; font-weight: 700; color: var(--bpt-accent-strong);
}
.bmp-locked-cta svg { width: 0.85rem; height: 0.85rem; }

.bmp-restart {
  margin-top: 1.5rem; background: none; border: none; padding: 0; cursor: pointer;
  font-family: inherit; font-size: 0.87rem; font-weight: 600; color: var(--bpt-accent-strong);
}
.bmp-restart:hover { text-decoration: underline; }
