/* =============================================================================
   Auth Modal + Nav User Styles
   ============================================================================= */

/* --- MODAL OVERLAY --- */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  animation: authFadeIn 0.2s ease;
}
@keyframes authFadeIn { from { opacity: 0; } to { opacity: 1; } }

.auth-modal {
  position: relative;
  width: 90%;
  max-width: 420px;
  background: var(--surface-card, #12121f);
  border: 1px solid var(--border, #1a1a2d);
  border-radius: 16px;
  padding: 40px 32px 32px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
}
.auth-modal__close {
  position: absolute; top: 14px; right: 16px;
  background: none; border: none; color: var(--text-muted, #7a7a8c);
  font-size: 1.6rem; cursor: pointer; line-height: 1;
  transition: color 0.15s;
}
.auth-modal__close:hover { color: var(--text, #e8e6e3); }

/* --- TABS --- */
.auth-modal__tabs {
  display: flex; gap: 4px; margin-bottom: 20px;
  border-bottom: 1px solid var(--border, #1a1a2d);
}
.auth-modal__tab {
  flex: 1; padding: 10px 0; background: none; border: none;
  color: var(--text-muted, #7a7a8c); font-family: inherit; font-size: 0.95rem;
  cursor: pointer; border-bottom: 2px solid transparent; transition: all 0.2s;
}
.auth-modal__tab.is-active {
  color: var(--gold, #c8a24e); border-bottom-color: var(--gold, #c8a24e);
}

/* --- ERROR --- */
.auth-modal__error {
  color: #e55; font-size: 0.85rem; min-height: 1.2em; margin-bottom: 8px; text-align: center;
}
/* --- FORM --- */
.auth-form {
  display: flex; flex-direction: column; gap: 12px;
}
.auth-form__input {
  background: var(--surface, #0a0a12);
  border: 1px solid var(--border, #1a1a2d);
  border-radius: 8px;
  color: var(--text, #e8e6e3);
  padding: 12px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  transition: border-color 0.2s;
  outline: none;
}
.auth-form__input::placeholder { color: var(--text-dim, #555566); }
.auth-form__input:focus {
  border-color: var(--gold, #c8a24e);
  box-shadow: 0 0 0 2px rgba(200, 162, 78, 0.15);
}
.auth-form__submit {
  margin-top: 4px; width: 100%; padding: 12px; font-size: 0.95rem;
}

/* --- DIVIDER --- */
.auth-form__divider {
  display: flex; align-items: center; gap: 12px;
  margin: 16px 0; color: var(--text-dim, #555566); font-size: 0.8rem;
}
.auth-form__divider::before,
.auth-form__divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border, #1a1a2d);
}
/* --- DISCORD BUTTON --- */
.auth-form__discord {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 12px; border: none; border-radius: 8px;
  background: #5865F2; color: #fff;
  font-family: 'Inter', sans-serif; font-size: 0.9rem; font-weight: 600;
  cursor: pointer; transition: background 0.2s;
}
.auth-form__discord:hover { background: #4752c4; }

/* --- RESEND VERIFICATION --- */
.auth-form__resend-btn {
  background: none; border: 1px solid var(--border, #1a1a2d); border-radius: 8px;
  color: var(--text-muted, #7a7a8c); font-family: 'Inter', sans-serif; font-size: 0.82rem;
  padding: 10px; cursor: pointer; transition: all 0.2s;
}
.auth-form__resend-btn:hover:not(:disabled) { color: var(--gold, #c8a24e); border-color: var(--gold, #c8a24e); }
.auth-form__resend-btn:disabled { opacity: 0.5; cursor: default; }
.auth-form__resend-link {
  background: none; border: none; color: var(--text-dim, #555566);
  font-family: 'Inter', sans-serif; font-size: 0.78rem; cursor: pointer;
  padding: 4px 0; margin-top: 4px; transition: color 0.15s; text-align: center; width: 100%;
}
.auth-form__resend-link:hover:not(:disabled) { color: var(--gold, #c8a24e); }
.auth-form__forgot-link {
  background: none; border: none; color: var(--text-muted, #7a7a8c);
  font-family: 'Inter', sans-serif; font-size: 0.82rem; cursor: pointer;
  padding: 6px 0; margin-top: 2px; transition: color 0.15s; text-align: center; width: 100%;
}
.auth-form__forgot-link:hover:not(:disabled) { color: var(--gold, #c8a24e); }
.auth-form__forgot-link:disabled { opacity: 0.5; cursor: default; }

/* --- NAV USER (logged-in state) --- */

/* Dropdown slide-in animation */
@keyframes navDropIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Ensure auth/user pill is always rightmost in nav */
#nav-auth {
  order: 99;
}

/* Container */
.nav-user {
  position: relative;
}

/* Toggle button (pill shape) */
.nav-user__toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  background: none;
  border: 1px solid var(--border, #1a1a2d);
  border-radius: 999px;
  color: var(--text, #e8e6e3);
  padding: 7px 18px 7px 7px;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.nav-user__toggle:hover {
  border-color: var(--gold, #c8a24e);
  box-shadow: 0 0 8px rgba(200, 162, 78, 0.25), 0 0 2px rgba(200, 162, 78, 0.15);
}

/* Avatar circle */
.nav-user__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed 0%, #c8a24e 100%);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
  line-height: 1;
}

/* Info column */
.nav-user__info {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
  gap: 3px;
}

/* Username */
.nav-user__name {
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Meta row (holds role badge + title) */
.nav-user__meta {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
}

/* Role pill badge */
.nav-user__role {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 999px;
  line-height: 1.4;
  white-space: nowrap;
}
.nav-user__role--alpha {
  background: rgba(124, 58, 237, 0.20);
  color: #a96bd6;
}
.nav-user__role--founder {
  background: rgba(200, 162, 78, 0.30);
  color: var(--gold-light, #e0c06a);
}
.nav-user__role--premium {
  background: rgba(200, 162, 78, 0.15);
  color: var(--gold, #c8a24e);
}
.nav-user__role--supporter {
  background: rgba(232, 67, 147, 0.15);
  color: #e84393;
}
.nav-user__role--member {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted, #7a7a8c);
}
.nav-user__role--admin {
  background: rgba(196, 30, 58, 0.20);
  color: #e84057;
}
.nav-user__role--moderator {
  background: rgba(91, 155, 213, 0.20);
  color: #5b9bd5;
}

/* Forum title (shown inline in meta row next to role badge) */
.nav-user__title {
  font-size: 0.62rem;
  font-weight: 500;
  color: var(--text-dim, #555566);
  letter-spacing: 0.02em;
  white-space: nowrap;
  padding-left: 5px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

/* Chevron arrow */
.nav-user__chevron {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
  fill: currentColor;
  opacity: 0.6;
}
.nav-user__dropdown.is-open ~ .nav-user__chevron,
.nav-user__toggle[aria-expanded="true"] .nav-user__chevron {
  transform: rotate(180deg);
}

/* Dropdown panel */
.nav-user__dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--surface-card, #12121f);
  border: 1px solid var(--border, #1a1a2d);
  border-radius: 12px;
  padding: 6px 0;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55), 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 200;
}
.nav-user__dropdown.is-open {
  display: block;
  animation: navDropIn 0.15s ease forwards;
}

/* Dropdown header */
.nav-user__dropdown-header {
  padding: 14px 18px;
}
.nav-user__dropdown-name {
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
}
.nav-user__dropdown-title {
  color: var(--text-muted, #7a7a8c);
  font-size: 0.75rem;
  margin-top: 2px;
  line-height: 1.3;
}

/* Dropdown divider */
.nav-user__dropdown-divider {
  height: 1px;
  background: var(--border, #1a1a2d);
  margin: 4px 12px;
}

/* Dropdown menu items */
.nav-user__dropdown-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 18px;
  background: none;
  border: none;
  text-align: left;
  color: var(--text-muted, #7a7a8c);
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  text-decoration: none;
  line-height: 1.3;
}
.nav-user__dropdown-item:hover {
  color: var(--text, #e8e6e3);
  background: rgba(255, 255, 255, 0.04);
}

/* Dropdown item icons */
.nav-user__dropdown-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.7;
}

/* Admin variant */
.nav-user__dropdown-item--admin {
  color: #e84057;
}
.nav-user__dropdown-item--admin:hover {
  color: #ff5a6e;
  background: rgba(196, 30, 58, 0.08);
}

/* Logout variant */
.nav-user__dropdown-item--logout {
  color: #c44;
}
.nav-user__dropdown-item--logout:hover {
  color: #e55;
  background: rgba(200, 50, 50, 0.08);
}

/* --- ACCOUNT PAGE SECTIONS --- */
.account-section {
  background: var(--surface-card, #12121f);
  border: 1px solid var(--border, #1a1a2d);
  border-radius: 12px;
  padding: 28px 32px;
  margin-bottom: 24px;
}
.account-section h2 {
  font-family: 'Cinzel', serif;
  font-size: 1.2rem;
  color: var(--gold, #c8a24e);
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border, #1a1a2d);
}
.account-field { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.account-field__label { color: var(--text-muted, #7a7a8c); font-size: 0.85rem; min-width: 120px; }
.account-field__value { color: var(--text, #e8e6e3); font-size: 0.9rem; }
.account-field__input {
  background: var(--surface, #0a0a12);
  border: 1px solid var(--border, #1a1a2d);
  border-radius: 6px; color: var(--text, #e8e6e3);
  padding: 8px 12px; font-family: 'Inter', sans-serif; font-size: 0.9rem;
  outline: none; transition: border-color 0.2s;
}
.account-field__input:focus { border-color: var(--gold, #c8a24e); }
.account-field__save {
  padding: 6px 16px; font-size: 0.8rem; border-radius: 6px;
}

.tier-badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
}
.tier-badge--free    { background: rgba(255,255,255,0.06); color: var(--text-muted, #7a7a8c); }
.tier-badge--premium { background: rgba(200,162,78,0.15);  color: var(--gold, #c8a24e); }
.tier-badge--founder { background: rgba(200,162,78,0.25);  color: var(--gold-light, #e0c06a); }

/* --- CHARACTER LIST --- */
.char-list { list-style: none; padding: 0; margin: 0; }
.char-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.04);
}
.char-row:last-child { border-bottom: none; }
.char-name { color: var(--text, #e8e6e3); font-weight: 600; }
.char-meta { color: var(--text-muted, #7a7a8c); font-size: 0.8rem; }
.char-meta span + span::before { content: ' · '; }