/* account-settings.css — Account & Profile slide-in panel
 * Inspired by Instagram/X: slides from the right, full-screen on mobile.
 * Uses CSS custom properties from the active theme for seamless dark/light mode.
 */

/* ── Backdrop ──────────────────────────────────────────────────────────────── */
#acct-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  z-index: 89990;
  transition: background 0.3s ease;
}
#acct-backdrop.acct-open {
  display: block;
  background: rgba(0, 0, 0, 0.35);
}

/* ── Panel ─────────────────────────────────────────────────────────────────── */
#acct-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 480px;
  max-width: 100vw;
  background: var(--surface, #ffffff);
  border-left: 1px solid var(--surface-border, rgba(0,0,0,0.08));
  box-shadow: -4px 0 48px rgba(0, 0, 0, 0.28);
  z-index: 89991;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}
#acct-panel.acct-open {
  transform: translateX(0);
}

/* ── Header ─────────────────────────────────────────────────────────────────── */
.acct-header {
  display: flex;
  align-items: center;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  flex-shrink: 0;
  gap: 8px;
}
.acct-header-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text, #12324a);
  flex: 1;
  margin: 0;
}
.acct-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  color: var(--text-muted, #62778c);
  font-size: 1.1rem;
  line-height: 1;
  transition: background 0.15s;
  flex-shrink: 0;
}
.acct-close-btn:hover { background: var(--bg3, #f1f5f9); }

/* ── Identity bar (avatar + name + email) ────────────────────────────────── */
.acct-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  flex-shrink: 0;
  background: var(--surface, #ffffff);
}
.acct-id-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #00b8a9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
  cursor: pointer;
}
.acct-id-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.acct-id-name  { font-size: 1rem; font-weight: 700; color: var(--text, #12324a); line-height: 1.2; }
.acct-id-email { font-size: 0.82rem; color: var(--text-muted, #62778c); margin-top: 2px; }

/* ── Tab bar ─────────────────────────────────────────────────────────────── */
.acct-tabs {
  display: flex;
  border-bottom: 1px solid var(--border, #e2e8f0);
  flex-shrink: 0;
  background: var(--surface, #ffffff);
}
.acct-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 4px 8px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-muted, #62778c);
  font-size: 0.7rem;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  letter-spacing: 0.01em;
}
.acct-tab .acct-tab-icon { font-size: 1.15rem; line-height: 1; }
.acct-tab:hover { color: var(--text, #12324a); }
.acct-tab.active {
  color: var(--blue, #3b82f6);
  border-bottom-color: var(--blue, #3b82f6);
}

/* ── Scrollable content area ─────────────────────────────────────────────── */
.acct-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 0 40px;
}

/* ── Section cards ────────────────────────────────────────────────────────── */
.acct-section {
  padding: 18px 20px 4px;
}
.acct-section + .acct-section {
  border-top: 1px solid var(--border, #e2e8f0);
}
.acct-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted, #62778c);
  margin: 0 0 12px;
}

/* ── Form elements ────────────────────────────────────────────────────────── */
.acct-field {
  margin-bottom: 14px;
}
.acct-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted, #62778c);
  margin-bottom: 5px;
}
.acct-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1.5px solid var(--border, #e2e8f0);
  border-radius: 10px;
  font-size: 0.95rem;
  color: var(--text, #12324a);
  background: var(--bg2, #f8fafc);
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}
.acct-input:focus { border-color: var(--blue, #3b82f6); }
.acct-input[type="date"] { color-scheme: light dark; }

.acct-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.acct-btn-primary {
  width: 100%;
  padding: 12px;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 8px;
  transition: background 0.2s;
  font-family: inherit;
}
.acct-btn-primary:hover    { background: #2563eb; }
.acct-btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }

.acct-btn-ghost {
  width: 100%;
  padding: 11px;
  background: transparent;
  color: var(--text-muted, #62778c);
  border: 1.5px solid var(--border, #e2e8f0);
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 8px;
  transition: border-color 0.2s, color 0.2s;
  font-family: inherit;
  text-align: center;
}
.acct-btn-ghost:hover { border-color: #3b82f6; color: #3b82f6; }

.acct-btn-danger        { color: #ef4444 !important; }
.acct-btn-danger:hover  { border-color: #ef4444 !important; color: #ef4444 !important; }

.acct-btn-sm {
  padding: 5px 12px;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: background 0.2s;
}
.acct-btn-sm:hover { background: #2563eb; }

/* ── Status messages ─────────────────────────────────────────────────────── */
.acct-status {
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 10px;
}
.acct-status-success { background: #dcfce7; color: #15803d; }
.acct-status-error   { background: #fee2e2; color: #dc2626; }
.acct-status-info    { background: #dbeafe; color: #1d4ed8; }

.acct-hint {
  font-size: 0.78rem;
  color: var(--text-muted, #62778c);
  margin: -6px 0 12px;
  line-height: 1.4;
}

/* ── Info rows (label:value) ─────────────────────────────────────────────── */
.acct-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border, #e2e8f0);
  font-size: 0.88rem;
  gap: 8px;
}
.acct-info-row:last-of-type { border-bottom: none; }
.acct-info-label { color: var(--text, #12324a); font-weight: 600; }
.acct-info-value { color: var(--text-muted, #62778c); text-align: right; }

/* ── Profile tab avatar ──────────────────────────────────────────────────── */
.acct-avatar-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}
.acct-avatar-wrap {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  cursor: pointer;
  background: linear-gradient(135deg, #3b82f6, #00b8a9);
  display: flex;
  align-items: center;
  justify-content: center;
}
.acct-avatar-initials {
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
.acct-avatar-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.38);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  opacity: 0;
  transition: opacity 0.2s;
  border-radius: 50%;
}
.acct-avatar-wrap:hover .acct-avatar-overlay { opacity: 1; }

/* ── Login history list ──────────────────────────────────────────────────── */
.acct-login-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border, #e2e8f0);
  font-size: 0.85rem;
}
.acct-login-item:last-child { border-bottom: none; }
.acct-login-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  width: 28px;
  text-align: center;
}
.acct-login-device { font-weight: 600; color: var(--text, #12324a); }
.acct-login-meta   { font-size: 0.78rem; color: var(--text-muted, #62778c); margin-top: 1px; }

/* ── MFA status badge ────────────────────────────────────────────────────── */
.acct-mfa-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}
.acct-mfa-on  { background: #dcfce7; color: #15803d; }
.acct-mfa-off { background: #fee2e2; color: #dc2626; }

/* ── Look tab theme buttons ──────────────────────────────────────────────── */
.acct-theme-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.acct-theme-btn {
  padding: 16px 12px;
  border: 1.5px solid var(--border, #e2e8f0);
  border-radius: 12px;
  background: var(--bg2, #f8fafc);
  cursor: pointer;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text, #12324a);
  transition: border-color 0.2s, background 0.2s;
  font-family: inherit;
}
.acct-theme-btn:hover {
  border-color: var(--blue, #3b82f6);
  background: var(--bg3, #eff6ff);
}
.acct-theme-btn .acct-theme-icon { font-size: 1.6rem; display: block; margin-bottom: 5px; }

/* ── Danger zone ─────────────────────────────────────────────────────────── */
.acct-danger-title { color: #ef4444 !important; }

/* ── Deletion flow: reason radio rows ────────────────────────────────────── */
.acct-del-reason-row {
  display: flex;
  align-items: center;
  padding: 11px 12px;
  margin-bottom: 6px;
  border: 1.5px solid var(--border, #e2e8f0);
  border-radius: 10px;
  background: var(--input-bg, #f8fafc);
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text, #12324a);
  transition: border-color 0.15s, background 0.15s;
}
.acct-del-reason-row:has(input:checked) {
  border-color: #3b82f6;
  background: #eff6ff;
}
.acct-del-reason-row:hover { border-color: #3b82f6; }

/* ── Inline text-style link button ───────────────────────────────────────── */
.acct-link-btn {
  background: none;
  border: none;
  color: #3b82f6;
  cursor: pointer;
  font-size: 0.88rem;
  padding: 4px 0;
  text-decoration: underline;
  font-family: inherit;
}

/* ── Profile top row: dashed avatar + name block + edit btn ─────────────── */
.acct-profile-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 4px;
}
.acct-profile-name-block {
  flex: 1;
  min-width: 0;
}

/* Dashed ring avatar with camera overlay */
.acct-avatar-dashed {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2.5px dashed var(--text-muted, #94a3b8);
  padding: 3px;
  flex-shrink: 0;
  position: relative;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s;
}
.acct-avatar-dashed:hover { border-color: #3b82f6; }
.acct-avatar-dashed-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: #fff;
  opacity: 0;
  transition: opacity 0.2s;
}
.acct-avatar-dashed:hover .acct-avatar-dashed-overlay { opacity: 1; }
/* Always subtle on touch devices */
@media (hover: none) {
  .acct-avatar-dashed-overlay { opacity: 0.7; }
}

/* ── Security nav rows ────────────────────────────────────────────────────── */
.acct-nav-row {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 12px;
  padding: 13px 4px;
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 1px solid var(--border, #e2e8f0);
  font-size: 0.93rem;
  font-family: inherit;
  color: var(--text, #12324a);
  text-align: left;
  transition: background 0.15s;
}
.acct-nav-row:last-child { border-bottom: none; }
.acct-nav-row:hover { background: var(--hover-bg, #f8fafc); }
.acct-nav-row-icon   { font-size: 1.1rem; flex-shrink: 0; }
.acct-nav-row-label  { flex: 1; font-weight: 600; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.acct-nav-row-chevron { color: var(--text-muted, #94a3b8); font-size: 1.2rem; flex-shrink: 0; }

/* ── Security sub-screen header (back + title) ───────────────────────────── */
.acct-sec-subheader {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px 10px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  flex-shrink: 0;
  background: var(--card-bg, #fff);
}
.acct-back-row-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #3b82f6;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 4px 0;
  flex-shrink: 0;
  font-family: inherit;
}
.acct-sec-sub-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text, #12324a);
}

/* ── Last-login info banner ──────────────────────────────────────────────── */
.acct-last-login-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: var(--input-bg, #f8fafc);
  border-bottom: 1px solid var(--border, #e2e8f0);
}
.acct-last-login-icon { font-size: 1.1rem; flex-shrink: 0; }

/* ── Password show/hide toggle ───────────────────────────────────────────── */
.acct-pw-wrap {
  position: relative;
}
.acct-pw-wrap .acct-input { padding-right: 40px; }
.acct-eye-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-muted, #62778c);
  padding: 4px;
  line-height: 1;
}
.acct-pw-warning {
  font-size: 0.8rem;
  color: #b45309;
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
  line-height: 1.5;
}

/* ── "This device" badge on trusted devices ──────────────────────────────── */
.acct-this-device-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: #dbeafe;
  color: #1d4ed8;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  vertical-align: middle;
  margin-left: 6px;
}

/* ── Interest / brand chips (read-only tag pills) ────────────────────────── */
.acct-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding-bottom: 4px;
}
.acct-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  background: var(--input-bg, #f1f5f9);
  border: 1.5px solid var(--border, #e2e8f0);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text, #12324a);
  white-space: nowrap;
}

/* ── Mobile: full screen ─────────────────────────────────────────────────── */
@media (max-width: 520px) {
  #acct-panel {
    width: 100vw;
    border-radius: 0;
    box-shadow: none;
  }
  .acct-row-2 {
    grid-template-columns: 1fr;
  }
}
