/* Magos PF Hybrid Simulation booking - member-facing flow.
   Namespaced under .mpfe so it won't collide with the host theme. */

@font-face {
  font-family: 'Gilroy';
  src: url('https://www.planetfitness.co.za/wp-content/uploads/2023/12/Gilroy-Regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Gilroy';
  src: url('https://www.planetfitness.co.za/wp-content/uploads/2023/12/Gilroy-Bold_0.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}

/* Design tokens live on :root so BOTH the booking flow (.mpfe) and the team
   dashboard (.mpfe-dash, a sibling - not a descendant) can resolve them. */
:root {
  --mpfe-bg: #0c0c0e; --mpfe-card: #151518; --mpfe-card-2: #1c1c21;
  --mpfe-border: #2a2a31; --mpfe-text: #f2f2f5; --mpfe-muted: #8b8b95;
  --mpfe-blue: #1f6ff2; --mpfe-blue-h: #3b82f6; --mpfe-green: #22c55e;
  --mpfe-amber: #f59e0b; --mpfe-red: #ef4444;
}
.mpfe {
  font-family: 'Gilroy', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--mpfe-text); background: var(--mpfe-bg);
  max-width: 640px; margin: 0 auto; padding: 24px 16px 48px; box-sizing: border-box;
}
.mpfe *, .mpfe *::before, .mpfe *::after { box-sizing: border-box; }

.mpfe-brand { display: flex; justify-content: center; margin-bottom: 8px; }
.mpfe-brand img { height: 80px; width: auto; }
.mpfe-event-strip { text-align: center; color: var(--mpfe-muted); font-size: 12.5px; margin-bottom: 22px; }
.mpfe-event-strip b { color: var(--mpfe-text); font-weight: 600; }

.mpfe-stepper { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; padding: 0 4px; }
.mpfe-step { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; position: relative; }
.mpfe-step::before { content: ''; position: absolute; top: 14px; left: -50%; width: 100%; height: 2px; background: var(--mpfe-border); z-index: 0; }
.mpfe-step:first-child::before { display: none; }
.mpfe-step.done::before, .mpfe-step.active::before { background: var(--mpfe-blue); }
.mpfe-dot { width: 28px; height: 28px; border-radius: 50%; background: var(--mpfe-card-2); border: 2px solid var(--mpfe-border);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: var(--mpfe-muted); position: relative; z-index: 1; }
.mpfe-step.active .mpfe-dot, .mpfe-step.done .mpfe-dot { border-color: var(--mpfe-blue); background: var(--mpfe-blue); color: #fff; }
.mpfe-lbl { font-size: 10.5px; color: var(--mpfe-muted); font-weight: 500; }
.mpfe-step.active .mpfe-lbl { color: var(--mpfe-text); }

.mpfe-card { background: var(--mpfe-card); border: 1px solid var(--mpfe-border); border-radius: 12px; padding: 28px; }
.mpfe-card h2 { font-size: 20px; font-weight: 700; text-align: center; margin: 0 0 6px; }
.mpfe-sub { text-align: center; color: var(--mpfe-muted); font-size: 13px; margin: 0 0 22px; line-height: 1.5; }
.mpfe-screen { display: none; }
.mpfe-screen.visible { display: block; animation: mpf-fade .25s ease; }
@keyframes mpf-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.mpfe-field { margin-bottom: 16px; }
.mpfe-field label { display: block; font-size: 12px; color: var(--mpfe-muted); margin-bottom: 6px; font-weight: 500; }
.mpfe-field input, .mpfe-field select {
  width: 100%; padding: 13px 16px; border-radius: 10px; background: var(--mpfe-card-2);
  border: 1px solid var(--mpfe-border); color: var(--mpfe-text); font-family: inherit; font-size: 14.5px; outline: none; }
.mpfe-field input:focus, .mpfe-field select:focus { border-color: var(--mpfe-blue); }
.mpfe-field select { appearance: none; -webkit-appearance: none; cursor: pointer; }
.mpfe-field select.invalid { border-color: var(--mpfe-red); }
.mpfe-radio { display: flex; gap: 18px; flex-wrap: wrap; padding-top: 4px; }
.mpfe-radio label { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--mpfe-text); font-weight: 500; cursor: pointer; }
.mpfe-radio input { accent-color: var(--mpfe-blue); width: auto; }

.mpfe-btn { display: block; width: 100%; padding: 14px; background: var(--mpfe-blue); color: #fff; border: none;
  border-radius: 10px; font-family: inherit; font-size: 14.5px; font-weight: 700; letter-spacing: .5px; cursor: pointer; text-transform: uppercase; }
.mpfe-btn:hover { background: var(--mpfe-blue-h); }
.mpfe-btn:disabled { background: #2a2a31; color: #62626b; cursor: not-allowed; }
.mpfe-btn-ghost { background: none; border: none; color: var(--mpfe-muted); font-family: inherit; font-size: 13px; cursor: pointer; padding: 12px; width: 100%; margin-top: 6px; }
.mpfe-btn-ghost:hover { color: var(--mpfe-text); }

.mpfe-popia { font-size: 11.5px; color: #6a6a74; text-align: center; line-height: 1.6; margin: 18px 0 0; }
.mpfe-error { color: var(--mpfe-red); font-size: 12.5px; text-align: center; margin-bottom: 10px; min-height: 0; }

.mpfe-member-banner { display: none; align-items: center; gap: 12px; background: rgba(34,197,94,.08);
  border: 1px solid rgba(34,197,94,.35); border-radius: 10px; padding: 14px 16px; margin-bottom: 18px; }
.mpfe-member-banner.show { display: flex; }
.mpfe-tick { width: 30px; height: 30px; border-radius: 50%; background: var(--mpfe-green); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; flex-shrink: 0; }
.mpfe-mb-txt { font-size: 13px; line-height: 1.45; }
.mpfe-mb-txt b { color: var(--mpfe-green); }
.mpfe-mb-price { margin-left: auto; text-align: right; }
.mpfe-mb-price .mpfe-amt { font-size: 19px; font-weight: 800; }
.mpfe-mb-price .mpfe-was { font-size: 11px; color: var(--mpfe-muted); text-decoration: line-through; }

.mpfe-context { display: none; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--mpfe-card-2);
  border: 1px solid var(--mpfe-border); border-radius: 10px; padding: 10px 14px; margin-bottom: 18px; }
.mpfe-context.show { display: flex; }
.mpfe-chip { background: rgba(31,111,242,.12); border: 1px solid rgba(31,111,242,.4); color: #7eaefb; padding: 3px 10px; border-radius: 999px; font-weight: 600; font-size: 11.5px; }

.mpfe-month { font-size: 13px; font-weight: 600; color: var(--mpfe-muted); margin: 14px 0 10px; text-transform: uppercase; letter-spacing: 1px; }
.mpfe-date-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.mpfe-date { background: var(--mpfe-card-2); border: 1.5px solid var(--mpfe-border); border-radius: 12px; padding: 12px 8px 10px; text-align: center; cursor: pointer; }
.mpfe-date:hover { border-color: var(--mpfe-blue); transform: translateY(-2px); }
.mpfe-date.selected { border-color: var(--mpfe-blue); background: rgba(31,111,242,.12); }
.mpfe-date .mpfe-dow { font-size: 11px; color: var(--mpfe-muted); font-weight: 600; text-transform: uppercase; }
.mpfe-date .mpfe-dnum { font-size: 24px; font-weight: 800; margin: 2px 0; }
.mpfe-date .mpfe-mon { font-size: 11px; color: var(--mpfe-muted); }
.mpfe-date .mpfe-city { font-size: 11px; font-weight: 700; margin-top: 4px; }
.mpfe-avail { margin-top: 8px; font-size: 10px; font-weight: 700; padding: 3px 0; border-radius: 6px; }
.mpfe-avail.open { background: rgba(34,197,94,.12); color: var(--mpfe-green); }
.mpfe-avail.low { background: rgba(245,158,11,.12); color: var(--mpfe-amber); }
.mpfe-avail.full { background: rgba(239,68,68,.10); color: var(--mpfe-red); }
.mpfe-date.soldout { opacity: .45; cursor: not-allowed; }
.mpfe-date.soldout:hover { border-color: var(--mpfe-border); transform: none; }

.mpfe-legend { display: flex; gap: 16px; justify-content: center; margin-top: 18px; font-size: 11px; color: var(--mpfe-muted); }
.mpfe-legend span { display: flex; align-items: center; gap: 5px; }
.mpfe-legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.mpfe-i-open { background: var(--mpfe-green); } .mpfe-i-low { background: var(--mpfe-amber); } .mpfe-i-full { background: var(--mpfe-red); }

.mpfe-heat { display: flex; align-items: center; gap: 14px; background: var(--mpfe-card-2); border: 1.5px solid var(--mpfe-border);
  border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; cursor: pointer; }
.mpfe-heat:hover { border-color: var(--mpfe-blue); }
.mpfe-heat.selected { border-color: var(--mpfe-blue); background: rgba(31,111,242,.12); }
.mpfe-heat.full { opacity: .45; cursor: not-allowed; }
.mpfe-heat-time { font-size: 17px; font-weight: 800; min-width: 64px; }
.mpfe-heat-meta { flex: 1; }
.mpfe-heat-meta .mpfe-hm-name { font-size: 13.5px; font-weight: 600; }
.mpfe-heat-meta .mpfe-hm-sub { font-size: 11.5px; color: var(--mpfe-muted); margin-top: 1px; }
.mpfe-spots { text-align: right; flex-shrink: 0; }
.mpfe-pill { font-size: 10.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.mpfe-pill.open { background: rgba(34,197,94,.12); color: var(--mpfe-green); }
.mpfe-pill.low { background: rgba(245,158,11,.12); color: var(--mpfe-amber); }
.mpfe-pill.full { background: rgba(239,68,68,.10); color: var(--mpfe-red); }

.mpfe-two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 520px) { .mpfe-two { grid-template-columns: 1fr; } }

.mpfe-row { display: flex; justify-content: space-between; align-items: baseline; padding: 13px 0; border-bottom: 1px solid var(--mpfe-border); font-size: 13.5px; }
.mpfe-row .mpfe-k { color: var(--mpfe-muted); }
.mpfe-row .mpfe-v { font-weight: 600; text-align: right; }
.mpfe-total { display: flex; justify-content: space-between; align-items: center; background: var(--mpfe-card-2); border-radius: 10px; padding: 16px; margin: 16px 0 20px; }
.mpfe-total .mpfe-k { font-size: 14px; font-weight: 600; }
.mpfe-total .mpfe-v { font-size: 24px; font-weight: 800; color: var(--mpfe-blue-h); }
.mpfe-payfast-note { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 11.5px; color: var(--mpfe-muted); margin-top: 14px; }
.mpfe-payfast-badge { height: 18px; width: auto; display: inline-block; vertical-align: middle; }

.mpfe-success { width: 72px; height: 72px; border-radius: 50%; background: rgba(34,197,94,.12); border: 2px solid var(--mpfe-green);
  display: flex; align-items: center; justify-content: center; margin: 6px auto 18px; font-size: 32px; color: var(--mpfe-green); }
.mpfe-ref { background: var(--mpfe-card-2); border: 1px dashed var(--mpfe-border); border-radius: 10px; text-align: center; padding: 14px; margin: 18px 0; }
.mpfe-ref-lbl { font-size: 11px; color: var(--mpfe-muted); letter-spacing: 1.5px; text-transform: uppercase; }
.mpfe-ref-val { font-size: 20px; font-weight: 800; letter-spacing: 2px; margin-top: 4px; }

/* Trigger button + self-contained modal (no Elementor/popup dependency). */
.mpfe-trigger { display: inline-block; background-color: #F41C5E !important; color: #FFFFFF !important;
  font-family: "Work Sans", sans-serif !important; font-size: 16px !important; font-weight: 600 !important;
  border: none !important; border-radius: 6px; padding: 15px 35px; cursor: pointer; line-height: 1.2; text-decoration: none; }
.mpfe-trigger:hover { filter: brightness(0.95); background-color: #F41C5E !important; color: #FFFFFF !important; }
/* The MODAL itself is the scroll container (not the inner box) - this is what
   makes the bottom button reachable on iOS, where a 100vh inner box hides its
   last rows behind the Safari toolbar. */
.mpfe-modal { display: none; position: fixed !important; top: 0; left: 0; right: 0; bottom: 0;
  width: 100%; height: 100%; z-index: 2147483000 !important;
  overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.mpfe-modal.open { display: block; }
.mpfe-modal.mpfe-inline { display: block; position: static !important; width: auto; height: auto;
  z-index: auto !important; overflow: visible; }
/* Backdrop pinned to the viewport so it always covers, even while scrolling. */
.mpfe-modal-backdrop { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.66); }
.mpfe-modal.mpfe-inline .mpfe-modal-backdrop { display: none; }
.mpfe-modal-box { position: relative; max-width: 680px; margin: 28px auto;
  padding: 0 10px 32px; min-height: 0; }
.mpfe-modal.mpfe-inline .mpfe-modal-box { margin: 0; overflow: visible; padding: 0; }
/* Close pinned to the viewport corner so it never scrolls out of reach. */
.mpfe-modal-close { position: fixed; top: 10px; right: 14px; z-index: 4; background: rgba(0,0,0,.45);
  border: none; color: #fff; font-size: 24px; line-height: 1; cursor: pointer;
  padding: 0; width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; }
.mpfe-modal-close:hover { opacity: .8; }
@media (max-width: 600px) {
  .mpfe-modal-box { margin: 0; padding: 0 0 calc(40px + env(safe-area-inset-bottom, 0px)); }
  .mpfe-modal-close { top: calc(8px + env(safe-area-inset-top, 0px)); }
}

/* ---- team dashboard ---- */
.mpfe-dash { font-family: 'Gilroy', 'Segoe UI', sans-serif; color: var(--mpfe-text); background: var(--mpfe-bg); padding: 22px; border-radius: 14px; }
.mpfe-dash h2 { margin: 0 0 14px; font-size: 20px; }
.mpfe-dash-filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.mpfe-dash-filters select, .mpfe-dash-filters input { padding: 9px 12px; border-radius: 8px; background: var(--mpfe-card-2); border: 1px solid var(--mpfe-border); color: var(--mpfe-text); font-family: inherit; font-size: 13.5px; }
.mpfe-dash-actions { display: flex; gap: 10px; margin-bottom: 14px; }
.mpfe-dash table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mpfe-dash th { text-align: left; padding: 9px 10px; border-bottom: 2px solid var(--mpfe-border); color: var(--mpfe-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
.mpfe-dash td { padding: 9px 10px; border-bottom: 1px solid var(--mpfe-border); }
.mpfe-dash tr:hover td { background: rgba(255,255,255,0.03); }
.mpfe-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.mpfe-badge.booked { background: rgba(26,127,55,.18); color: #34c06b; }
.mpfe-badge.pending { background: rgba(246,187,48,.16); color: #f6bb30; }
.mpfe-badge.cancelled, .mpfe-badge.expired { background: rgba(220,53,69,.15); color: #ff6b7a; }
.mpfe-badge.transferred { background: rgba(28,77,161,.2); color: #6ea8ff; }
.mpfe-dash .mpfe-mini { padding: 5px 10px; font-size: 12px; border-radius: 6px; border: 1px solid var(--mpfe-border); background: none; color: var(--mpfe-text); cursor: pointer; }
.mpfe-dash .mpfe-mini:hover { border-color: var(--mpfe-blue); }
.mpfe-dash-count { color: var(--mpfe-muted); font-size: 12.5px; margin-left: auto; align-self: center; }
.mpfe-dash-login { max-width: 380px; margin: 40px auto; text-align: center; }

/* ---- multi-athlete booking ---- */
.mpfe-add-athlete { display: block; width: 100%; margin: 4px 0 16px; padding: 12px; background: none;
  border: 1px dashed var(--mpfe-border); border-radius: 10px; color: var(--mpfe-muted);
  font-family: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; text-align: center; }
.mpfe-add-athlete:hover { border-color: var(--mpfe-blue); color: var(--mpfe-text); }
.mpfe-extra { border: 1px solid var(--mpfe-border); border-radius: 12px; padding: 14px 14px 4px; margin-bottom: 14px; position: relative; }
.mpfe-extra-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.mpfe-extra-head b { font-size: 13px; }
.mpfe-extra-remove { background: none; border: none; color: var(--mpfe-muted); font-size: 12px; cursor: pointer; font-family: inherit; }
.mpfe-extra-remove:hover { color: var(--mpfe-red, #ff6b7a); }
.mpfe-three { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
@media (max-width: 520px) { .mpfe-three { grid-template-columns: 1fr; } }
.mpfe-sum-athlete-line { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--mpfe-border); font-size: 13.5px; }
.mpfe-sum-athlete-line .n { color: var(--mpfe-text); }
.mpfe-sum-athlete-line .f { color: var(--mpfe-muted); }
