/* ── Account page layout ── */
.account-main {
  max-width: 680px;
  margin: 0 auto;
  padding: var(--sp-xxl) var(--sp-lg) var(--sp-sec);
}

/* ── Unauthenticated splash ── */
.account-unauthenticated {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}
.account-unauth-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--r-2xl);
  padding: var(--sp-xxl) var(--sp-xl);
  text-align: center;
  backdrop-filter: blur(16px);
  box-shadow: 0 0 60px var(--glow-primary);
  max-width: 420px;
}
.account-unauth-card h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: var(--sp-sm);
}
.account-unauth-card p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}

/* ── Profile header ── */
.account-header {
  display: flex;
  align-items: flex-end;
  gap: var(--sp-lg);
  margin-bottom: var(--sp-xl);
  padding-bottom: var(--sp-xl);
  border-bottom: 1px solid var(--hairline);
}
.account-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}
.account-avatar {
  width: 80px;
  height: 80px;
  border-radius: var(--r-full);
  overflow: hidden;
  border: 3px solid var(--card-border);
  box-shadow: 0 0 24px var(--glow-primary);
}
.account-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.account-avatar-letter {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 800;
  color: #fff;
}
.account-avatar-edit {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 26px;
  height: 26px;
  border-radius: var(--r-full);
  background: var(--primary);
  border: 2px solid var(--canvas);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  transition: opacity 0.15s;
}
.account-avatar-edit:hover { opacity: 0.85; }

.account-header-info { flex: 1; min-width: 0; }
.account-username {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.2;
}
.account-email-display {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}
.account-joined {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* ── Settings sections ── */
.account-sections { display: flex; flex-direction: column; gap: var(--sp-lg); }

.account-section {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--r-xl);
  padding: var(--sp-lg);
  backdrop-filter: blur(16px);
}
.account-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: var(--sp-md);
}

.account-form { display: flex; flex-direction: column; gap: var(--sp-md); }
.account-field { display: flex; flex-direction: column; gap: 4px; }

.field-textarea {
  height: auto;
  resize: vertical;
  padding: var(--sp-sm) var(--sp-md);
  line-height: 1.5;
}

.field-hint {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

/* ── Feedback messages ── */
.auth-error {
  font-size: 13px;
  color: #ef4444;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.25);
  border-radius: var(--r-sm);
  padding: 8px 12px;
}
.auth-success {
  font-size: 13px;
  color: var(--success);
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.25);
  border-radius: var(--r-sm);
  padding: 8px 12px;
}

/* ── Danger zone ── */
.account-danger-section { border-color: rgba(239,68,68,0.2); }
.danger-title { color: #ef4444; }
.account-danger-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-md);
  padding: var(--sp-md) 0;
  border-bottom: 1px solid var(--hairline);
  flex-wrap: wrap;
}
.account-danger-row:last-child { border-bottom: none; padding-bottom: 0; }
.account-danger-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
}
.account-danger-desc {
  font-size: 12px;
  color: var(--muted);
  max-width: 320px;
  line-height: 1.5;
}

/* ── Danger button ── */
.btn-danger {
  background: rgba(239,68,68,0.12);
  color: #ef4444;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(239,68,68,0.3);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s, border-color 0.15s;
  font-family: var(--font);
  white-space: nowrap;
  min-height: 34px;
  -webkit-tap-highlight-color: transparent;
}
.btn-danger:hover {
  background: rgba(239,68,68,0.22);
  border-color: rgba(239,68,68,0.5);
}

/* ── Auth modal backdrop — deep navy fullscreen overlay ── */
#authModal.modal-backdrop {
  background: rgba(11, 19, 38, 0.96) !important;
  backdrop-filter: blur(0px) !important;
  -webkit-backdrop-filter: blur(0px) !important;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* ── Auth glass card ── */
.auth-modal {
  background: rgba(23, 31, 51, 0.80);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(196,199,200,0.12);
  border-radius: 16px;
  width: 100%;
  max-width: 440px;
  padding: 48px 48px 40px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  /* override base .modal styles */
  transform: none !important;
  max-height: none;
  overflow-y: visible;
}
#authModal.modal-backdrop.open .auth-modal {
  transform: none !important;
}

