/* ==========================================================================
   Workout Vending Machine
   ========================================================================== */

.app {
  min-height: 100dvh;
  background:
    radial-gradient(60% 40% at 100% 0%, rgba(56, 189, 248, 0.22), transparent 70%),
    radial-gradient(50% 35% at 0% 10%, rgba(186, 230, 253, 0.6), transparent 70%),
    linear-gradient(180deg, var(--sky-50) 0%, #fff 55%);
  background-attachment: fixed;
}

.app-wrap { width: min(680px, 100% - 28px); margin-inline: auto; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(240, 249, 255, 0.75);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid rgba(186, 230, 253, 0.6);
}
.app-header-inner { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.app-header .brand img { height: 46px; width: auto; }

.date-chip { padding: 7px 13px; border-radius: 999px; background: #fff; border: 1px solid var(--sky-100); font-size: 0.82rem; font-weight: 650; color: var(--sky-700); box-shadow: var(--shadow-1); white-space: nowrap; }

.intro { text-align: center; margin: 30px auto 24px; max-width: 30em; }
.intro p { margin: 0; }
.app-title {
  font-family: var(--font-display);
  font-stretch: 112%;
  font-weight: 850;
  font-size: clamp(2rem, 8vw, 2.9rem);
  line-height: 1;
  letter-spacing: -0.04em;
  margin: 0 0 12px;
}

/* ---------- The machine ---------- */

.vm {
  position: relative;
  max-width: 620px;
  margin-inline: auto;
  padding: 16px;
  border-radius: 34px;
  background: linear-gradient(160deg, var(--sky-400) 0%, var(--sky-500) 45%, var(--sky-700) 100%);
  box-shadow: var(--shadow-2), inset 0 2px 0 rgba(255, 255, 255, 0.4), inset 0 -3px 0 rgba(0, 0, 0, 0.12);
}
.vm::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(105deg, rgba(255, 255, 255, 0.22), transparent 30%);
  pointer-events: none;
}

.vm-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 14px; }
.vm-logo { font-family: var(--font-display); font-stretch: 120%; font-weight: 850; font-size: 0.82rem; line-height: 1.05; letter-spacing: 0.06em; text-transform: uppercase; color: #fff; }
.vm-lights { display: flex; gap: 6px; }
.vm-lights i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, 0.35); animation: lights 1.8s infinite; }
.vm-lights i:nth-child(2) { animation-delay: 0.3s; }
.vm-lights i:nth-child(3) { animation-delay: 0.6s; }
@keyframes lights { 0%, 60%, 100% { background: rgba(255, 255, 255, 0.35); box-shadow: none; } 30% { background: #fff; box-shadow: 0 0 10px #fff; } }

.vm-display {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 14px 18px;
  border-radius: 16px;
  background: #06213a;
  color: var(--sky-300);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(125, 211, 252, 0.6);
  box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.55);
  margin-bottom: 14px;
}

.vm-window {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 10px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: inset 0 1px 12px rgba(255, 255, 255, 0.15);
}

.slot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  min-height: 150px;
  padding: 14px 14px 22px;
  border: 0;
  border-radius: 18px;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 8px 18px -10px rgba(10, 26, 47, 0.45);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), opacity 0.3s, background 0.3s;
  -webkit-tap-highlight-color: transparent;
}
.slot:hover { transform: translateY(-3px); box-shadow: 0 16px 26px -12px rgba(10, 26, 47, 0.5); }
.slot:active { transform: scale(0.97); }
.slot:disabled { cursor: default; opacity: 0.55; }

