/* koddeit — Lane B: Account page, Settings tab → Security section.
 *
 * Stitch system + reference-image restyle language: clean white
 * canvas, teal accent #0F766E, flat cards with a 1px #E2E8F0 border
 * (soft ambient shadow only, no heavy elevation), pill buttons,
 * 1px dividers between list rows. Every rule is scoped to
 * #account-section-security (or #view-account-page for the section
 * shell) so it cannot leak into the feed or other tabs, and it uses
 * NO !important — a last-loaded restyle sheet wins ties by order,
 * and these scoped selectors win only where they are more specific,
 * which is the intended behaviour, not a fight.
 * Dark mode follows the stitch-dark tokens (card #151c28, line
 * #263244, ink #f1f5f9, muted #94a3b8, accent text #5eead4) under
 * html[data-theme="dark"], the app's existing theme toggle. The
 * high-contrast guard :not([data-ob-contrast="high"]) is kept, as
 * in stitch-dark.css. Adopted legacy mounts keep their own classes
 * (.btn, .cv-box, .s3-list, .w2-list); this sheet styles the section
 * furniture around them and gives their buttons/inputs the same
 * 44px targets and pill shape where the section scope reaches them.
 */

/* ---------- Section shell + cards (light) ---------- */
#account-section-security {
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: #0f172a;
}

#account-section-security .acct-sec-head h3,
#account-section-security .acct-sec-card h4,
#account-section-security .acct-sec-signedout h3 {
  margin: 0 0 8px;
  color: #0f172a;
}

#account-section-security .acct-sec-head > p:first-of-type {
  color: #475569;
  margin: 0 0 8px;
}

#account-section-security .acct-sec-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

#account-section-security .acct-sec-card h4 {
  font-size: 17px;
}

#account-section-security .acct-sec-card h5 {
  margin: 16px 0 8px;
  color: #0f172a;
}

#account-section-security .acct-sec-note {
  color: #475569;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 0 12px;
  line-height: 1.5;
}

#account-section-security .acct-sec-head .acct-sec-note {
  margin-top: 8px;
}

/* ---------- Fields, pill buttons, lists ---------- */
#account-section-security .acct-sec-field {
  display: block;
  margin: 0 0 12px;
  color: #334155;
}

#account-section-security .acct-sec-field input[type="text"],
#account-section-security .acct-sec-field input[type="email"],
#account-section-security .acct-sec-field input[type="password"] {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: 44px;
  margin-top: 6px;
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  color: #0f172a;
  font-size: 15px;
}

#account-section-security .acct-sec-field input[type="checkbox"] {
  width: 20px;
  height: 20px;
  vertical-align: middle;
  margin-right: 8px;
  accent-color: #0f766e;
}

#account-section-security .acct-sec-btn,
#account-section-security .acct-sec-card .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid #0f766e;
  background: #0f766e;
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin: 0 8px 8px 0;
}

#account-section-security .acct-sec-btn:hover,
#account-section-security .acct-sec-card .btn:hover {
  background: #0d9488;
  border-color: #0d9488;
}

#account-section-security .acct-sec-btn-ghost,
#account-section-security .acct-sec-card .btn.btn-ghost {
  background: #ffffff;
  color: #0f766e;
}

#account-section-security .acct-sec-btn-ghost:hover,
#account-section-security .acct-sec-card .btn.btn-ghost:hover {
  background: #f0fdfa;
}

#account-section-security .acct-sec-list,
#account-section-security .acct-sec-codes {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}

#account-section-security .acct-sec-list li {
  padding: 12px 0;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

#account-section-security .acct-sec-list li:last-child {
  border-bottom: none;
}

#account-section-security .acct-sec-codes li {
  padding: 6px 0;
  border-bottom: 1px solid #e2e8f0;
}

#account-section-security .acct-sec-codes code {
  font-family: JetBrains Mono, ui-monospace, Menlo, monospace;
  font-size: 14px;
  letter-spacing: 0.04em;
}

