/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ── Variables ── */
:root {
  --accent:        #7c6aef;
  --accent-hover:  #6a58d4;
  --accent-soft:   rgba(124, 106, 239, 0.12);
  --accent-border: rgba(124, 106, 239, 0.3);
  --accent-glow:   rgba(124, 106, 239, 0.25);

  --bg-base:       #08080f;
  --bg-surface:    #0e0e1a;
  --bg-elevated:   #14141f;
  --bg-input:      #0a0a14;
  --bg-hover:      rgba(255, 255, 255, 0.04);

  --border:        rgba(255, 255, 255, 0.06);
  --border-bright: rgba(255, 255, 255, 0.1);

  --text-primary:   rgba(255, 255, 255, 0.92);
  --text-secondary: rgba(255, 255, 255, 0.55);
  --text-muted:     rgba(255, 255, 255, 0.28);
  --text-label:     rgba(255, 255, 255, 0.7);

  --danger:       #f87171;
  --success:      #4ade80;

  --radius-sm:    6px;
  --radius-md:    12px;
  --radius-lg:    18px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition: all 0.15s ease;
}

html, body {
  min-height: 100%;
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

/* ════════════════════════════════════════
   ANIMATED BACKGROUND
════════════════════════════════════════ */
.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-glow::before {
  content: '';
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 500px;
  background: radial-gradient(ellipse at center,
    rgba(124, 106, 239, 0.12) 0%,
    transparent 70%);
  animation: glow-pulse 6s ease-in-out infinite alternate;
}

@keyframes glow-pulse {
  from { opacity: 0.6; transform: translateX(-50%) scale(1);   }
  to   { opacity: 1;   transform: translateX(-50%) scale(1.1); }
}

/* ════════════════════════════════════════
   LOGIN PAGE
════════════════════════════════════════ */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  position: relative;
  z-index: 1;
}

.login-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--border);
}

/* Logo / branding */
.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 28px;
}

.login-logo-icon {
  width: 40px;
  height: 40px;
  background: var(--accent-soft);
  border: 1.5px solid var(--accent-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  filter: drop-shadow(0 0 10px var(--accent-glow));
}

.login-logo-name {
  font-size: 20px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.5px;
}

/* Headings */
.login-heading {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  text-align: center;
  letter-spacing: -0.4px;
  margin-bottom: 6px;
}

.login-subheading {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 28px;
  line-height: 1.5;
}

/* Form */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-label);
  margin-bottom: 6px;
}

.form-label .required {
  color: var(--danger);
  margin-left: 2px;
}

.input-wrap {
  position: relative;
}

.form-input {
  width: 100%;
  background: var(--bg-input);
  border: 1.5px solid var(--border-bright);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input::placeholder { color: var(--text-muted); }

.form-input:focus {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input.has-toggle { padding-right: 44px; }

/* Password toggle */
.pw-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color 0.15s;
}

.pw-toggle:hover { color: var(--text-secondary); }

/* Ban notice */
.ban-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.25);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--danger);
  line-height: 1.5;
}

/* Error message */
.form-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 6px;
  display: none;
}

.form-error.visible { display: block; }

/* Submit button */
.btn-login {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 13px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
  letter-spacing: -0.1px;
  margin-top: 8px;
}

.btn-login:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 20px rgba(124, 106, 239, 0.4);
}

.btn-login:active { transform: scale(0.99); }