.slot-code {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 3px 7px;
  border-radius: 7px;
  background: var(--sky-50);
  color: var(--sky-700);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.72rem;
  font-weight: 700;
}
.slot-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: linear-gradient(160deg, var(--sky-50), var(--sky-100)); color: var(--sky-600); margin-bottom: 14px; }
.slot-icon .icon { width: 26px; height: 26px; }
.slot-name { font-family: var(--font-display); font-stretch: 110%; font-weight: 780; font-size: 1.08rem; letter-spacing: -0.02em; line-height: 1.15; color: var(--ink); }
.slot-blurb { margin-top: 3px; font-size: 0.78rem; line-height: 1.35; color: var(--muted); }
.slot-coil {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 9px;
  height: 5px;
  border-radius: 5px;
  background: repeating-linear-gradient(115deg, var(--sky-200) 0 3px, transparent 3px 8px);
  opacity: 0.8;
}

.is-busy .slot { pointer-events: none; }
.is-busy .slot:not(.is-picked) { opacity: 0.4; transform: scale(0.97); }
.slot.is-picked { background: var(--sky-50); box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--sky-300), 0 16px 30px -12px rgba(2, 132, 199, 0.6); }
.slot.is-vending .slot-coil { animation: coil 0.35s linear infinite; background: repeating-linear-gradient(115deg, var(--sky-500) 0 3px, transparent 3px 8px); }
.slot.is-vending .slot-icon { animation: dropOut 0.7s var(--ease) 0.45s forwards; }

.slot-wide {
  grid-column: 1 / -1;
  min-height: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 14px;
  align-items: center;
  padding: 14px 14px 22px;
  background: linear-gradient(120deg, #fff 40%, var(--sky-50));
}
.slot-wide .slot-icon { grid-row: 1 / 3; margin: 0; background: var(--ink); color: var(--sky-300); }
.slot-wide .slot-name { align-self: end; }
.slot-wide .slot-blurb { align-self: start; margin-top: 1px; }

.is-locked .vm { filter: saturate(0.6); }
.is-locked .slot:not(.is-picked) { opacity: 0.45; }
.is-locked .slot:disabled { cursor: not-allowed; }
.is-locked .slot.is-picked { opacity: 1; }
.is-locked .vm-lights i { animation: none; }

.locked {
  margin: 18px auto 0;
  max-width: 620px;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 20px;
  border-radius: 22px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
  text-align: center;
}
.locked strong { font-size: 1.05rem; }
.locked span { color: var(--muted); font-size: 0.92rem; margin-bottom: 10px; }
.locked b { color: var(--sky-700); }

@keyframes coil { to { background-position: 8px 0; } }
@keyframes dropOut { 30% { transform: translateY(-4px) rotate(-6deg); } 100% { transform: translateY(70px) rotate(14deg); opacity: 0; } }

.vm-base { margin-top: 14px; }
.vm-tray {
  position: relative;
  height: 86px;
  border-radius: 20px;
  background: #06213a;
  box-shadow: inset 0 5px 14px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  display: grid;
  place-items: center;
  transition: box-shadow 0.4s;
}
.vm-flap { position: absolute; top: 0; left: 0; right: 0; height: 22px; background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03)); border-bottom: 1px solid rgba(255, 255, 255, 0.12); }
.vm-item {
  display: grid;
  place-items: center;
  width: 92px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(160deg, #fff, var(--sky-100));
  color: var(--sky-600);
  box-shadow: 0 10px 18px -6px rgba(0, 0, 0, 0.6);
  transform: translateY(-130px) rotate(-8deg);
  opacity: 0;
}
.vm-item .icon { width: 28px; height: 28px; }
.vm-tray.has-item { box-shadow: inset 0 5px 14px rgba(0, 0, 0, 0.6), 0 0 0 3px rgba(125, 211, 252, 0.5), 0 0 30px rgba(125, 211, 252, 0.6); }
.vm-tray.has-item .vm-item { animation: itemDrop 0.75s cubic-bezier(0.3, 1.4, 0.5, 1) forwards; }
@keyframes itemDrop {
  0% { transform: translateY(-130px) rotate(-8deg); opacity: 1; }
  100% { transform: translateY(8px) rotate(3deg); opacity: 1; }
}

.hint { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 20px 0 0; font-size: 0.88rem; color: var(--muted); font-weight: 500; }
.hint svg { width: 18px; height: 18px; fill: none; stroke: var(--sky-500); stroke-width: 2; stroke-linecap: round; }

/* ---------- Result ---------- */

.view.enter { animation: rise 0.7s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(24px) scale(0.98); } to { opacity: 1; transform: none; } }

