/* ============================================================
   Account Settings — module-specific styles (ported from the kit).
   Premium form vocabulary built on kit tokens: section cards, text
   inputs, the toggle switch, radio rows, issue chips, the cover band +
   avatar, password fields, and the per-card foot. Tokens only.
   (The "Saved" flash + Save reveal are driven by the existing
   `wevote--settings--form` Stimulus controller, not a CSS class.)
   ============================================================ */

/* ---- section card ---- */
.set-card {
  border: 1px solid var(--hairline);
  background: var(--surface);
  border-radius: 20px;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.set-card__head {
  display: flex; align-items: flex-start; gap: 13px;
  padding: 18px 20px 16px;
}
.set-card__icon {
  width: 40px; height: 40px; flex: none; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-ink);
}
.set-card__title { font-family: "Poppins", sans-serif; font-weight: 600; font-size: 17px; letter-spacing: -.01em; color: var(--ink); line-height: 1.2; }
.set-card__sub { margin-top: 2px; font-size: 13px; color: var(--muted); line-height: 1.4; }
.set-card__body { padding: 4px 20px 20px; }
.set-card__foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid var(--hairline);
  background: var(--paper);
}

/* ---- text fields ---- */
.set-grid2 { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 560px) { .set-grid2 { grid-template-columns: 1fr 1fr; } }
.set-field { display: block; }
.set-label {
  display: flex; align-items: center; gap: 7px;
  margin-bottom: 7px;
  font-size: 12.5px; font-weight: 600; color: var(--ink);
}
.set-label .opt { font-family: "Open Sans", monospace; font-weight: 500; font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; }
.set-input, .set-textarea {
  width: 100%; height: 46px; padding: 0 14px;
  border-radius: 12px;
  background: var(--sunken);
  border: 1px solid transparent;
  color: var(--ink);
  font-family: inherit; font-size: 14.5px;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.set-input::placeholder { color: var(--faint); }
.set-input:hover { border-color: var(--hairline-strong); }
.set-input:focus { outline: none; background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.set-input:disabled { color: var(--faint); cursor: not-allowed; background: var(--sunken); opacity: .85; }
.set-input.has-prefix { padding-left: 30px; }
.set-input-wrap { position: relative; display: block; }
.set-input-wrap .prefix { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: 14.5px; pointer-events: none; }
.set-hint { margin-top: 7px; font-size: 12px; color: var(--faint); line-height: 1.4; }
.set-hint.is-error { color: var(--st-unres-fg); }

/* ---- toggle switch ---- */
.switch {
  position: relative; flex: none;
  width: 46px; height: 27px; border-radius: 999px;
  background: var(--hairline-strong);
  border: none; cursor: pointer; padding: 0;
  transition: background .2s ease;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 21px; height: 21px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.32);
  transition: transform .2s cubic-bezier(.22,.61,.36,1);
}
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(19px); }
.switch:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }

/* a labelled toggle row */
.toggle-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0;
}
.toggle-row + .toggle-row { border-top: 1px solid var(--hairline); }
.toggle-row__icon { width: 38px; height: 38px; flex: none; border-radius: 11px; display: grid; place-items: center; }
.toggle-row__label { font-size: 14.5px; font-weight: 600; color: var(--ink); line-height: 1.25; }
.toggle-row__desc { margin-top: 2px; font-size: 12.5px; color: var(--muted); line-height: 1.4; }

/* ---- radio rows (messaging) ---- */
.radio-row {
  width: 100%; text-align: left;
  display: flex; align-items: center; gap: 12px;
  padding: 13px 14px; border-radius: 13px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.radio-row + .radio-row { margin-top: 10px; }
.radio-row:hover { border-color: var(--hairline-strong); background: var(--sunken); }
.radio-row:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.radio-dot {
  width: 20px; height: 20px; flex: none; border-radius: 50%;
  border: 2px solid var(--hairline-strong);
  display: grid; place-items: center;
  transition: border-color .15s ease;
}
.radio-row:has(input:checked) .radio-dot { border-color: var(--accent); }
.radio-dot::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); transform: scale(0); transition: transform .15s ease; }
.radio-row:has(input:checked) .radio-dot::after { transform: scale(1); }
.radio-row__label { font-size: 14px; font-weight: 600; color: var(--ink); }
.radio-row:has(input:checked) .radio-row__label { color: var(--accent-ink); }
.radio-row__desc { font-size: 12.5px; color: var(--muted); margin-top: 1px; }

