/* Lagos Life switch. Owner 5c. Spec: inputs.html#switch.
   Replaces the "🌙 Night mode" pill button and the flight insurance switch with one control.
   Markup: <button class="ll-switch ll-interactive" role="switch" aria-checked="false">
             <span class="ll-switch__text"><span class="ll-switch__label">🌙 Night mode</span>
               <span class="ll-switch__hint">Easier on the eyes after dark</span></span>
             <span class="ll-switch__track" aria-hidden="true"><span class="ll-switch__thumb"></span></span>
           </button>
   The whole row is the target (44px or taller). State = thumb position + track colour, never colour alone. */

.ll-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  min-height: var(--tap-min);
  margin: 0;
  padding: var(--space-1) var(--space-1) var(--space-1) var(--space-3);
  border: 0;
  border-radius: var(--radius-full);
  background-color: transparent;
  color: var(--ink);
  font: var(--type-label-lg);
  text-align: left;
}
.ll-switch__text { display: flex; flex-direction: column; min-width: 0; }
.ll-switch__label { overflow-wrap: anywhere; }
.ll-switch__hint { font: var(--type-label-sm); font-weight: var(--weight-regular); color: var(--ink-soft); }

.ll-switch__track {
  position: relative;
  flex: none;
  width: var(--switch-width);
  height: var(--switch-height);
  border-radius: var(--radius-full);
  background-color: var(--ink-inactive);
  transition: background-color var(--duration-state) var(--ease-standard);
}
.ll-switch__thumb {
  position: absolute;
  top: calc((var(--switch-height) - var(--switch-thumb)) / 2);
  left: calc((var(--switch-height) - var(--switch-thumb)) / 2);
  width: var(--switch-thumb);
  height: var(--switch-thumb);
  border-radius: 50%;
  background-color: var(--paper);
  box-shadow: var(--shadow-flat);
  transition: transform var(--duration-pop) var(--ease-spring);
}
.ll-switch[aria-checked="true"] .ll-switch__track { background-color: var(--leaf-deep); }
.ll-switch[aria-checked="true"] .ll-switch__thumb { transform: translateX(calc(var(--switch-width) - var(--switch-height))); }

/* Inactive: the row turns mist (state.css), the track stays readable, the hint carries the reason. */
.ll-switch:is([aria-disabled="true"], :disabled) .ll-switch__track { background-color: var(--ink-inactive); }
.ll-switch:is([aria-disabled="true"], :disabled) .ll-switch__hint { color: var(--ink-inactive); }

@media (prefers-reduced-motion: reduce) {
  .ll-switch__track, .ll-switch__thumb { transition: none; }
}