.result-bar { display: flex; justify-content: space-between; margin: 18px 0 14px; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 15px 8px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: var(--shadow-1);
  transition: border-color 0.2s, color 0.2s;
}
.icon-btn:hover { border-color: var(--sky-200); color: var(--sky-700); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.workout { display: grid; gap: 12px; }

.w-hero {
  position: relative;
  overflow: hidden;
  padding: 24px;
  border-radius: 28px;
  color: #fff;
  background: linear-gradient(150deg, var(--sky-400) 0%, var(--sky-600) 55%, var(--sky-900) 130%);
  box-shadow: var(--shadow-2);
}
.w-hero::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  right: -90px;
  top: -110px;
  border-radius: 50%;
  border: 40px solid rgba(255, 255, 255, 0.08);
  pointer-events: none;
}
.w-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.w-tag { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.18); font-size: 0.82rem; font-weight: 650; }
.w-tag .icon { width: 17px; height: 17px; }
.w-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.85; }
.w-hero h1 { font-family: var(--font-display); font-stretch: 112%; font-weight: 850; font-size: clamp(2.1rem, 9vw, 3rem); line-height: 0.98; letter-spacing: -0.04em; margin: 18px 0 18px; }
.w-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.w-meta span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.16); border: 1px solid rgba(255, 255, 255, 0.2); font-size: 0.84rem; font-weight: 600; }
.w-meta svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.w-block { padding: 18px; border-radius: 22px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.w-block h2 { margin: 0 0 10px; font-family: var(--font-body); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; color: var(--sky-600); }
.w-note p { margin: 0; color: var(--ink-2); }
.w-note.warm { background: var(--sky-50); border-color: var(--sky-100); }
.w-note.fire { background: #fff7ed; border-color: #fed7aa; }
.w-note.fire h2 { color: #ea580c; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 6px 12px; border-radius: 999px; background: var(--tint); border: 1px solid var(--line); font-size: 0.84rem; font-weight: 550; color: var(--ink-2); }

.w-list-head { display: flex; align-items: baseline; justify-content: space-between; }
.w-count { font-size: 0.82rem; font-weight: 650; color: var(--muted); }
.progress { height: 6px; border-radius: 6px; background: var(--sky-50); overflow: hidden; margin-top: 2px; }
.progress span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--sky-400), var(--sky-600)); transition: width 0.5s var(--ease); }

