/* =====================================================================
   Toggle on/off untuk preferensi notifikasi. Dimuat setelah ux.css.
   Semua warna memakai variabel tema. Input asli tetap ada (disembunyikan secara visual)
   agar bisa difokus lewat keyboard dan dibaca pembaca layar.
   ===================================================================== */

.switch-list { display: grid; gap: 10px; }

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.switch-row:hover { border-color: color-mix(in srgb, var(--primary) 22%, var(--border)); }

.switch-text { display: grid; gap: 2px; min-width: 0; }
.switch-text .small { line-height: 1.45; overflow-wrap: anywhere; }

.switch { position: relative; flex: 0 0 auto; display: inline-flex; }

.switch-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}
.switch-input:disabled { cursor: not-allowed; }

.switch-track {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--muted) 28%, var(--surface));
  transition: background 0.22s var(--ease), border-color 0.22s var(--ease);
}

.switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.22s var(--ease);
}

.switch-input:checked + .switch-track {
  background: var(--primary);
  border-color: var(--primary);
}
.switch-input:checked + .switch-track .switch-thumb { transform: translateX(22px); }

.switch-input:focus-visible + .switch-track { box-shadow: var(--ring); }
.switch-input:disabled + .switch-track { opacity: 0.55; }

@media (prefers-reduced-motion: reduce) {
  .switch-row, .switch-track, .switch-thumb { transition: none; }
}
