/* Uiverse "Switch" (flat on/off toggle with on/off text on the knob)
   Source:  https://uiverse.io/andrew-demchenk0/empty-penguin-100
   Author:  andrew-demchenk0
   Licence: uiverse.io element page footer reads "MIT License" (verified 2026-10-07). Original CSS: empty-penguin-100.orig.css
   Adapted for the contractor app:
   - scoped under .uv-toggle (original .switch/.slider also exist in jolly-chicken-91; class names kept);
   - original variables kept and pointed at tokens: --main-color -> --text, --bg-color -> --surface, --input-out-of-focus -> --surface-2, --input-focus -> --accent-fill;
   - removed the two transforms (.switch translateX and .toggle:checked + .slider translateX(-32px)) which were artefacts of the original demo layout;
   - box 70x36 -> 76 x --tap (44px) with the 36px track inset, so the whole control is a 44px target; real input fills it (keyboard + tap);
   - the "on"/"off" text on the knob stays (state is never colour-only); knob text is --text on --surface (AA both themes);
   - hard offset shadow 4px --main-color -> 3px --border-strong (calmer, still a visible edge on both themes);
   - :focus-visible ring on the track; [disabled] state; timing 0.3s -> --dur-base + --ease-out;
   - prefers-reduced-motion: knob moves instantly. */

.uv-toggle .switch {
  --input-focus: var(--accent-fill);
  --bg-color: var(--surface);
  --bg-color-alt: var(--text-2);
  --main-color: var(--text);
  --input-out-of-focus: var(--surface-2);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 30px;
  width: 76px;
  height: var(--tap);
}

.uv-toggle .toggle {
  opacity: 0;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 2;
}

.uv-toggle .slider {
  box-sizing: border-box;
  border-radius: 100px;
  border: 2px solid var(--main-color);
  box-shadow: 3px 3px var(--border-strong);
  position: absolute;
  cursor: pointer;
  top: 4px;
  left: 0;
  right: 4px;
  bottom: 4px;
  background-color: var(--input-out-of-focus);
  transition: background-color var(--dur-base) var(--ease-out);
}

.uv-toggle .slider:before {
  content: "off";
  box-sizing: border-box;
  height: 30px;
  width: 30px;
  position: absolute;
  left: 2px;
  bottom: 1px;
  border: 2px solid var(--main-color);
  border-radius: 100px;
  background-color: var(--bg-color);
  color: var(--main-color);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  line-height: 25px;
  transition: transform var(--dur-base) var(--ease-out);
}

.uv-toggle .toggle:checked + .slider {
  background-color: var(--input-focus);
}

.uv-toggle .toggle:checked + .slider:before {
  content: "on";
  transform: translateX(32px);
}

.uv-toggle .toggle:focus-visible + .slider {
  outline: var(--ring-w) solid var(--focus);
  outline-offset: var(--ring-offset);
}

.uv-toggle .toggle:disabled { cursor: not-allowed; }
.uv-toggle .toggle:disabled + .slider { opacity: 0.5; box-shadow: none; }

@media (prefers-reduced-motion: reduce) {
  .uv-toggle .slider,
  .uv-toggle .slider:before { transition: none; }
}