.ex-list { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.ex {
  width: 100%;
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s, transform 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.ex:hover { border-color: var(--sky-200); }
.ex:active { transform: scale(0.985); }
.ex-check { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--sky-200); display: grid; place-items: center; transition: background 0.25s, border-color 0.25s; }
.ex-check svg { width: 17px; height: 17px; fill: none; stroke: #fff; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transform: scale(0.5); transition: opacity 0.2s, transform 0.3s var(--ease); }
.ex-body { min-width: 0; }
.ex-name { display: block; font-weight: 650; line-height: 1.3; }
.ex-tip { display: block; margin-top: 2px; font-size: 0.8rem; color: var(--muted); line-height: 1.35; }
.ex-reps { max-width: 9.5em; text-align: right; font-family: var(--font-display); font-stretch: 105%; font-weight: 750; font-size: 0.95rem; line-height: 1.2; color: var(--sky-700); }

.ex.done { background: var(--tint); border-color: var(--sky-100); }
.ex.done .ex-check { background: var(--sky-500); border-color: var(--sky-500); }
.ex.done .ex-check svg { opacity: 1; transform: none; }
.ex.done .ex-name { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--sky-300); }
.ex.done .ex-reps { color: var(--muted); }

.complete { display: grid; justify-items: center; gap: 4px; padding: 26px 20px; border-radius: 24px; text-align: center; background: linear-gradient(160deg, var(--sky-50), #fff); border: 1px solid var(--sky-200); }
.complete strong { font-family: var(--font-display); font-stretch: 112%; font-weight: 850; font-size: 1.5rem; letter-spacing: -0.03em; }
.complete span { color: var(--muted); }
.complete-badge { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(160deg, var(--sky-400), var(--sky-600)); box-shadow: var(--shadow-btn); margin-bottom: 8px; }
.complete-badge svg { width: 30px; height: 30px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.complete.pop { animation: pop 0.6s cubic-bezier(0.3, 1.5, 0.5, 1); }
@keyframes pop { from { transform: scale(0.85); opacity: 0; } to { transform: none; opacity: 1; } }

.next-up { margin-top: 12px; padding: 18px; border-radius: 22px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-1); display: grid; gap: 14px; }
.countdown { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.countdown span { color: var(--muted); font-weight: 550; font-size: 0.92rem; }
.countdown strong { font-family: var(--font-display); font-stretch: 112%; font-weight: 800; font-size: 1.35rem; color: var(--sky-600); letter-spacing: -0.02em; }

.promo {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border-radius: 22px;
  background: var(--ink);
  color: #fff;
  transition: transform 0.3s var(--ease);
}
.promo:hover { transform: translateY(-2px); }
.promo strong { display: block; font-size: 1.02rem; }
.promo span { display: block; margin-top: 2px; font-size: 0.88rem; color: rgba(255, 255, 255, 0.7); }
.promo svg { flex: none; width: 44px; height: 44px; padding: 12px; border-radius: 50%; background: var(--sky-500); fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.app-foot { margin: 32px auto 40px; max-width: 30em; text-align: center; font-size: 0.8rem; color: var(--muted); }

/* ---------- Lead form ---------- */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(6, 33, 58, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.25s;
}
.sheet-backdrop.open { opacity: 1; }
.lead-form {
  position: relative;
  width: min(480px, 100%);
  max-height: 100dvh;
  overflow-y: auto;
  padding: 26px 22px calc(22px + env(safe-area-inset-bottom));
  border-radius: 26px 26px 0 0;
  background: #fff;
  box-shadow: var(--shadow-2);
  transform: translateY(40px);
  transition: transform 0.35s var(--ease);
}
.sheet-backdrop.open .lead-form { transform: none; }
.lead-form h2 { margin: 12px 0 6px; font-family: var(--font-display); font-stretch: 75%; font-weight: 900; font-size: 2rem; line-height: 1; text-transform: uppercase; }
.lead-intro { margin: 0 0 18px; color: var(--muted); font-size: 0.94rem; }
.lead-tag { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px 5px 8px; border-radius: 999px; background: var(--sky-50); color: var(--sky-700); font-size: 0.8rem; font-weight: 650; }
.lead-tag .icon { width: 16px; height: 16px; }
.lead-form .field { margin-bottom: 12px; }
.lead-form .check { margin: 4px 0 18px; }
.lead-fine { margin: 12px 0 0; text-align: center; font-size: 0.78rem; color: var(--muted); }
.sheet-close { position: absolute; top: 14px; right: 14px; width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--tint); cursor: pointer; }
.sheet-close svg { width: 18px; height: 18px; fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; }

@media (min-width: 640px) {
  .sheet-backdrop { align-items: center; padding: 20px; }
  .lead-form { border-radius: 26px; padding: 30px 30px 26px; }
}

@media (min-width: 640px) {
  .vm { padding: 20px; }
  .vm-window { grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 12px; }
  .w-hero { padding: 32px; }
  .w-block, .next-up { padding: 22px; }
}

@media (max-width: 380px) {
  .slot { min-height: 138px; padding: 12px 12px 20px; }
  .slot-name { font-size: 0.98rem; }
  .brand-text small { display: none; }
}
