.modal {
  position: fixed;
  inset: 0;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.55);
  z-index: 9999;
  display: none;
}
.modal.show { display: flex; }

#auth_modal .modal-content {
  background: var(--bg-surface);
  border-radius: 16px;
  padding: 32px 28px;
  width: 100%;
  max-width: 360px;
  border: 0.5px solid rgba(255,255,255,0.1);
}

.auth-header { text-align: center; margin-bottom: 24px; }
.auth-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(31,87,158,0.25);
  border: 0.5px solid rgba(31,87,158,0.4);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
}
.auth-avatar i { font-size: 20px; color: #5a9fd4; }
.auth-title { font-size: 16px; font-weight: 500; color: var(--text-primary); margin: 0; }
.auth-subtitle { font-size: 13px; color: var(--text-secondary); margin: 4px 0 0; }

.auth-back-header { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }
.auth-back-header .auth-title { font-size: 15px; }
.auth-back {
  background: none; border: none; cursor: pointer;
  color: var(--text-secondary); padding: 4px; line-height: 1;
}
.auth-back i { font-size: 18px; }

.auth-fields { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.auth-field { position: relative; }
.auth-field i {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  font-size: 15px; color: var(--text-muted); pointer-events: none;
}
.auth-field input {
  width: 100%; padding: 10px 12px 10px 34px;
  background: var(--bg-base);
  border: 0.5px solid rgba(255,255,255,0.1);
  border-radius: 8px; color: var(--text-primary); font-size: 14px;
}
.auth-field input:focus { outline: none; border-color: var(--accent); }
.auth-field input::placeholder { color: var(--text-muted); }

.auth-link {
  background: none; border: none; color: var(--text-secondary);
  font-size: 12px; cursor: pointer; padding: 0; margin-bottom: 16px; display: block;
}
.auth-link:hover { color: var(--text-primary); }

.auth-primary {
  width: 100%; padding: 11px; background: var(--accent);
  border: none; border-radius: 8px; color: #fff;
  font-size: 14px; font-weight: 500; cursor: pointer; letter-spacing: 0.3px;
}
.auth-primary:hover { background: var(--accent-hover); }
.auth-primary:active { background: var(--accent-pressed); }
.auth-primary:disabled { background: var(--accent-disabled); cursor: not-allowed; }

.auth-divider {
  display: flex; align-items: center; gap: 10px; margin: 18px 0;
}
.auth-divider span { flex: 1; height: 0.5px; background: rgba(255,255,255,0.08); }
.auth-divider small { font-size: 12px; color: var(--text-muted); }

.auth-secondary {
  width: 100%; padding: 10px; background: transparent;
  border: 0.5px solid rgba(255,255,255,0.12);
  border-radius: 8px; color: var(--text-secondary); font-size: 13px; cursor: pointer;
}
.auth-secondary:hover { color: var(--text-primary); border-color: rgba(255,255,255,0.2); }