.auth-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  border: none;
  cursor: pointer;
  color: rgba(196,199,200,0.7);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.auth-close:hover { background: rgba(255,255,255,0.14); color: #fff; }

/* ── Header ── */
.auth-header { margin-bottom: 32px; }
.auth-logo-icon {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-end) 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 900; color: #fff;
  margin-bottom: 22px;
}
.auth-title {
  font-size: 32px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.auth-subtitle {
  font-size: 16px;
  color: rgba(196,199,200,0.75);
  margin: 0;
  line-height: 1.6;
}

/* ── Form ── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Label above input */
.auth-field-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.auth-field-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: rgba(218,226,253,0.80);
}
.auth-field-input {
  width: 100%;
  height: 44px;
  padding: 0 44px 0 14px;
  background: rgba(6, 14, 32, 0.5);
  border: 1px solid rgba(68,71,72,0.9);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 15px;
  color: #dae2fd;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  -webkit-appearance: none;
  box-sizing: border-box;
}
.auth-field-input::placeholder { color: rgba(142,145,146,0.45); }
.auth-field-input:focus {
  border-color: rgba(255,255,255,0.5);
  background: rgba(6,14,32,0.70);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.07);
}

/* char count */
.auth-char-count {
  position: absolute;
  right: 12px;
  bottom: 13px;
  font-size: 11px;
  color: rgba(142,145,146,0.65);
  pointer-events: none;
}

/* password eye */
.auth-eye {
  position: absolute;
  right: 10px;
  bottom: 10px;
  background: none;
  border: none;
  color: rgba(196,199,200,0.55);
  cursor: pointer;
  padding: 3px;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.auth-eye:hover { color: #dae2fd; }

/* hint text */
.auth-hint-text {
  font-size: 12px;
  color: rgba(142,145,146,0.75);
  margin-top: -6px;
  line-height: 1.5;
}

/* ── CTA — full-width solid white ── */
.auth-cta {
  width: 100%;
  height: 46px;
  border-radius: 8px;
  border: none;
  background: #ffffff;
  color: #0b1326;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: filter 0.15s, transform 0.12s;
  -webkit-tap-highlight-color: transparent;
  margin-top: 6px;
  align-self: auto;
  padding: 0;
  box-shadow: none;
}
.auth-cta:hover  { filter: brightness(0.93); transform: translateY(-1px); }
.auth-cta:active { transform: translateY(0); filter: brightness(0.88); }
.auth-cta:disabled { opacity: 0.4; cursor: not-allowed; transform: none; filter: none; }

/* ── Switch hint with top border ── */
.auth-switch-hint {
  font-size: 14px;
  color: rgba(196,199,200,0.75);
  text-align: center;
  margin: 0;
  padding-top: 20px;
  border-top: 1px solid rgba(68,71,72,0.4);
}
.auth-link {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  padding: 0;
  transition: opacity 0.12s;
}
.auth-link:hover { opacity: 0.7; }

/* hide old divider if present */
.auth-divider { display: none; }

@media (max-width: 480px) {
  #authModal.modal-backdrop { padding: 0; align-items: flex-end; }
  .auth-modal {
    border-radius: 20px 20px 0 0;
    padding: 36px 24px 32px;
    max-width: 100%;
  }
  .auth-title { font-size: 26px; }
}

/* ── field-input for dark theme ── */
.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--body);
  display: block;
  margin-bottom: 4px;
}
.field-input {
  width: 100%;
  height: 42px;
  padding: 0 var(--sp-md);
  background: var(--surface-soft);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
}
.field-input:focus {
  border-color: rgba(233,30,140,0.5);
  background: var(--surface-mid);
  box-shadow: 0 0 0 3px rgba(233,30,140,0.12);
}
.field-input::placeholder { color: var(--muted); }
.field-input option { background: var(--canvas); }

/* ── Nav account avatar ── */
.nav-avatar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--r-full);
  overflow: hidden;
  border: 2px solid var(--card-border);
  transition: border-color 0.15s, box-shadow 0.15s;
  text-decoration: none;
  flex-shrink: 0;
}
.nav-avatar-btn:hover {
  border-color: var(--primary);
  box-shadow: 0 0 10px var(--glow-primary);
}
.nav-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.nav-avatar-letter {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
}
.nav-signin-btn {
  font-size: 12px;
  padding: 6px 14px;
  min-height: 30px;
}

@media (max-width: 768px) {
  .account-header { flex-direction: column; align-items: flex-start; }
  .account-danger-row { flex-direction: column; align-items: flex-start; }
}
