/* Magos PF Hybrid Simulation booking - member-facing flow.
   Namespaced under .mpf 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;
}

.mpf {
  --mpf-bg: #0c0c0e; --mpf-card: #151518; --mpf-card-2: #1c1c21;
  --mpf-border: #2a2a31; --mpf-text: #f2f2f5; --mpf-muted: #8b8b95;
  --mpf-blue: #1f6ff2; --mpf-blue-h: #3b82f6; --mpf-green: #22c55e;
  --mpf-amber: #f59e0b; --mpf-red: #ef4444;
  font-family: 'Gilroy', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--mpf-text); background: var(--mpf-bg);
  max-width: 640px; margin: 0 auto; padding: 24px 16px 48px; box-sizing: border-box;
}
.mpf *, .mpf *::before, .mpf *::after { box-sizing: border-box; }

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

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

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

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

.mpf-btn { display: block; width: 100%; padding: 14px; background: var(--mpf-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; }
.mpf-btn:hover { background: var(--mpf-blue-h); }
.mpf-btn:disabled { background: #2a2a31; color: #62626b; cursor: not-allowed; }
.mpf-btn-ghost { background: none; border: none; color: var(--mpf-muted); font-family: inherit; font-size: 13px; cursor: pointer; padding: 12px; width: 100%; margin-top: 6px; }
.mpf-btn-ghost:hover { color: var(--mpf-text); }

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

.mpf-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; }
.mpf-member-banner.show { display: flex; }
.mpf-tick { width: 30px; height: 30px; border-radius: 50%; background: var(--mpf-green); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; flex-shrink: 0; }
.mpf-mb-txt { font-size: 13px; line-height: 1.45; }
.mpf-mb-txt b { color: var(--mpf-green); }
.mpf-mb-price { margin-left: auto; text-align: right; }
.mpf-mb-price .mpf-amt { font-size: 19px; font-weight: 800; }
.mpf-mb-price .mpf-was { font-size: 11px; color: var(--mpf-muted); text-decoration: line-through; }

.mpf-context { display: none; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--mpf-card-2);
  border: 1px solid var(--mpf-border); border-radius: 10px; padding: 10px 14px; margin-bottom: 18px; }
.mpf-context.show { display: flex; }
.mpf-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; }

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

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

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

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

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

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

/* Trigger button + self-contained modal (no Elementor/popup dependency). */
.mpf-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; }
.mpf-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. */
.mpf-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; }
.mpf-modal.open { display: block; }
.mpf-modal.mpf-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. */
.mpf-modal-backdrop { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.66); }
.mpf-modal.mpf-inline .mpf-modal-backdrop { display: none; }
.mpf-modal-box { position: relative; max-width: 680px; margin: 28px auto;
  padding: 0 10px 32px; min-height: 0; }
.mpf-modal.mpf-inline .mpf-modal-box { margin: 0; overflow: visible; padding: 0; }
/* Close pinned to the viewport corner so it never scrolls out of reach. */
.mpf-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; }
.mpf-modal-close:hover { opacity: .8; }
@media (max-width: 600px) {
  .mpf-modal-box { margin: 0; padding: 0 0 calc(40px + env(safe-area-inset-bottom, 0px)); }
  .mpf-modal-close { top: calc(8px + env(safe-area-inset-top, 0px)); }
}