/* ---- account info read-only block ---- */
.info-grid { display: grid; grid-template-columns: 1fr; gap: 0; border: 1px solid var(--hairline); border-radius: 14px; overflow: hidden; }
@media (min-width: 560px) { .info-grid { grid-template-columns: 1fr 1fr; } }
.info-cell { padding: 12px 15px; background: var(--paper); border-bottom: 1px solid var(--hairline); }
@media (min-width: 560px) { .info-cell:nth-child(odd) { border-right: 1px solid var(--hairline); } }
.info-cell__k { font-family: "Open Sans", monospace; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.info-cell__v { margin-top: 4px; font-size: 14px; color: var(--ink); display: flex; align-items: center; gap: 6px; word-break: break-word; }

/* ---- issue chips ---- */
.issue-grid { display: grid; grid-template-columns: 1fr; gap: 11px; }
@media (min-width: 520px) { .issue-grid { grid-template-columns: 1fr 1fr; } }
.issue-chip {
  position: relative; text-align: left; width: 100%;
  display: flex; align-items: flex-start; gap: 11px;
  padding: 13px 14px; border-radius: 14px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.issue-chip:hover { border-color: var(--hairline-strong); box-shadow: var(--shadow-soft); }
.issue-chip:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.issue-chip__icon { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--sunken); color: var(--muted); transition: background .15s ease, color .15s ease; }
.issue-chip:has(input:checked) .issue-chip__icon { background: color-mix(in srgb, var(--accent) 18%, var(--surface)); color: var(--accent-ink); }
.issue-chip__title { font-size: 13.5px; font-weight: 600; color: var(--ink); line-height: 1.2; }
.issue-chip:has(input:checked) .issue-chip__title { color: var(--accent-ink); }
.issue-chip__desc { margin-top: 3px; font-size: 12px; color: var(--muted); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.issue-chip__check {
  position: absolute; top: 11px; right: 11px;
  width: 19px; height: 19px; border-radius: 50%;
  border: 2px solid var(--hairline-strong);
  display: grid; place-items: center; color: #fff;
  transition: background .15s ease, border-color .15s ease;
}
.issue-chip:has(input:checked) .issue-chip__check { background: var(--accent); border-color: var(--accent); }
.issue-chip__check svg { opacity: 0; transition: opacity .15s ease; }
.issue-chip:has(input:checked) .issue-chip__check svg { opacity: 1; }

/* ---- cover band + avatar ---- */
.cover-band {
  position: relative; width: 100%; aspect-ratio: 3 / 1;
  border-radius: 16px; overflow: hidden;
  background: var(--sunken);
  border: 1px solid var(--hairline);
}
.cover-hint { margin-top: 10px; font-size: 12px; color: var(--faint); }

.avatar-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.avatar-wrap { position: relative; width: 88px; height: 88px; flex: none; }
.avatar-wrap > div { width: 100%; height: 100%; border-radius: 50%; overflow: hidden; }
.avatar-badge {
  position: absolute; right: -2px; bottom: -2px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: grid; place-items: center;
  border: 3px solid var(--surface);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
}

/* ---- password fields ---- */
.pw-wrap { position: relative; }
.pw-wrap .set-input { padding-right: 44px; }
.pw-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center;
  color: var(--faint); border: none; background: transparent; cursor: pointer;
  transition: color .15s ease, background .15s ease;
}
.pw-eye:hover { color: var(--ink); background: var(--sunken); }

/* ---- checkbox-driven switch (privacy display-name) ----
   A real <input type=checkbox> drives the .switch visual, so the form stays
   native and the shared form controller reveals Save on change — no per-control
   JS. The checkbox sits directly before the .switch span. */
.switch-cb:checked + .switch { background: var(--accent); }
.switch-cb:checked + .switch::after { transform: translateX(19px); }
.switch-cb:focus-visible + .switch { box-shadow: 0 0 0 3px var(--ring); }

/* radio rows / issue chips also light up via :has(input:checked) (rules above).
   A keyboard focus ring for those native inputs: */
.radio-row:has(input:focus-visible),
.issue-chip:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--ring); }

/* ---- privacy display-name note swap (driven by the same checkbox) ---- */
.privacy-name .privacy-note-on { display: none; }
.privacy-name:has(.switch-cb:checked) .privacy-note-off { display: none; }
.privacy-name:has(.switch-cb:checked) .privacy-note-on { display: inline; }

/* ---- per-card foot hint ---- */
.set-foot-hint { margin-right: auto; font-size: 12.5px; color: var(--faint); }
