/* NFT Zone — Frost Toggle
   Load after buttons/frost-buttons.css. The original Frost stylesheet owns
   every surface, rim, shadow and pointer effect for BOTH approved variants.
   Native markup (no toggle JS):
   <label class="btn frost-btn frost-btn--v2 frost-toggle">
     <input type="checkbox">
     <span class="frost-toggle__switch" aria-hidden="true"></span>
     <span class="frost-toggle__text">Filter</span>
   </label>
   Use frost-btn--v1 for Prism Calm. Size/spacing belong to the consumer.
*/

.frost-toggle { user-select: none; }

/* Visually hidden, still in the native Tab/Space and label activation flow. */
.frost-toggle > input[type="checkbox"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.frost-toggle > .frost-toggle__switch {
  width: 32px;
  height: 18px;
  flex-shrink: 0;
  position: relative;
  border-radius: var(--radius-full);
  background-color: var(--bg-surface-3);
  transition: background-color .2s;
}

.frost-toggle > .frost-toggle__switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: #fff;
  transition: transform .2s;
}

.frost-toggle > input[type="checkbox"]:checked + .frost-toggle__switch {
  background-color: #887df1;
}

.frost-toggle > input[type="checkbox"]:checked + .frost-toggle__switch::after {
  transform: translateX(14px);
}

.frost-toggle > .frost-toggle__text { color: inherit; }
.frost-toggle:where(.frost-btn--v2) > input[type="checkbox"]:checked ~ .frost-toggle__text {
  color: #887df1;
}

/* Light V2 needs the existing darker violet for small active text.
   The track stays Playground purple; V1 retains its dark-surface contrast. */
:where(html[data-theme="light"]) .frost-toggle:where(.frost-btn--v2) > input[type="checkbox"]:checked ~ .frost-toggle__text {
  color: var(--accent-violet);
}

/* Forward native input states to its Frost label without JS or extra tab stops. */
.btn.frost-btn.frost-toggle:has(> input[type="checkbox"]:focus-visible) {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 3px;
}

.btn.frost-btn.frost-toggle:has(> input[type="checkbox"]:disabled) {
  opacity: .48;
  cursor: not-allowed;
  pointer-events: none;
  transform: none;
  box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
  .frost-toggle > .frost-toggle__switch,
  .frost-toggle > .frost-toggle__switch::after { transition: none; }
}

@media (forced-colors: active) {
  .frost-toggle > .frost-toggle__switch {
    background-color: ButtonText;
    outline: 1px solid ButtonText;
    forced-color-adjust: none;
  }
  .frost-toggle > input[type="checkbox"]:checked + .frost-toggle__switch { background-color: Highlight; }
  .frost-toggle > .frost-toggle__switch::after { background-color: ButtonFace; }
  .frost-toggle > input[type="checkbox"]:checked ~ .frost-toggle__text { color: Highlight; }
  .btn.frost-btn.frost-toggle:has(> input[type="checkbox"]:focus-visible) { outline-color: Highlight; }
  .btn.frost-btn.frost-toggle:has(> input[type="checkbox"]:disabled) { opacity: 1; color: GrayText; }
  .frost-toggle:has(> input[type="checkbox"]:disabled) > .frost-toggle__text { color: GrayText; }
}
