/* controls.css — segmented control, stepper, switch. */

/* ── Segmented control (iOS style) ─────────────────────────────────── */
.seg {
  display: flex; padding: 3px; gap: 2px;
  background: var(--surface-3); border-radius: 10px;
}
.seg-opt {
  flex: 1; min-width: 0; padding: 7px 6px; border: none; background: none; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--label-2); border-radius: 8px; white-space: nowrap;
  transition: background .18s var(--ease), color .18s, box-shadow .18s, transform .1s;
}
.seg-opt:hover { color: var(--label); }
.seg-opt:active { transform: scale(0.97); }
.seg-opt.is-on { background: var(--surface); color: var(--label); box-shadow: 0 1px 4px rgba(0,0,0,0.12), 0 0 0 0.5px rgba(0,0,0,0.04); }
:root[data-theme="dark"] .seg-opt.is-on { background: var(--surface-3); box-shadow: 0 1px 4px rgba(0,0,0,0.5); }
:root[data-theme="dark"] .seg { background: var(--surface-2); }

/* ── Stepper ───────────────────────────────────────────────────────── */
.stepper {
  display: flex; align-items: center; height: 40px;
  background: var(--surface-2); border: 1px solid var(--border-2); border-radius: var(--r-md);
  overflow: hidden;
}
.stepper-btn {
  width: 38px; height: 100%; flex-shrink: 0; border: none; background: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: var(--label-2);
  transition: background .14s, color .14s;
}
.stepper-btn svg { width: 16px; height: 16px; }
.stepper-btn:hover:not(:disabled) { background: var(--surface-3); color: var(--label); }
.stepper-btn:active:not(:disabled) { transform: scale(0.92); }
.stepper-btn:disabled { opacity: 0.35; cursor: default; }
.stepper-input {
  flex: 1; min-width: 0; width: 100%; height: 100%; border: none; background: none; text-align: center;
  font-size: 17px; font-weight: 600; outline: none;
}
.stepper-input:focus { background: var(--accent-light); }

/* ── Switch ────────────────────────────────────────────────────────── */
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  position: relative; width: 51px; height: 31px; border-radius: 16px; flex-shrink: 0;
  background: var(--surface-3); transition: background .25s var(--ease);
}
.switch-thumb {
  position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,0.15), 0 1px 1px rgba(0,0,0,0.12);
  transition: transform .25s var(--spring);
}
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(20px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch-label { font-size: 15px; font-weight: 500; }