/* Footer links */
.login-footer {
  margin-top: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.login-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.login-footer a:hover { text-decoration: underline; }

/* ════════════════════════════════════════
   PROFILE PAGE
════════════════════════════════════════ */
.profile-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* Top bar */
.profile-topbar {
  height: 52px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.topbar-brand-icon {
  width: 28px;
  height: 28px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.topbar-brand-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.4px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-topbar {
  background: var(--bg-elevated);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-topbar:hover { color: var(--text-primary); background: var(--bg-hover); }

.btn-topbar.primary {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
}

.btn-topbar.primary:hover { background: var(--accent-hover); }

/* Profile layout */
.profile-body {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 24px;
  gap: 24px;
}

/* Profile card */
.profile-card {
  width: 340px;
  flex-shrink: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.profile-banner {
  height: 100px;
  background: linear-gradient(135deg, #3d2fa0 0%, #7c6aef 50%, #a855f7 100%);
  position: relative;
  flex-shrink: 0;
}

.profile-avatar-wrap {
  position: absolute;
  bottom: -20px;
  left: 16px;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 4px solid var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
  user-select: none;
}

.profile-status-dot {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #4ade80;
  border: 3px solid var(--bg-surface);
}

/* Card body */
.profile-card-body {
  padding: 28px 16px 16px;
}

.profile-username {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.4px;
}

.profile-tag {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 1px;
}

.profile-status-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  font-size: 12px;
  color: #4ade80;
  font-weight: 600;
}

.status-pip {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.profile-divider {
  height: 1px;
  background: var(--border);
  margin: 14px 0;
}

/* Badges */
.profile-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-bright);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* About me */
.profile-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.profile-about {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 14px;
}

/* Member since */
.profile-since {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Right panel — settings summary */
.profile-panel {
  flex: 1;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel-block {
  background: var(--bg-surface);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.panel-block-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
  letter-spacing: -0.1px;
}

.panel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.panel-row:last-child { border-bottom: none; }

.panel-row-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.panel-row-value {
  font-size: 14px;
  color: var(--text-primary);
}

.btn-edit {
  background: var(--bg-elevated);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-edit:hover { color: var(--text-primary); background: var(--bg-hover); }

/* ── Focus ── */
button:focus-visible, input:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ════════════════════════════════════════
   PANEL — INLINE EDIT FORMS
════════════════════════════════════════ */
.panel-inline-form {
  display: none;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.panel-inline-form.visible { display: flex; }

.panel-inline-input {
  width: 100%;
  background: var(--bg-input);
  border: 1.5px solid var(--border-bright);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.panel-inline-input::placeholder { color: var(--text-muted); }

.panel-inline-input:focus {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.panel-inline-actions {
  display: flex;
  gap: 8px;
}

.btn-save {
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  padding: 7px 16px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-save:hover { background: var(--accent-hover); }
.btn-save:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-cancel-inline {
  background: var(--bg-elevated);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.btn-cancel-inline:hover { color: var(--text-primary); }

.panel-status {
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
  min-height: 16px;
}

.panel-status.success { color: var(--success); }
.panel-status.error   { color: var(--danger); }

/* ════════════════════════════════════════
   PANEL — CHANGE PASSWORD BLOCK
════════════════════════════════════════ */
.pw-change-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pw-change-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* ════════════════════════════════════════
   PANEL — DANGER ZONE
════════════════════════════════════════ */
.panel-block.danger {
  border-color: rgba(248, 113, 113, 0.25);
}

.panel-block.danger .panel-block-title {
  color: var(--danger);
}

.btn-danger {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.35);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  color: var(--danger);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-danger:hover {
  background: rgba(248, 113, 113, 0.2);
  border-color: rgba(248, 113, 113, 0.6);
}

/* ════════════════════════════════════════
   DELETE CONFIRMATION MODAL
════════════════════════════════════════ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.visible { display: flex; }

.modal-card {
  background: var(--bg-surface);
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}

.modal-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--danger);
  margin-bottom: 10px;
  letter-spacing: -0.3px;
}

.modal-body {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}

.modal-body strong { color: var(--text-primary); }

.modal-confirm-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.modal-confirm-input {
  width: 100%;
  background: var(--bg-input);
  border: 1.5px solid var(--border-bright);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  margin-bottom: 16px;
}

.modal-confirm-input:focus {
  border-color: rgba(248, 113, 113, 0.5);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.15);
}

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.btn-modal-cancel {
  background: var(--bg-elevated);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.btn-modal-cancel:hover { color: var(--text-primary); }

.btn-modal-delete {
  background: var(--danger);
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn-modal-delete:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-modal-delete:not(:disabled):hover { opacity: 0.85; }

/* ════════════════════════════════════════
   MOBILE — PROFILE PAGE
════════════════════════════════════════ */
@media (max-width: 768px) {
  .profile-body {
    flex-direction: column;
    align-items: stretch;
    padding: 20px 16px;
  }

  .profile-card {
    width: 100%;
  }

  .profile-panel {
    max-width: 100%;
  }
}
