/* --------------------------------------------------------------------
   Site account: header chip, dropdown, and the login / profile dialogs.

   Loaded on every page, so everything here is namespaced `acct-` and
   nothing selects a bare element. Colours come from the existing custom
   properties in styles.css rather than new literals, so this inherits the
   site's palette instead of starting a second one.
   -------------------------------------------------------------------- */

#account-slot {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* Reserves the chip's width during the /api/me round-trip. Without it the
   header reflows on every page load the moment auth state resolves. */
.acct-skeleton {
  display: block;
  width: 92px;
  height: 34px;
  border-radius: 999px;
  background: var(--bg-glass-black);
  border: 1px solid var(--border-color);
  opacity: 0.5;
}

.acct-login-btn {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.5rem 1.05rem;
  border-radius: 999px;
  cursor: pointer;
  color: #07210a;
  background: var(--accent-color);
  border: 1px solid var(--accent-color);
  box-shadow: 0 0 14px rgba(83, 252, 24, 0.35);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.acct-login-btn:hover,
.acct-login-btn:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 0 22px rgba(83, 252, 24, 0.55);
}

/* ---------------- dialogs ---------------- */

body.acct-modal-open { overflow: hidden; }

.acct-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  overflow-y: auto;
}

.acct-dialog {
  position: relative;
  width: 100%;
  max-width: 460px;
  margin: auto;
  padding: 1.6rem;
  border-radius: 18px;
  background: #120d0a;
  border: 1px solid var(--border-color);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.7);
}

.acct-dialog-close {
  position: absolute;
  top: 0.7rem;
  right: 0.85rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  background: none;
  border: none;
}
.acct-dialog-close:hover { color: var(--text-primary); }

.acct-dialog-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  margin: 0 2rem 0.35rem 0;
}

.acct-dialog-sub {
  margin: 0 0 1.1rem;
  font-size: 0.87rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.acct-steps { display: flex; flex-direction: column; gap: 0.6rem; }

.acct-step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.02);
}

.acct-step.is-done { border-color: rgba(83, 252, 24, 0.45); }

.acct-step-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.acct-step-icon svg { width: 20px; height: 20px; }

.acct-icon-kick { background: var(--accent-color); color: #07210a; }
.acct-icon-discord { background: #5865f2; color: #fff; }

.acct-step-body { flex: 1; min-width: 0; }
.acct-step-name { font-weight: 700; font-size: 0.92rem; }
.acct-step-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.acct-step-action { flex-shrink: 0; }

.acct-badge-done {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  color: var(--accent-light, #7dff54);
  border: 1px solid rgba(83, 252, 24, 0.5);
  background: rgba(83, 252, 24, 0.1);
}

.acct-btn {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  white-space: nowrap;
}

.acct-btn-kick { background: var(--accent-color); color: #07210a; }
.acct-btn-discord { background: #5865f2; color: #fff; }
.acct-btn-primary {
  background: var(--accent-color);
  color: #07210a;
  padding: 0.6rem 1.3rem;
  font-size: 0.85rem;
}
.acct-btn-primary:disabled { opacity: 0.6; cursor: default; }

/* Discord before Kick would set a cookie with no profile to attach it to,
   so it's held back rather than hidden — the order is the explanation. */
.acct-btn.is-disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.acct-note {
  margin: 0.9rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.acct-note-good { color: var(--accent-light, #7dff54); }
.acct-note-bad { color: #ff9d9d; }

.acct-fineprint {
  margin: 0.9rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.acct-idcard {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.03);
}

.acct-idcard-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.acct-idcard-body { min-width: 0; }
.acct-idcard-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  overflow: hidden;
  text-overflow: ellipsis;
}
.acct-idcard-meta {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  color: var(--accent-light, #7dff54);
  margin-top: 0.2rem;
}

.acct-section-title {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 1.5rem 0 0.6rem;
}

.acct-form { margin-top: 0.4rem; }
.acct-field { margin-bottom: 0.9rem; }

.acct-field-label {
  display: block;
  font-size: 0.83rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.acct-field-hint {
  font-size: 0.73rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.acct-input {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  font-size: 0.88rem;
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-color);
}

.acct-input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(83, 252, 24, 0.15);
}

.acct-input.is-readonly { opacity: 0.65; cursor: default; }

.acct-form-actions { margin-top: 1.1rem; }

.acct-form-msg {
  margin: 0.7rem 0 0;
  font-size: 0.82rem;
  font-weight: 600;
  min-height: 1.2em;
}
.acct-form-msg.is-good { color: var(--accent-light, #7dff54); }
.acct-form-msg.is-bad { color: #ff9d9d; }

@media (max-width: 560px) {
  .acct-dialog { padding: 1.25rem; }
  .acct-step { flex-wrap: wrap; }
  .acct-step-action { width: 100%; }
  .acct-step-action .acct-btn { display: block; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  .acct-login-btn,
  .acct-chip { transition: none; }
  .acct-login-btn:hover { transform: none; }
}