#account-section-security .acct-sec-ok {
  color: #0f766e;
}

#account-section-security .acct-sec-error {
  color: #b91c1c;
}

#account-section-security .acct-sec-card ul:not(.acct-sec-list):not(.acct-sec-codes) li {
  padding: 8px 0;
  border-bottom: 1px solid #e2e8f0;
}

#account-section-security .acct-sec-card ul:not(.acct-sec-list):not(.acct-sec-codes) li:last-child {
  border-bottom: none;
}

/* ---------- Dark mode (stitch-dark tokens) ---------- */
html[data-theme="dark"]:not([data-ob-contrast="high"]) #account-section-security {
  color: #f1f5f9;
}

html[data-theme="dark"]:not([data-ob-contrast="high"]) #account-section-security .acct-sec-head h3,
html[data-theme="dark"]:not([data-ob-contrast="high"]) #account-section-security .acct-sec-card h4,
html[data-theme="dark"]:not([data-ob-contrast="high"]) #account-section-security .acct-sec-card h5,
html[data-theme="dark"]:not([data-ob-contrast="high"]) #account-section-security .acct-sec-signedout h3 {
  color: #f1f5f9;
}

html[data-theme="dark"]:not([data-ob-contrast="high"]) #account-section-security .acct-sec-head > p:first-of-type,
html[data-theme="dark"]:not([data-ob-contrast="high"]) #account-section-security .acct-sec-field {
  color: #cbd5e1;
}

html[data-theme="dark"]:not([data-ob-contrast="high"]) #account-section-security .acct-sec-card {
  background: #151c28;
  border-color: #263244;
  box-shadow: none;
}

html[data-theme="dark"]:not([data-ob-contrast="high"]) #account-section-security .acct-sec-note {
  color: #cbd5e1;
  background: #1c2536;
  border-color: #263244;
}

html[data-theme="dark"]:not([data-ob-contrast="high"]) #account-section-security .acct-sec-field input[type="text"],
html[data-theme="dark"]:not([data-ob-contrast="high"]) #account-section-security .acct-sec-field input[type="email"],
html[data-theme="dark"]:not([data-ob-contrast="high"]) #account-section-security .acct-sec-field input[type="password"] {
  background: #1c2536;
  border-color: #334155;
  color: #f1f5f9;
}

html[data-theme="dark"]:not([data-ob-contrast="high"]) #account-section-security .acct-sec-btn-ghost,
html[data-theme="dark"]:not([data-ob-contrast="high"]) #account-section-security .acct-sec-card .btn.btn-ghost {
  background: #1c2536;
  color: #5eead4;
  border-color: #2dd4bf;
}

html[data-theme="dark"]:not([data-ob-contrast="high"]) #account-section-security .acct-sec-btn-ghost:hover,
html[data-theme="dark"]:not([data-ob-contrast="high"]) #account-section-security .acct-sec-card .btn.btn-ghost:hover {
  background: #134e4a;
}

html[data-theme="dark"]:not([data-ob-contrast="high"]) #account-section-security .acct-sec-list li,
html[data-theme="dark"]:not([data-ob-contrast="high"]) #account-section-security .acct-sec-codes li,
html[data-theme="dark"]:not([data-ob-contrast="high"]) #account-section-security .acct-sec-card ul:not(.acct-sec-list):not(.acct-sec-codes) li {
  border-bottom-color: #263244;
}

html[data-theme="dark"]:not([data-ob-contrast="high"]) #account-section-security .acct-sec-ok {
  color: #5eead4;
}

html[data-theme="dark"]:not([data-ob-contrast="high"]) #account-section-security .acct-sec-error {
  color: #fca5a5;
}

/* ---------- Narrow screens: full-width 44px targets ---------- */
@media (max-width: 640px) {
  #account-section-security .acct-sec-card {
    padding: 16px;
  }

  #account-section-security .acct-sec-btn {
    width: 100%;
    margin-right: 0;
  }
}
