/* ============================================================
   Account settings page — layout, cards, toggle switch.
   Reuses tokens from styles.css (--navy*, --gold*, --r-*, --shadow-*).
   ============================================================ */

.acct-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 40px;
  align-items: start;
}

/* ---------- Side nav ---------- */
.acct-side {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
}

.acct-side nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.acct-side__link {
  padding: 9px 12px;
  border-radius: var(--r-sm);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--muted);
  transition: 0.2s;
}

.acct-side__link:hover {
  color: var(--ink);
  background: var(--bg-warm);
}

.acct-side__link.is-active {
  color: var(--navy-btn);
  background: var(--gold-soft);
}

.acct-side__link--danger {
  margin-top: 10px;
  color: #b3261e;
}

.acct-side__link--danger:hover {
  color: #fff;
  background: #b3261e;
}

/* ---------- Cards ---------- */
.acct-main {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
}

.acct-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px 30px;
  box-shadow: var(--shadow-sm);
  scroll-margin-top: calc(var(--nav-h) + 16px);
}

.acct-card__head h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 4px;
}

.acct-card__head p {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0 0 20px;
}

.acct-card form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.acct-card__foot {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
}

.acct-card__foot--wrap {
  flex-wrap: wrap;
}

.acct-flash {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1f8a4c;
  opacity: 0;
  transition: opacity 0.25s;
}

.acct-flash.show {
  opacity: 1;
}

.acct-flash[data-kind="error"] {
  color: #b3261e;
}

/* ---------- Dashboard overview ---------- */
.acct-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.acct-stat {
  display: flex;
  flex-direction: column;
  min-height: 104px;
  justify-content: space-between;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fbfcfd;
  transition: border-color 0.2s, transform 0.2s;
}

.acct-stat:hover {
  border-color: rgba(181, 136, 45, 0.45);
  transform: translateY(-1px);
}

.acct-stat b {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2.6vw, 2rem);
  line-height: 1;
  font-weight: 650;
}

.acct-stat span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.acct-completion {
  padding: 16px;
  border-radius: var(--r-md);
  border: 1px solid rgba(12, 27, 46, 0.12);
  background: linear-gradient(180deg, #fff, var(--bg-warm));
}

.acct-completion__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.acct-completion__head strong {
  display: block;
  color: var(--ink);
  font-size: 0.96rem;
}

.acct-completion__head span,
.acct-next {
  color: var(--muted);
  font-size: 0.85rem;
}

.acct-completion__head b {
  color: var(--navy-btn);
  font-size: 1.1rem;
}

.acct-progress {
  height: 8px;
  border-radius: var(--r-pill);
  background: #dfe5ed;
  overflow: hidden;
  margin: 12px 0 10px;
}

.acct-progress span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--gold);
  transition: width 0.35s ease;
}

/* ---------- Saved searches ---------- */
.acct-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.acct-list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg-warm);
}

.acct-list__title {
  color: var(--ink);
  font-weight: 700;
  font-size: 0.95rem;
}

.acct-list__meta {
  color: var(--muted);
  font-size: 0.86rem;
  margin-top: 3px;
}

.acct-list__sub,
.acct-empty {
  color: var(--faint);
  font-size: 0.82rem;
  margin-top: 4px;
}

.acct-empty {
  margin: 0;
  padding: 12px 0;
}

/* ---------- Request history ---------- */
.acct-timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.acct-timeline__item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
}

.acct-timeline__title {
  color: var(--ink);
  font-weight: 700;
  font-size: 0.95rem;
}

.acct-timeline__meta,
.acct-timeline__body {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 4px;
}

.acct-timeline__body {
  color: var(--faint);
}

.acct-status {
  align-self: start;
  border-radius: var(--r-pill);
  padding: 4px 9px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  background: #e9eef2;
  color: #4f5f70;
}

.acct-status[data-state="new"] {
  background: #eef3fb;
  color: #1a4f9c;
}

.acct-status[data-state="contacted"] {
  background: #fff5e3;
  color: #8a6512;
}

.acct-status[data-state="qualified"] {
  background: #e3f1e6;
  color: #1f7a37;
}

.acct-status[data-state="closed"] {
  background: #e9eef2;
  color: #5a6672;
}

.acct-status[data-state="spam"] {
  background: #fbe9ec;
  color: #b00020;
}

/* ---------- Login method readout ---------- */
.acct-method {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-warm);
  border-radius: var(--r-md);
  margin-bottom: 18px;
}

.acct-method__ic {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--gold-soft);
  color: var(--gold-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.acct-method__ic svg {
  width: 19px;
  height: 19px;
}

.acct-method__label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--faint);
  font-weight: 700;
}

.acct-method__value {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--ink);
}

/* ---------- Preference rows + toggle switch ---------- */
.acct-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.acct-row:last-of-type {
  border-bottom: none;
}

.acct-row__label {
  font-weight: 600;
  color: var(--ink);
  font-size: 0.95rem;
}

.acct-row__sub {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 2px;
}

.toggle {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  cursor: pointer;
}

.toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle__track {
  width: 44px;
  height: 26px;
  border-radius: var(--r-pill);
  background: #d7dce3;
  transition: 0.2s;
  display: inline-block;
}

.toggle__thumb {
  display: block;
  width: 20px;
  height: 20px;
  margin: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s;
}

.toggle input:checked + .toggle__track {
  background: var(--navy-btn);
}

.toggle input:checked + .toggle__track .toggle__thumb {
  transform: translateX(18px);
}

.toggle input:focus-visible + .toggle__track {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.toggle--locked {
  cursor: not-allowed;
  opacity: 0.7;
}

/* ---------- Close account ---------- */
.acct-card--danger {
  border-color: #f3c8c6;
  background: #fdf6f6;
}

.acct-card--danger .acct-card__head h2 {
  color: #8c2a23;
}

.btn--danger {
  background: #b3261e;
  color: #fff;
  border: 1px solid #b3261e;
}

.btn--danger:hover {
  background: #8c2a23;
  border-color: #8c2a23;
}

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .acct-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .acct-side {
    position: static;
  }

  .acct-side nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }

  .acct-card {
    padding: 22px;
  }

  .acct-list__item {
    align-items: flex-start;
    flex-direction: column;
  }

  .acct-timeline__item {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .acct-side {
    display: none;
  }
}
