/* Theme. To restyle, set any --fx-* variable on :root (every feature on the site)
   or on .fx-mem (this feature only). The values here are the defaults. */
.fx-mem {
  --_accent: var(--fx-accent, #d4af37);
  --_accent-hover: var(--fx-accent-hover, #e2c158);
  --_accent-text: var(--fx-accent-text, #000);
  --_text: var(--fx-text, #f5f5f5);
  --_muted: var(--fx-muted, #b8b8b8);
  --_panel: var(--fx-panel, #181818);
  --_track: var(--fx-track, #2a2a2a);
  --_border: var(--fx-border, rgba(255,255,255,.35));
  --_good: var(--fx-good, #3ddc84);
  --_demo: var(--fx-demo, #9ad1ff);
  --_font-display: var(--fx-font-display, inherit);
  --_font-body: var(--fx-font-body, inherit);
  --_space: var(--fx-space, 16px);
  --_space-sm: calc(var(--_space) * .5);
  --_space-lg: calc(var(--_space) * 1.5);
  --_radius: var(--fx-radius, 6px);
  --_radius-sm: calc(var(--_radius) * .6);
  font-family: var(--_font-body);
}
/* Membership calculator */
.fx-mem { color: var(--_text); }
.fx-mem-title { margin: 0 0 .3em; font-family: var(--_font-display); font-size: clamp(2.1rem, 8vw, 3.4rem); font-weight: var(--fx-heading-weight, 800); line-height: .92; text-transform: var(--fx-heading-case, uppercase); }
.fx-mem-intro { max-width: 40em; margin: 0 0 var(--_space-sm); color: var(--_muted); }
.fx-mem-controls { display: grid; gap: var(--_space); padding: var(--_space); background: var(--_panel); border-radius: var(--_radius); }
.fx-mem legend, .fx-mem-vlabel { display: block; margin: 0 0 6px; padding: 0; font-size: .86rem; font-weight: 600; }
.fx-mem-seg { min-width: 0; margin: 0; padding: 0; border: 0; }
.fx-mem-seg-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--_space-sm); }
.fx-mem-seg label { position: relative; min-width: 0; }
.fx-mem-seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.fx-mem-seg span {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 6px;
  border: 1px solid var(--_border);
  border-radius: var(--_radius-sm);
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}
.fx-mem-seg small { color: var(--_accent); font-weight: 700; }
.fx-mem-seg input:checked + span { background: var(--_accent); border-color: var(--_accent); color: var(--_accent-text); }
.fx-mem-seg input:checked + span small { color: var(--_accent-text); }
.fx-mem-seg input:focus-visible + span { outline: 3px solid var(--_accent); outline-offset: 2px; }
.fx-mem-vout { color: var(--_accent); font-weight: 700; }
.fx-mem-range { display: block; width: 100%; height: 44px; margin: 0; accent-color: var(--_accent); cursor: pointer; }
.fx-mem-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.fx-mem-preset {
  min-height: 40px;
  padding: 0 12px;
  background: none;
  color: var(--_text);
  border: 1px solid var(--_border);
  border-radius: 999px;
  font: inherit;
  font-size: .85rem;
  cursor: pointer;
}
.fx-mem-preset[aria-pressed="true"] { background: var(--_accent); border-color: var(--_accent); color: var(--_accent-text); font-weight: 600; }
.fx-mem-results { display: grid; gap: var(--_space-sm); margin-top: var(--_space); }
.fx-mem-row { padding: 12px 14px; background: var(--_panel); border: 1px solid transparent; border-radius: var(--_radius); }
.fx-mem-row.is-best { border-color: var(--_good); }
.fx-mem-row-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.fx-mem-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--_space-sm); margin: 0; font-weight: 700; }
.fx-mem-badge { padding: 1px var(--_space-sm); background: var(--_good); color: #000; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.fx-mem-badge[hidden] { display: none; }
.fx-mem-total { margin: 0; font-family: var(--_font-display); font-size: 1.6rem; font-weight: 700; line-height: 1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fx-mem-track { height: 8px; margin: var(--_space-sm) 0 6px; background: var(--_track); border-radius: var(--_radius-sm); overflow: hidden; }
.fx-mem-bar { height: 100%; width: 0; background: var(--_accent); border-radius: var(--_radius-sm); transition: width .35s ease; }
.is-pay .fx-mem-bar { background: var(--_muted); }
.is-best .fx-mem-bar { background: var(--_good); }
.fx-mem-note { margin: 0; color: var(--_muted); font-size: .82rem; }
.fx-mem-summary { margin: 12px 0 0; font-weight: 600; }
.fx-mem-actions { margin-top: 12px; }
.fx-mem .fx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 0 var(--_space-lg);
  background: var(--_accent);
  color: var(--_accent-text);
  border: 0;
  border-radius: var(--_radius-sm);
  font-family: var(--_font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: var(--fx-heading-case, uppercase);
  cursor: pointer;
}
.fx-mem .fx-btn:hover { background: var(--_accent-hover); }
.fx-mem :focus-visible { outline: 3px solid var(--_accent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .fx-mem-bar { transition: none; }
}
@media (min-width: 600px) {
  .fx-mem .fx-btn { width: auto; }
  .fx-mem-seg-row { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 900px) {
  .fx-mem-controls { grid-template-columns: 1.2fr 1fr; gap: var(--_space-lg); padding: var(--_space-lg); }
  .fx-mem-results { grid-template-columns: repeat(4, 1fr); }
  .fx-mem-row { display: flex; flex-direction: column; }
  .fx-mem-row-top { flex-direction: column; align-items: flex-start; gap: 4px; }
  .fx-mem-note { margin-top: auto; }
}
.fx-mem .fx-demo {
  display: inline-block;
  margin: 0 0 12px;
  padding: 4px 10px;
  border: 1px dashed var(--_demo);
  border-radius: var(--_radius-sm);
  color: var(--_demo);
  font-family: var(--_font-body);
  font-size: .82rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0;
  text-transform: none;
}
